Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filesystem related errors do not specify files/directories in dioxus-cli #3638

Open
crabdancing opened this issue Jan 24, 2025 · 0 comments
Open

Comments

@crabdancing
Copy link

crabdancing commented Jan 24, 2025

Problem

The filesystem related errors seem to rarely, if ever, specify what file they're talking about. For example, I got this while trying to write a Nixified reproducible wrapper for a Dioxus app on which I'm working:

 112.859s DEBUG dx::build::request: Build completed successfully - output location: "/build/pdkcmjk4iv38xiqa39qzfdhv72yrrx0x-source/nicole_dioxus/./target/wasm32-unknown-unknown/release/nicole_dioxus.wasm"
 112.859s DEBUG dx::build::request: Collecting assets ...
 112.861s DEBUG dx::build::bundle: Assembling app bundle
 112.861s DEBUG dx::build::bundle: Running wasm-bindgen dx_src=bundle
 112.861s  INFO dx::build::builder: Bundling app...
 112.861s  INFO dx::build::builder: Running wasm-bindgen...
 112.986s DEBUG dx::build::bundle: wasm-bindgen complete in 124.06821ms dx_src=bundle
 112.986s  INFO dx::build::bundle: Running optimization with wasm-opt... dx_src=build
 112.986s DEBUG dx::build::builder: Setting builder to failed state
 112.986s ERROR dx::build::builder: 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))
 112.987s ERROR dx: 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))

Notably, this is the output when using --trace --debug. This is unfortunately a significant pain to debug, when most if not errors are like this.

Or, e.g., this if the target dir is made unreadable via Unix perms:

thread 'tokio-runtime-worker' panicked at packages/cli/src/dioxus_crate.rs:177:39:
called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
   0.695s ERROR err=Runtime("Build panicked! JoinError::Panic(Id(25), \"called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: \\\"Permission denied\\\" }\", ...)")
   0.697s ERROR err=Runtime("Build panicked! JoinError::Panic(Id(25), \"called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: \\\"Permission denied\\\" }\", ...)")

Steps To Reproduce

The first one is somewhat complicated to reproduce, but the second can be reproduced by simply chmod -x target.

Expected behavior

dioxus-cli should give clear information when it runs into an error concerning the filesystem. In particular, it should tell you exactly what target files are in question, so that it's easier to figure out what's going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant