-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Only error about MSVC + PGO + unwind if we're generating code #62615
Conversation
…ding on Windows." This reverts commit 74a39a3.
When `rustc` is invoked with the `--print` argument, we don't actually generate any code (unless it's the `native-static-libs` option). So we don't need to error our in this case since there's no risk of generating either LLVM assertions or corrupted binaries.
r? @zackmdavis (rust_highfive has picked a reviewer for you, use r? to override) |
if sess.opts.cg.profile_generate.enabled() && | ||
sess.target.target.options.is_like_msvc && | ||
sess.panic_strategy() == PanicStrategy::Unwind { | ||
sess.panic_strategy() == PanicStrategy::Unwind && | ||
sess.opts.prints.iter().all(|&p| p == PrintRequest::NativeStaticLibs) { |
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.
Is this all
because, when we are "printing" native static libs, that's the only thing we print? (I would sort of expect any
.)
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.
PrintRequest::NativeStaticLibs
is special in that we still generate binaries and we also emit an info message with details about those native libs during that process. All of the other print options halt compilation after the requested information is printed.
I used .all()
here because we want the following behavior:
all(prints: []) => true // this causes the error to be emitted
all(prints: [NativeStaticLibs]) => true // this causes the error to be emitted
all(prints: [ _ ]) => false // skip emitting the error since we're going to stop compilation after printing the requested data
(Nominating for beta since otherwise the version of PGO that ships can't actually be used in FF, and this is a small change.) |
Accepted for backport. When backporting keep in mind the comment above. |
@bors r+ |
📌 Commit 3622311 has been approved by |
Only error about MSVC + PGO + unwind if we're generating code In rust-lang#61853, we changed the error when using PGO & MSVC toolchain & panic=unwind into a warning. However, in the compiler team meeting on 2019-07-11, we found that not everybody was in favor of that change because of the possibility of broken binaries. This PR reverts that change so this is again an error. However, to work around an [issue the Firefox team is having](rust-lang#61002 (comment)), we will only emit the error if we're actually supposed to generate a binary. If the `rustc` is invoked with `--print` arguments (which means that no binary will actually be emitted), then we won't emit the error because there is not a possibility of the issue occurring. cc @EricRahm @nikomatsakis @pnkfelix @Centril
Rollup of 15 pull requests Successful merges: - #61926 (Fix hyperlinks in From impls between Vec and VecDeque) - #62615 ( Only error about MSVC + PGO + unwind if we're generating code) - #62696 (Check that trait is exported or public before adding hint) - #62712 (Update the help message on error for self type) - #62728 (Fix repeated wording in slice documentation) - #62730 (Consolidate hygiene tests) - #62732 (Remove last use of mem::uninitialized from std::io::util) - #62740 (Add missing link to Infallible in TryFrom doc) - #62745 (update data_layout and features for armv7-wrs-vxworks) - #62749 (Document link_section arbitrary bytes) - #62752 (Disable Z3 in LLVM build) - #62764 (normalize use of backticks in compiler messages for librustc/lint) - #62774 (Disable simd_select_bitmask test on big endian) - #62777 (Self-referencial type now called a recursive type) - #62778 (Emit artifact notifications for dependency files) Failed merges: - #62746 ( do not use mem::uninitialized in std::io) r? @ghost
[beta] Rollup backports Cherry picked: * rustc_target: avoid negative register counts in the SysV x86_64 ABI. #62380 * Fix ICEs when `Self` is used in type aliases #62417 * Raise the default recursion limit to 128 #62450 * Handle errors during error recovery gracefully #62604 * Correctly break out of recovery loop #62607 * Cancel unemitted diagnostics during error recovery #62666 * ci: pin awscli dependencies #62856 * Ensure that checkout is with \n line endings #62564 Rolled up: * [beta] Backport #62615 #62793 * [beta] Fix #62660 #62792 r? @ghost
[beta] Rollup backports Cherry picked: * rustc_target: avoid negative register counts in the SysV x86_64 ABI. #62380 * Fix ICEs when `Self` is used in type aliases #62417 * Raise the default recursion limit to 128 #62450 * Handle errors during error recovery gracefully #62604 * Correctly break out of recovery loop #62607 * Cancel unemitted diagnostics during error recovery #62666 * ci: pin awscli dependencies #62856 * Ensure that checkout is with \n line endings #62564 Rolled up: * [beta] Backport #62615 #62793 * [beta] Fix #62660 #62792 r? @ghost
In #61853, we changed the error when using PGO & MSVC toolchain & panic=unwind into a warning. However, in the compiler team meeting on 2019-07-11, we found that not everybody was in favor of that change because of the possibility of broken binaries.
This PR reverts that change so this is again an error. However, to work around an issue the Firefox team is having, we will only emit the error if we're actually supposed to generate a binary. If the
rustc
is invoked with--print
arguments (which means that no binary will actually be emitted), then we won't emit the error because there is not a possibility of the issue occurring.cc @EricRahm @nikomatsakis @pnkfelix @Centril