Unconditionally show update nightly hint on ICE
Instead of trying to guess if a update nightly hint should be shown (by checking for system time, querying version and channel info etc.), just show the update nightly if on nightly compiler message always. This avoids breaking tests that match on ICE test outputs.
Another issue is that the outdated nightly hint triggers for ICE tests, causing a mismatch with the test expectation. There doesn't seem to be any env var to suppress this.
See https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/stage0.20compiletest.20broken/near/425543681 for context.
r? @cjgillot
rustbot has assigned @cjgillot. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=jieyouxu
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_19d38c17-3ed5-4d24-be43-467893f54e89
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=unconditional-nightly-update-hint
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_19d38c17-3ed5-4d24-be43-467893f54e89
GITHUB_REF=refs/pull/122200/merge
GITHUB_REF_NAME=122200/merge
GITHUB_REF_PROTECTED=false
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=051e07dbcbf6aeb810b4c4395d06b8055fdd18cd
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_19d38c17-3ed5-4d24-be43-467893f54e89
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_19d38c17-3ed5-4d24-be43-467893f54e89
GITHUB_TRIGGERING_ACTOR=jieyouxu
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/122200/merge
GITHUB_WORKFLOW_SHA=051e07dbcbf6aeb810b4c4395d06b8055fdd18cd
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_20_X64=/opt/hostedtoolcache/go/1.20.14/x64
---
#13 3.646 Building wheels for collected packages: reuse
#13 3.647 Building wheel for reuse (pyproject.toml): started
#13 3.978 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.979 Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#13 3.979 Stored in directory: /tmp/pip-ephem-wheel-cache-4j72jb2e/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#13 3.982 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#13 4.003 Attempting uninstall: setuptools
#13 4.004 Found existing installation: setuptools 59.6.0
#13 4.005 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=jieyouxu
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_f87f3aee-e88d-4bbe-9e87-dca782a821f8
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=unconditional-nightly-update-hint
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_f87f3aee-e88d-4bbe-9e87-dca782a821f8
GITHUB_REF=refs/pull/122200/merge
GITHUB_REF_NAME=122200/merge
GITHUB_REF_PROTECTED=false
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=f3739b3b2af0477b34f4e3a25f899d4d956b1947
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_f87f3aee-e88d-4bbe-9e87-dca782a821f8
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_f87f3aee-e88d-4bbe-9e87-dca782a821f8
GITHUB_TRIGGERING_ACTOR=jieyouxu
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/122200/merge
GITHUB_WORKFLOW_SHA=f3739b3b2af0477b34f4e3a25f899d4d956b1947
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_20_X64=/opt/hostedtoolcache/go/1.20.14/x64
---
#12 writing image sha256:a9903f0cdba516be7775cc73cd496243fafc9afb9a1c63044188bd11b3290239 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.0s
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Fri Mar 8 19:02:22 UTC 2024
network time: Fri, 08 Mar 2024 19:02:22 GMT
network time: Fri, 08 Mar 2024 19:02:22 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
##[endgroup]
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
Finished release [optimized] target(s) in 1.27s
Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --no-default-features --mini-tests --std-tests`
Using system GCC
Using system GCC
[BUILD] example
[AOT] mini_core_hello_world
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core_hello_world
abc
---
---- [ui] tests/rustdoc-ui/ice-bug-report-url.rs stdout ----
diff of stderr:
12
13 note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md
+ note: if you are using a nightly compiler, please make sure that you have updated to the latest nightly
+
+
15 note: rustc {version} running on {platform}
17 query stack during panic:
The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/ice-bug-report-url/ice-bug-report-url.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args ice-bug-report-url.rs`
error: 1 errors occurred comparing output.
status: exit status: 101
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/tests/rustdoc-ui/ice-bug-report-url.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/ice-bug-report-url" "-A" "internal_features" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/ice-bug-report-url/auxiliary" "-Ztreat-err-as-bug"
--- stderr -------------------------------
--- stderr -------------------------------
error: internal compiler error: expected one of `->`, `where`, or `{`, found `<eof>`
|
LL | fn wrong()
LL | fn wrong()
| ^ expected one of `->`, `where`, or `{`
thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:1713:17:
thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:1713:17:
aborting due to `-Z treat-err-as-bug=1`
stack backtrace:
0: 0x7fe57453ff87 - <std[fdd79ac694666186]::sys_common::backtrace::_print::DisplayBacktrace as core[2ee42cb687b4c4a8]::fmt::Display>::fmt
1: 0x7fe57459b09f - core[2ee42cb687b4c4a8]::fmt::write
2: 0x7fe5745346a5 - <std[fdd79ac694666186]::sys::pal::unix::stdio::Stderr as std[fdd79ac694666186]::io::Write>::write_fmt
3: 0x7fe57453fd85 - std[fdd79ac694666186]::sys_common::backtrace::print
4: 0x7fe574542efa - std[fdd79ac694666186]::panicking::default_hook::{closure#1}
5: 0x7fe574542bfd - std[fdd79ac694666186]::panicking::default_hook
6: 0x7fe5752492c7 - <alloc[e75fc816264ec3f1]::boxed::Box<rustc_driver_impl[1049e464390f2bc8]::install_ice_hook::{closure#0}> as core[2ee42cb687b4c4a8]::ops::function::Fn<(&dyn for<'a, 'b> core[2ee42cb687b4c4a8]::ops::function::Fn<(&'a core[2ee42cb687b4c4a8]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[2ee42cb687b4c4a8]::marker::Sync + core[2ee42cb687b4c4a8]::marker::Send, &core[2ee42cb687b4c4a8]::panic::panic_info::PanicInfo)>>::call
7: 0x7fe574543594 - std[fdd79ac694666186]::panicking::rust_panic_with_hook
8: 0x7fe5745432e9 - std[fdd79ac694666186]::panicking::begin_panic_handler::{closure#0}
9: 0x7fe574540506 - std[fdd79ac694666186]::sys_common::backtrace::__rust_end_short_backtrace::<std[fdd79ac694666186]::panicking::begin_panic_handler::{closure#0}, !>
11: 0x7fe5744fb625 - core[2ee42cb687b4c4a8]::panicking::panic_fmt
11: 0x7fe5744fb625 - core[2ee42cb687b4c4a8]::panicking::panic_fmt
12: 0x7fe57827f76f - <rustc_errors[49c0e60a63f446b8]::DiagCtxtInner>::panic_if_treat_err_as_bug
13: 0x7fe57827eb3c - <rustc_errors[49c0e60a63f446b8]::DiagCtxtInner>::emit_diagnostic::{closure#2}
14: 0x7fe57544d096 - rustc_interface[80bc666a68689717]::callbacks::track_diagnostic
15: 0x7fe57827dbe2 - <rustc_errors[49c0e60a63f446b8]::DiagCtxtInner>::emit_diagnostic
16: 0x7fe57827c82e - <rustc_errors[49c0e60a63f446b8]::DiagCtxt>::emit_diagnostic
17: 0x7fe5782b75e7 - <rustc_errors[49c0e60a63f446b8]::diagnostic::Diag>::emit_producing_error_guaranteed
18: 0x7fe57542504d - <rustc_interface[80bc666a68689717]::queries::Queries>::parse
19: 0x7fe5754251c6 - <rustc_interface[80bc666a68689717]::queries::Queries>::global_ctxt
20: 0x55c9147e1ae9 - <rustc_interface[80bc666a68689717]::interface::Compiler>::enter::<rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>
21: 0x55c914977539 - rustc_span[82c5bdc9cb066165]::set_source_map::<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustc_interface[80bc666a68689717]::interface::run_compiler<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}>::{closure#0}::{closure#0}>
22: 0x55c914813f97 - rustc_interface[80bc666a68689717]::interface::run_compiler::<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}>::{closure#0}
23: 0x55c9147e2fa2 - <scoped_tls[8f3457548e8ef588]::ScopedKey<rustc_span[82c5bdc9cb066165]::SessionGlobals>>::set::<rustc_interface[80bc666a68689717]::util::run_in_thread_pool_with_globals<rustc_interface[80bc666a68689717]::interface::run_compiler<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>
24: 0x55c914977d8c - rustc_span[82c5bdc9cb066165]::create_session_globals_then::<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustc_interface[80bc666a68689717]::util::run_in_thread_pool_with_globals<rustc_interface[80bc666a68689717]::interface::run_compiler<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}>
25: 0x55c914877980 - std[fdd79ac694666186]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[80bc666a68689717]::util::run_in_thread_with_globals<rustc_interface[80bc666a68689717]::util::run_in_thread_pool_with_globals<rustc_interface[80bc666a68689717]::interface::run_compiler<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>
26: 0x55c91480e894 - std[fdd79ac694666186]::panicking::try::<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, core[2ee42cb687b4c4a8]::panic::unwind_safe::AssertUnwindSafe<<std[fdd79ac694666186]::thread::Builder>::spawn_unchecked_<rustc_interface[80bc666a68689717]::util::run_in_thread_with_globals<rustc_interface[80bc666a68689717]::util::run_in_thread_pool_with_globals<rustc_interface[80bc666a68689717]::interface::run_compiler<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
27: 0x55c914878dfa - <<std[fdd79ac694666186]::thread::Builder>::spawn_unchecked_<rustc_interface[80bc666a68689717]::util::run_in_thread_with_globals<rustc_interface[80bc666a68689717]::util::run_in_thread_pool_with_globals<rustc_interface[80bc666a68689717]::interface::run_compiler<core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>, rustdoc[7bcd2d77a2ed4642]::main_args::{closure#1}>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2ee42cb687b4c4a8]::result::Result<(), rustc_span[82c5bdc9cb066165]::ErrorGuaranteed>>::{closure#1} as core[2ee42cb687b4c4a8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
28: 0x7fe57454eb5e - <std[fdd79ac694666186]::sys::pal::unix::thread::Thread>::new::thread_start
30: 0x7fe5742bb120 - <unknown>
31: 0x0 - <unknown>
error: the compiler unexpectedly panicked. this is a bug.
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md
note: if you are using a nightly compiler, please make sure that you have updated to the latest nightly
note: rustc 1.78.0-nightly (f3739b3b2 2024-03-08) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C debuginfo=0 -Z treat-err-as-bug
query stack during panic:
end of query stack
------------------------------------------
@rustbot ready
We should link this PR with #122196 if I am not mistaken?
We should link this PR with #122196 if I am not mistaken?
Unfortunately there's 2 separate bugs here:
- The ICE message is shown conditionally on a lot of conditions which trigger for some ICE tests when tested via outdated nightly compilers causing the stderr output to differ.
- #122196 is still broken because
rmake.rsisn't compiled with--sysrootpassed.
I'm lacking context about this hint. r? compiler
same :sweat_smile: r? compiler
I feel like we would want to unconditionally suggest updating for nightly releases. On stable I am of many minds. We could do a check for current date and try to figure out how long ago the current release went out, and if >6 weeks, tell the user to consider updating. But that wouldn't take into account dot-releases to fix that exact ICE being released. At the same time, I would expect people to already think "maybe there's a newer version that fixes this". On stable we also need to account for non-rustup distributed rustc, like from Linux distro package managers, which would likely not want such a message, or to customize it...
For now, can you try to check for the current build release channel and remove the uncertain language from the message?
For now, can you try to check for the current build release channel and remove the uncertain language from the message?
Hmm, wouldn't this break ICE tests checking for the exact ICE message if the compiler's channel is nightly? (because normally the ICE tests are blessed under some dev channel right, which wouldn't have this message if we gated it based on channel?)
:umbrella: The latest upstream changes (presumably #123628) made this pull request unmergeable. Please resolve the merge conflicts.
@estebank sorry for the ping, I want to unbork cg_clif's tests. Not sure what to do here, maybe we just emit the update nightly note unconditionally, or revert the update note altogether?
@jieyouxu let's check if rustc_feature::UnstableFeatures::from_environment(None).is_nightly_build() works for checking that the ICE isn't happening on a stable release. If it doesn't work, lets land this PR as is.
Thanks, I'll try that
:umbrella: The latest upstream changes (presumably #122077) made this pull request unmergeable. Please resolve the merge conflicts.
@bors r+
:pushpin: Commit 09dab389e2febfeb30f2476ed8a69816c158af08 has been approved by estebank
It is now in the queue for this repository.