-
Notifications
You must be signed in to change notification settings - Fork 31
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
Os { code: 2, kind: NotFound, message: "No such file or directory" } #14
Comments
Assuming the name of the missing file is $ time cargo metadata --format-version 1 | json_reformat | grep workspace_root
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' with args: 'metadata --format-version 1'
"workspace_root": "/home/xftroxgpx/build/2nonpkgs/rust.stuff/rustlearnage"
real 0m0.432s
user 0m0.397s
sys 0m0.044s instead of in $ time cargo metadata --format-version 1 | json_reformat | grep root|grep built_example
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' with args: 'metadata --format-version 1'
"root": "built_example 0.1.0 (path+file:///home/xftroxgpx/build/2nonpkgs/rust.stuff/rustlearnage/built_example)"
real 0m0.418s
user 0m0.381s
sys 0m0.049s |
I'm closing this for now, please re-open if this is still a problem |
@lukaslueg I've the same issue |
For 0.7.2, the code is here: Line 71 in acc6475
the fix might be this: To trigger the issue: [build-dependencies]
built = { version="0.7.2", features = [ "dependency-tree" ] } ie. it needs output:
why? because this is a project in a workspace, so With the fix, it would look like this:
Not sure when this other code is supposed to execute, but might need same fix: Line 141 in acc6475
|
What is the name of the missing file?
This also illustrates a deeper concern likely present in most idiomatic Rust programs:
build.rs:7
is:main.rs
is:write_built_file_with_opts2
is:Ok now to save anyone some time, I'm guessing(!) that the name of the file is:
but you see what I mean? it's not easy to figure it out really, from just the stacktrace and the generic "No such file or directory" error.
This is my biggest Rust show-stopper yet! And man, I am dissapoint! :)
(I can only hope that I'm missing something that I just can't see right now; like there's some way the error includes the stacktrace of all the places it was handed off to and that can be somehow shown; or the error can be made to show the filename)
EDIT: looks like what I want, to restore some faith in Rust, is https://docs.rs/error-chain/0.11.0/error_chain/
EDIT:
failure
seems to be a potentially bettererror-chain
? https://github.com/withoutboats/failure Well, at least according to thisThe text was updated successfully, but these errors were encountered: