-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Build script failure hidden by dependency build failure #835
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
Comments
This is actually ordering-dependent and relies on the fact that we capture build script output rather than printing it by default. We probably shouldn't discard all extra output though. |
@alexcrichton is It still open? I would like to contribute |
@marti1125 I think this may have actually been fixed in the meantime, but if you'd like to add a test for this that'd be most welcome! |
@alexcrichton could you tell me more about the test please =D |
Sure yeah, all of Cargo's tests live in |
I think it hasn't, sadly. It's also slightly bit-rot: I changed fn main() { panic!("boom!"); } The new output is fundamentally the same: $ cargo clean && cargo build
Compiling b v0.0.1 (file:///s/t-build-script-failure/b)
Compiling a v0.0.1 (file:///s/t-build-script-failure/a)
error: expected one of `!` or `::`, found `<eof>`
--> /s/t-build-script-failure/b/src/lib.rs:1:1
|
1 | invalid
| ^^^^^^^ expected one of `!` or `::` here
error: aborting due to previous error
error: Could not compile `b`.
warning: build failed, waiting for other jobs to finish...
error: build failed How should the other failures be reported? With |
@dwijnand in your reproduction are you sure that the build script executed? It may be that the build script was only compiled, not run, in that example |
Given fn main() {
use std::fs::File;
use std::io::prelude::*;
let mut file = File::create("marker.txt").unwrap();
file.write_all(b"Hi Alex!").unwrap();
panic!("boom!");
} Looks like it doesn't even run the build script! 17:40:35 $ cargo clean && cargo build
Compiling a v0.0.1 (file:///s/t-build-script-failure/a)
Compiling b v0.0.1 (file:///s/t-build-script-failure/b)
error: expected one of `!` or `::`, found `<eof>`
--> /s/t-build-script-failure/b/src/lib.rs:1:1
|
1 | invalid
| ^^^^^^^ expected one of `!` or `::` here
error: aborting due to previous error
error: Could not compile `b`.
warning: build failed, waiting for other jobs to finish...
error: build failed
17:40:54 ! cat marker.txt
cat: marker.txt: No such file or directory
Am I not accurately reproducing the reported issue? Maybe I've misunderstood some part of it. |
@dwijnand oh if you execute
where the build script wasn't even executed here, it was just compiled |
So where does this leave this issue? I thought the whole premise is that the build script failure should be output. But if it doesn't even run.. |
@dwijnand oh I think this has since been basically fixed, although it may not be easily testable. Cargo will stop running commands as soon as one fails, which is why you're not seeing the build script output |
Oh I see! Then I'll leave this one as is. (and suggest dropping E-easy) |
Im trying to build cargo but got an error achala@laptop:~/GIT/mir2wasm$ cargo build --- stderr build script failed, must exit now', /home/achala/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.33/src/lib.rs:773:5 |
I'm going to close this, I don't think there is anything to do here. What happens depends on what is being built, and in both cases I think Cargo does the right thing. I don't think a test would be helpful here. The dependency graph looks like:
In a clean state, |
// b/src/lib.rs invalid
Then in
a
:The user is probably certainly more interested in the build script failing to build/run than the dependency. @alexcrichton's suggested resolution of #832 would possibly resolve this automatically too.
The text was updated successfully, but these errors were encountered: