You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, I'm trying to build an npm package for nodejs projects using Wasm binaries compiled from Rust. And for packaging automation using wasm-pack, nix flakes, and crane.
But wasm-pack failed with:
Error: Read-only file system (os error 30)
Caused by: Read-only file system (os error 30)
But when using cargo build manually, with wasm-bindgen-cli and self-made scripts to emulate some of the wasm-pack features, everything works fine.
🤔 Expected Behavior
Work without fail or at least with more reasonable error messages
👟 Steps to reproduce
My minimal reproduce setup:
rustToolchain=pkgs.rust-bin.fromRustupToolchainFile./rust-toolchain.toml;craneLib=(crane.mkLibpkgs).overrideToolchainrustToolchain;src=withpkgs;lib.cleanSourceWith{src=./.;# The original, unfiltered sourcefilter=path: type:
# Default filter from crane (allow .rs files)(craneLib.filterCargoSourcespathtype);};commonArgs={inheritsrc;pname="tools";nativeBuildInputs=withpkgs;[# in future add other deps]++lib.optionalstdenv.isDarwin[libiconv];};wasmArgs=commonArgs//{inheritsrc;pname="hardhat-diamond-tools";cargoExtraArgs="--package=diamond-tools-plugin";CARGO_BUILD_TARGET="wasm32-unknown-unknown";};wasmArtifacts=craneLib.buildDepsOnly(wasmArgs//{doCheck=false;});# Required to not rebuild the artifacts when `.js` files changepluginSrc=withpkgs;lib.cleanSourceWith{src=./.;# The original, unfiltered sourcefilter=path: type:
(lib.hasSuffix"\.js"path)||# For plugin javascript(lib.hasSuffix"\.json"path)||# For package.json(lib.hasSuffix"\.sh"path)||# For scripts(lib.hasSuffix"\.ts"path)||# For typescript files in plugin(lib.hasSuffix"README.md"path)||# Default filter from crane (allow .rs files)(craneLib.filterCargoSourcespathtype);};plugin=craneLib.mkCargoDerivation(wasmArgs//rec{src=pluginSrc;# replace src with filtered sourcecargoArtifacts=wasmArtifacts;cargoExtraArgs="";doCheck=false;buildPhaseCargoCommand='' mkdir -p $out/pkg wasm-pack --verbose build -t nodejs -m normal --out-dir $out/pkg $src/plugin '';buildInputs=withpkgs;[wasm-packwasm-bindgen-clinodejscargo-generatecargo-expandbinaryen];});
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.11.1 from nixpkgs
rustc version: 1.70.0 (d59363ad0 2023-06-01)
UPD: updated rustc to stable version. Also using Mac as OS
The text was updated successfully, but these errors were encountered:
🐛 Bug description
Currently, I'm trying to build an npm package for
nodejs
projects using Wasm binaries compiled from Rust. And for packaging automation usingwasm-pack
, nix flakes, andcrane
.But
wasm-pack
failed with:But when using
cargo build
manually, withwasm-bindgen-cli
and self-made scripts to emulate some of thewasm-pack
features, everything works fine.🤔 Expected Behavior
Work without fail or at least with more reasonable error messages
👟 Steps to reproduce
My minimal reproduce setup:
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.11.1 from
nixpkgs
rustc version: 1.70.0 (d59363ad0 2023-06-01)
UPD: updated rustc to stable version. Also using Mac as OS
The text was updated successfully, but these errors were encountered: