Skip to content
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

make backtrace = false compile for windows targets. #44979

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

hinaria
Copy link
Contributor

@hinaria hinaria commented Oct 2, 2017

when building for windows with backtrace = false, libstd fails to compile because some modules that use items from sys_common::backtrace::* are still included, even though those modules aren't used or referenced by anything.

sys_common::backtrace doesn't exist when the backtrace feature is turned off.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dtolnay (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.

@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 2017
@dtolnay
Copy link
Member

dtolnay commented Oct 3, 2017

Thanks! Looks good to me. The unix implementation of std::sys already uses similar code here.

@bors r+

@bors
Copy link
Contributor

bors commented Oct 3, 2017

📌 Commit a5296a5 has been approved by dtolnay

@bors
Copy link
Contributor

bors commented Oct 4, 2017

⌛ Testing commit a5296a5 with merge 2db48d7...

bors added a commit that referenced this pull request Oct 4, 2017
make `backtrace = false` compile for windows targets.

when building for windows with `backtrace = false`, `libstd` fails to compile because some modules that use items from `sys_common::backtrace::*` are still included, even though those modules aren't used or referenced by anything.

`sys_common::backtrace` doesn't exist when the backtrace feature is turned off.

--

i've also added `#[cfg(feature = "backtrace")]` to various items that exist exclusively to support `mod backtrace` since the compilation would fail since they would be unused in a configuration with backtraces turned off.
@bors
Copy link
Contributor

bors commented Oct 4, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: dtolnay
Pushing 2db48d7 to master...

@bors bors merged commit a5296a5 into rust-lang:master Oct 4, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Nov 4, 2017
Fix libstd compile error for windows-gnu targets without `backtrace`

This is basically an addition to rust-lang#44979. Compiling `libstd` still fails when targeting `windows-gnu` with `panic = "abort"` because the items in the `...c::gnu` module are not used. They are only referenced from `backtrace_gnu.rs`, which is indirectly feature gated behind `backtrace` [here](https://github.com/rust-lang/rust/blob/9f3b09116b742b2606dc5f36f9145e0c89e4010b/src/libstd/sys/windows/mod.rs#L23).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants