-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Hint user to update nightly on ICEs produced from outdated nightly #121658
Conversation
if let Some("nightly") = option_env!("CFG_RELEASE_CHANNEL") | ||
&& let Some(version) = option_env!("CFG_VERSION") | ||
&& let Some(ver_date_str) = option_env!("CFG_VER_DATE") |
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.
I'm assuming these must be set by bootstrap for nightly builds?
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.
good question 😆 can do some investigation? If it turns out inconclusive, we'll just land it and check the next nightly 🙃
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.
good question 😆 can do some investigation? If it turns out inconclusive, we'll just land it and check the next nightly 🙃
My assumption is based on
rust/compiler/rustc_driver_impl/src/lib.rs
Lines 846 to 862 in 53ed660
/// Prints version information | |
/// | |
/// NOTE: this is a macro to support drivers built at a different time than the main `rustc_driver` crate. | |
pub macro version($early_dcx: expr, $binary: literal, $matches: expr) { | |
fn unw(x: Option<&str>) -> &str { | |
x.unwrap_or("unknown") | |
} | |
$crate::version_at_macro_invocation( | |
$early_dcx, | |
$binary, | |
$matches, | |
unw(option_env!("CFG_VERSION")), | |
unw(option_env!("CFG_VER_HASH")), | |
unw(option_env!("CFG_VER_DATE")), | |
unw(option_env!("CFG_RELEASE")), | |
) | |
} |
and
rust/compiler/rustc_session/src/errors.rs
Lines 39 to 49 in 53ed660
impl SuggestUpgradeCompiler { | |
pub fn ui_testing() -> Self { | |
Self { date: "YYYY-MM-DD" } | |
} | |
pub fn new() -> Option<Self> { | |
let date = option_env!("CFG_VER_DATE")?; | |
Some(Self { date }) | |
} | |
} |
so I'm fairly certain they are available for nightly compilers.
is it useful to recommend updating at all if an internal feature was included? |
|
@bors r+ |
…li-obk Hint user to update nightly on ICEs produced from outdated nightly This is a conservative best-effort approach to detect a potentially outdated nightly; it will fallback to the regular ICE-reporting if any of the following cases are true: - Channel is not nightly - Version information is not available - Version date is not parseable as a YYYY-MM-DD or is missing - System time is at least 36 hours ahead of the user's nightly release datetime. - Any internal features are used. Note that I'm not sure how to make a test for this: I tested this manually by `CFG_VER_DATE="2020-02-02" ./x build library --stage 1`, and also changing the channel detection in `rustc_driver_impl` from `Some("nightly")` to `Some("nightly" | "dev")`, and then running `rustc +stage1 test.rs -Ztreat-err-as-bug=1` with a non-existent `test.rs`. <img width="1145" alt="Screenshot 2024-02-27 at 01 12 28" src="https://github.com/rust-lang/rust/assets/39484203/eff6af2e-4b19-4a70-af57-cd739ecf0e84"> Closes rust-lang#118832.
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#121280 (Implement MaybeUninit::fill{,_with,_from}) - rust-lang#121438 (std support for wasm32 panic=unwind) - rust-lang#121658 (Hint user to update nightly on ICEs produced from outdated nightly) - rust-lang#121959 (Removing absolute path in proc-macro) - rust-lang#121961 (add test for rust-lang#78894 rust-lang#71450) - rust-lang#121975 (hir_analysis: enums return `None` in `find_field`) - rust-lang#121978 (Fix duplicated path in the "not found dylib" error) - rust-lang#121991 (Merge impl_trait_in_assoc_types_defined_by query back into `opaque_types_defined_by`) - rust-lang#122016 (will_wake tests fail on Miri and that is expected) - rust-lang#122018 (only set noalias on Box with the global allocator) r? `@ghost` `@rustbot` modify labels: rollup
…li-obk Hint user to update nightly on ICEs produced from outdated nightly This is a conservative best-effort approach to detect a potentially outdated nightly; it will fallback to the regular ICE-reporting if any of the following cases are true: - Channel is not nightly - Version information is not available - Version date is not parseable as a YYYY-MM-DD or is missing - System time is at least 36 hours ahead of the user's nightly release datetime. - Any internal features are used. Note that I'm not sure how to make a test for this: I tested this manually by `CFG_VER_DATE="2020-02-02" ./x build library --stage 1`, and also changing the channel detection in `rustc_driver_impl` from `Some("nightly")` to `Some("nightly" | "dev")`, and then running `rustc +stage1 test.rs -Ztreat-err-as-bug=1` with a non-existent `test.rs`. <img width="1145" alt="Screenshot 2024-02-27 at 01 12 28" src="https://github.com/rust-lang/rust/assets/39484203/eff6af2e-4b19-4a70-af57-cd739ecf0e84"> Closes rust-lang#118832.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#121202 (Limit the number of names and values in check-cfg diagnostics) - rust-lang#121301 (errors: share `SilentEmitter` between rustc and rustfmt) - rust-lang#121658 (Hint user to update nightly on ICEs produced from outdated nightly) - rust-lang#121846 (only compare ambiguity item that have hard error) - rust-lang#121961 (add test for rust-lang#78894 rust-lang#71450) - rust-lang#121975 (hir_analysis: enums return `None` in `find_field`) - rust-lang#121978 (Fix duplicated path in the "not found dylib" error) - rust-lang#121991 (Merge impl_trait_in_assoc_types_defined_by query back into `opaque_types_defined_by`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#121202 (Limit the number of names and values in check-cfg diagnostics) - rust-lang#121301 (errors: share `SilentEmitter` between rustc and rustfmt) - rust-lang#121658 (Hint user to update nightly on ICEs produced from outdated nightly) - rust-lang#121846 (only compare ambiguity item that have hard error) - rust-lang#121961 (add test for rust-lang#78894 rust-lang#71450) - rust-lang#121975 (hir_analysis: enums return `None` in `find_field`) - rust-lang#121978 (Fix duplicated path in the "not found dylib" error) - rust-lang#121991 (Merge impl_trait_in_assoc_types_defined_by query back into `opaque_types_defined_by`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121658 - jieyouxu:ice-outdated-nightly, r=oli-obk Hint user to update nightly on ICEs produced from outdated nightly This is a conservative best-effort approach to detect a potentially outdated nightly; it will fallback to the regular ICE-reporting if any of the following cases are true: - Channel is not nightly - Version information is not available - Version date is not parseable as a YYYY-MM-DD or is missing - System time is at least 36 hours ahead of the user's nightly release datetime. - Any internal features are used. Note that I'm not sure how to make a test for this: I tested this manually by `CFG_VER_DATE="2020-02-02" ./x build library --stage 1`, and also changing the channel detection in `rustc_driver_impl` from `Some("nightly")` to `Some("nightly" | "dev")`, and then running `rustc +stage1 test.rs -Ztreat-err-as-bug=1` with a non-existent `test.rs`. <img width="1145" alt="Screenshot 2024-02-27 at 01 12 28" src="https://github.com/rust-lang/rust/assets/39484203/eff6af2e-4b19-4a70-af57-cd739ecf0e84"> Closes rust-lang#118832.
This is a conservative best-effort approach to detect a potentially outdated nightly; it will fallback to the regular ICE-reporting if any of the following cases are true:
Note that I'm not sure how to make a test for this: I tested this manually by
CFG_VER_DATE="2020-02-02" ./x build library --stage 1
, and also changing the channel detection inrustc_driver_impl
fromSome("nightly")
toSome("nightly" | "dev")
, and then runningrustc +stage1 test.rs -Ztreat-err-as-bug=1
with a non-existenttest.rs
.Closes #118832.