-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
perhaps an -L flag is missing? error doesn't print -L flags given or any other info #1219
Comments
I don't think that we'll get to quite that level of fidelity with an error message because this error is being generated by the compiler, not by Cargo itself, but I'd believe that it could certainly improve! |
I think it is important to break the glass to see what's happening inside. Sometimes the first step goes (falsely) successful, but it caused later steps to fail. So, debugging the whole build process needs to be possible. |
GDB in Rust part of the build script wouldn't help me much, since my Rust build scripts are: fn main() {
if !std::io::Command::new("./src/build.sh")
.stdout(::std::io::process::InheritFd(1))
.stderr(::std::io::process::InheritFd(2))
.status().unwrap().success() {
panic!("Script failed");
}
} |
But what is the reason for eating it? So far I've seen "it looks clean!". So to me it's
I feel like Cargo is highly "opinionated" and its opinions completely don't match mine. On every step I'm fighting around it :( I want to use "printf debugging", without stopping the program, since it's easy and works with entire toolchain that I'm using. I can't imagine how could I possibly use GDB to debug the mountain of crap scripts that autotools spits out. Since pure Rust build scripts are supposed to be the right way, I've tried that. I gave up after my 4-line bash script started to exceed 100 Rust lines. |
You can achieve your goal by:
Maybe we can make a helper library to do what we want to do without modifying Cargo. |
@alexcrichton I've done that: #1106 (comment) |
Gah sorry! Thanks for weighing in though :) |
As there hasn't been any activity here in a while would someone (the author, a team member, or any interested party) be able to summarise the current state, perhaps making explicit:
Thank you! (The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.) If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable! |
As I didn't see any updates in 30 days I'm going to close this. Please see the previous comment for more information! |
I keep running into this problem:
I write a build script that seems to work fine (no panics) and outputs
-L
flags that I hope are correctSomething isn't right and Cargo tells me
To me information printed by Cargo, even in verbose mode, is insufficient to diagnose the problem.
I could try to guess if it got flags by searching the long noisy " Running
rustc…
" lines, but the paths are usually based on random-looking expansion ofOUT_DIR
(e.g. I see different hash in paths when I addpanic!()
to my script and I don't know if that's normal), so I don't really know what paths I'm looking at. Due to Request not to suppress the output of build script #1106 it's a pain to find that out.It would be so much nicer if Cargo had message such as:
The text was updated successfully, but these errors were encountered: