-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustbuild: make backtraces (RUST_BACKTRACE) optional #35051
Conversation
but keep them enabled by default to maintain the status quo. When disabled shaves ~56KB off every x86_64-unknown-linux-gnu binary. To disable backtraces you have to use a config.toml (see src/bootstrap/config.toml.example for details) when building rustc/std: $ python bootstrap.py --config=config.toml
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -71,6 +73,7 @@ enum Hook { | |||
|
|||
static HOOK_LOCK: RWLock = RWLock::new(); | |||
static mut HOOK: Hook = Hook::Default; | |||
#[cfg(feature = "backtrace")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could some of these imports move down below in the #[cfg]
'd block to avoid the number of #[cfg]
annotations?
Thanks @japaric! I think this may also want to update the makefiles as well though to ensure that we compile libstd with |
cc @brson |
lgtm |
As implemented, this only works with rustbuild. Want me to extend this to work with the old Makefile based build system? And probably expose this via a |
Oh I mean in terms of wouldn't a libstd built with the makefiles not have backtraces enabled? (because it's missing the I'm totally fine not adding this feature to the makefiles, in fact I'd actively prefer that it weren't added to the makefiles! |
Oh, right. I didn't really test this with the old build system 😈. Can't wait until the old build system is gone so that I don't have to test all my PRs twice! I think I'll instead change the cfgs to something like |
amen |
Updated the PR with the fix for the Makefiles and also reduced the number of cfgs. |
⌛ Testing commit 774fbdf with merge b1291cf... |
⛄ The build was interrupted to prioritize another pull request. |
rustbuild: make backtraces (RUST_BACKTRACE) optional but keep them enabled by default to maintain the status quo. When disabled shaves ~56KB off every x86_64-unknown-linux-gnu binary. To disable backtraces you have to use a config.toml (see src/bootstrap/config.toml.example for details) when building rustc/std: $ python bootstrap.py --config=config.toml --- r? @alexcrichton cc rust-lang/rfcs#1417
but keep them enabled by default to maintain the status quo.
When disabled shaves ~56KB off every x86_64-unknown-linux-gnu
binary.
To disable backtraces you have to use a config.toml (see
src/bootstrap/config.toml.example for details) when building rustc/std:
$ python bootstrap.py --config=config.toml
r? @alexcrichton
cc rust-lang/rfcs#1417