mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-01 07:21:17 +00:00
fix(build): update target to wasm32-wasip1 for improved WASI support
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
095ab6becf
commit
b592b1f2fa
@ -63,10 +63,10 @@ endif
|
||||
|
||||
# Rust plugin builds (generic rule for any folder with Cargo.toml)
|
||||
# Note: Rust crate names use underscores, but plugin names use hyphens
|
||||
# Uses the target specified in each plugin's .cargo/config.toml (defaults to wasm32-unknown-unknown)
|
||||
# All Rust plugins use wasm32-wasip1 for WASI support (filesystem, etc.)
|
||||
RUST_TARGET := wasm32-wasip1
|
||||
RUSTUP_CARGO := $(shell rustup which cargo 2>/dev/null || echo cargo)
|
||||
RUSTUP_RUSTC := $(shell rustup which rustc 2>/dev/null)
|
||||
$(RUST_PLUGINS:%=%.wasm): %.wasm: %/Cargo.toml $$(wildcard %/src/*.rs)
|
||||
$(eval RUST_TARGET := $(shell grep -A1 '^\[build\]' $*/.cargo/config.toml 2>/dev/null | grep 'target' | sed 's/.*= *"\([^"]*\)".*/\1/' || echo "wasm32-unknown-unknown"))
|
||||
cd $* && CARGO_BUILD_RUSTC=$(RUSTUP_RUSTC) $(RUSTUP_CARGO) build --release --target $(RUST_TARGET)
|
||||
cp $*/target/$(RUST_TARGET)/release/$(subst -,_,$*).wasm $@
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
[build]
|
||||
target = "wasm32-unknown-unknown"
|
||||
target = "wasm32-wasip1"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user