-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Note build profile in cargo build
output
#1309
Comments
From @Valloric on this thread, yet another story of a user not knowing about optimizations and the |
I'd like to add a suggestion that this nag message could be disabled via a Cargo config flag. Also, it isn't necessarily true that the release profile is optimized and the debug profile is not, so Cargo should probably check these things before printing those messages. |
I do agree that this does seem like a problem, but I really do worry about non-newbie users. As soon as you know the difference you never want to see this message again, and I suspect that all Rust programmers will eventually know the difference. This means that if configuration is required it will mean that all Rust programmers will want that configuration. This indicates to me that it may be the wrong default. It's definitely a tricky problem figuring out the best way to show this, but I just wanted to lay out some of my own personal worries. |
@alexcrichton I'm not sure I understand why it would be an issue. It's a one-line message that should only show up when the "Compiling foo..." notice would appear anyway. Even for non-newbie users it would be useful as a configuration check like "whoops, I forgot to pass --release that time". I would definitely agree more if |
In general, I tend to prefer the Unixism of 'dont print anything unless it's unexpected'. We don't exactly keep to that in Cargo, but there's a number of these kinds of suggestions to keep adding things to the output. |
@steveklabnik If Cargo did that, then all of the current notices about compiling, downloading dependencies, etc. would not be printed either. |
I know. |
I don't know of any build systems off the top of my head that are completely silent by default. |
I wouldn't like extra "educational" lines in the output (they get boring quickly), but perhaps the existing "Compiling…" line could be changed accordingly from:
To something like:
|
For |
This commit changes the "Compiling" message of cargo: # old Compiling foo v0.1.0 # new Compiling (debug) foo v0.1.0 This change is aimed at preventing mistakenly thinking that `cargo build` produces optimized binaries as well as providing a clear indication of whether the build is a debug build or a release build. Closes rust-lang#1309
Having the debug/release folders has ended up meaning that I haven't seen this in quite some time, so I'm going to close this for now as the debug/release folder seems to be sufficient. |
Running a "debug" binary provides zero indication to developers coming from Ruby, Python, Java, JavaScript, C# or the other languages that together make up 90% of all modern development that the binary is vastly slower than a release build. We've been over this many, many times now. Dozens of people have pointed this out in discourse threads, RFC comments, r/rust discussions etc. "Debug" is not enough. There needs to be something telling these users that an unoptimized build is being produced/run. Running a binary from a folder named "debug" does not convey this information. |
Currently the output of the
cargo build
command does not reference the build profile (debug/default or release) anywhere in its output. This creates two issues:I propose that the output of
cargo build
and similar "building" commands go from:to
and
The text was updated successfully, but these errors were encountered: