Conversation
|
After upgrading my flake to 0.6.2 from this PR, I can no longer build the flake: 48.413s ERROR err=Other(Failed to write main executable
Caused by:
0: I/O Error: No such file or directory (os error 2)
1: No such file or directory (os error 2))
48.414s ERROR err=Other(Failed to write main executable
Caused by:
0: I/O Error: No such file or directory (os error 2)
1: No such file or directory (os error 2)) Wonder if I am doing something stupid. But unfortunately those messages are remarkably unhelpful. Will continue to investigate. |
Same, wasm-opt is from binaryen but even when its in my $PATH in the buildphase I get this error |
|
strace shows is was writing to:
But then it tries reading from:
Which of course doesn't exist. Some how this is only a problem when building with "--release", and occurs when building outside a flake also. i.e. The first build command works, the second fails. |
|
https://github.com/DioxusLabs/dioxus/blob/c85018300b5ee4df3f715ec9507421b3892317a5/packages/cli/src/build/bundle.rs#L712 This function returns early on non release |
|
Doesn't appear to be a Nix specific issue. I can recreate the issue by building one of the examples in the Dioxus repo. cargo run --package dioxus-cli --features no-downloads,optimizations -- build --example hello_world --platform web --release Changing this line seems to fix the issue. // Only run wasm-opt if the feature is enabled
// Wasm-opt has an expensive build script that makes it annoying to keep enabled for iterative dev
// We put it behind the "wasm-opt" feature flag so that it can be disabled when iterating on the cli
- self.run_wasm_opt(&self.build.exe_dir())?;
+ self.run_wasm_opt(&self.build.wasm_bindgen_out_dir())?; 1.446s INFO Running optimization with wasm-opt...
8.776s INFO Copying asset (0/2): /home/cmullan/workspace/dioxus/target/dx/hello_world/release/web/public/wasm-bindgen/hello_world.js
8.776s INFO Copying asset (1/2): /home/cmullan/workspace/dioxus/target/dx/hello_world/release/web/public/wasm-bindgen/hello_world_bg.wasm
14.343s INFO Build completed successfully! 🚀 path="/home/cmullan/workspace/dioxus/target/dx/hello_world/release/web/public" |
My testing agrees When using dx from cargo (without optimization feature) I have a successful build which is unsurprising. When using dx from this PR (with optimization feature) and in a When reinstalling dx from cargo with optimizations flag enabled I get the same error |
|
I've created an issue upstream DioxusLabs/dioxus#3659 |
5ed79cb to
dfd17c5
Compare
Just to clarify, you don't need binaryen in your $PATH, it's bundled as a library via wasm-opt-rs. |
dfd17c5 to
cc2fac1
Compare
|
Pushed an update to resolve the conflict caused by #376038 |
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.