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

regression: failed to normalize alias(opaque ...) #123276

Closed
Mark-Simulacrum opened this issue Mar 31, 2024 · 5 comments · Fixed by #126620
Closed

regression: failed to normalize alias(opaque ...) #123276

Mark-Simulacrum opened this issue Mar 31, 2024 · 5 comments · Fixed by #126620
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

[INFO] [stdout] error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:187:90: Failed to normalize Alias(Opaque, AliasTy { args: [], def_id: DefId(0:10611 ~ skynet[2ead]::web::create_task::{opaque#0}::{opaque#0}) }), maybe try to call `try_normalize_erasing_regions` instead
@Mark-Simulacrum Mark-Simulacrum added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Mar 31, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.78.0 milestone Mar 31, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 31, 2024
@apiraino
Copy link
Contributor

apiraino commented Apr 2, 2024

Trying to bisect. Not so easy because cargo-bisect runs on nightlies and on nightly this crate does not compile.

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 2, 2024
@jieyouxu jieyouxu added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Apr 4, 2024
@kadiwa4
Copy link
Contributor

kadiwa4 commented Apr 24, 2024

Using a patched version of ahash 0.7.8 that doesn't activate feature(stdsimd):

searched nightlies: from nightly-2024-02-01 to nightly-2024-03-17
regressed nightly: nightly-2024-02-09
searched commit range: 8ace7ea...98aa362
regressed commit: af88f7d (#120550 @oli-obk)

bisected with cargo-bisect-rustc v0.6.8

Host triple: aarch64-apple-darwin
Reproduce with:

cargo bisect-rustc --regress=ice --start=2024-02-01 --end=2024-03-17 

@rustbot label: -E-needs-bisection

@rustbot rustbot removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Apr 24, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Apr 24, 2024

Yea, this crate already errors with

error: couldn't read src/web/../../docs/web/index.html: No such file or directory (os error 2)
[INFO] [stdout]    --> src/web/mod.rs:114:20
[INFO] [stdout]     |
[INFO] [stdout] 114 |     Ok(reply::html(include_str!("../../docs/web/index.html")))
[INFO] [stdout]     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout]     |
[INFO] [stdout]     = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)

before it ICEs, so while this is an ICE to be fixed, it's not beta critical

@oli-obk oli-obk removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 24, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Apr 24, 2024

Using a patched version of ahash 0.7.8 that doesn't activate feature(stdsimd):

💀 nightly feature detection is starting to affect rustc development

@kadiwa4
Copy link
Contributor

kadiwa4 commented Apr 24, 2024

Minimized:

async fn create_task() {
    _ = Some(async { bind(documentation_filter()) });
}

async fn bind<Fut, F: Filter<Future = Fut>>(_: F) {}

fn documentation_filter() -> impl Filter {
    AndThen
}

trait Filter {
    type Future;
}

struct AndThen;

impl Filter for AndThen
where
    Foo: Filter,
{
    type Future = ();
}
Produces
error[E0412]: cannot find type `Foo` in this scope
  --> src/lib.rs:19:5
   |
19 |     Foo: Filter,
   |     ^^^ not found in this scope

error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:187:90: Failed to normalize Coroutine(DefId(0:5 ~ tmp2[2e32]::create_task::{closure#0}::{closure#0}), [(), std::future::ResumeTy, (), Alias(Opaque, AliasTy { args: [Alias(Projection, AliasTy { args: [Alias(Opaque, AliasTy { args: [], def_id: DefId(0:19 ~ tmp2[2e32]::documentation_filter::{opaque#0}) })], def_id: DefId(0:12 ~ tmp2[2e32]::Filter::Future) }), Alias(Opaque, AliasTy { args: [], def_id: DefId(0:19 ~ tmp2[2e32]::documentation_filter::{opaque#0}) })], def_id: DefId(0:18 ~ tmp2[2e32]::bind::{opaque#0}) }), CoroutineWitness(DefId(0:5 ~ tmp2[2e32]::create_task::{closure#0}::{closure#0}), []), ()]), maybe try to call `try_normalize_erasing_regions` instead

thread 'rustc' panicked at compiler/rustc_middle/src/util/bug.rs:35:44:
Box<dyn Any>
stack backtrace:
   0:        0x102f9eeac - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5f1ad299b62739b8
   1:        0x102fe2e14 - core::fmt::write::he309f022a11c174d
   2:        0x102f95478 - std::io::Write::write_fmt::h19fcf32f597a27fd
   3:        0x102f9ed04 - std::sys_common::backtrace::print::hba726cdeff1b161d
   4:        0x102fa1610 - std::panicking::default_hook::{{closure}}::h8b1d5cebc4deea2b
   5:        0x102fa12f4 - std::panicking::default_hook::hba52536fc1e50063
   6:        0x10c250fd8 - <alloc[797708c6ec5944f1]::boxed::Box<rustc_driver_impl[10f519aa03496fc]::install_ice_hook::{closure#0}> as core[e7ee6eaff9d1e9]::ops::function::Fn<(&dyn for<'a, 'b> core[e7ee6eaff9d1e9]::ops::function::Fn<(&'a core[e7ee6eaff9d1e9]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[e7ee6eaff9d1e9]::marker::Send + core[e7ee6eaff9d1e9]::marker::Sync, &core[e7ee6eaff9d1e9]::panic::panic_info::PanicInfo)>>::call
   7:        0x102fa2044 - std::panicking::rust_panic_with_hook::h3a32dccb392f8664
   8:        0x10c2eeca8 - std[667740e72467fa52]::panicking::begin_panic::<rustc_errors[2e2ef9c1d90c3cba]::ExplicitBug>::{closure#0}
   9:        0x10c2eec5c - std[667740e72467fa52]::sys_common::backtrace::__rust_end_short_backtrace::<std[667740e72467fa52]::panicking::begin_panic<rustc_errors[2e2ef9c1d90c3cba]::ExplicitBug>::{closure#0}, !>
  10:        0x110239c04 - std[667740e72467fa52]::panicking::begin_panic::<rustc_errors[2e2ef9c1d90c3cba]::ExplicitBug>
  11:        0x10c2fe12c - <rustc_errors[2e2ef9c1d90c3cba]::diagnostic::BugAbort as rustc_errors[2e2ef9c1d90c3cba]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:        0x10cd7c164 - rustc_middle[468f886809330e9e]::util::bug::opt_span_bug_fmt::<rustc_span[15d402de9654d1a3]::span_encoding::Span>::{closure#0}
  13:        0x10cd7461c - rustc_middle[468f886809330e9e]::ty::context::tls::with_opt::<rustc_middle[468f886809330e9e]::util::bug::opt_span_bug_fmt<rustc_span[15d402de9654d1a3]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:        0x10cd745e8 - rustc_middle[468f886809330e9e]::ty::context::tls::with_context_opt::<rustc_middle[468f886809330e9e]::ty::context::tls::with_opt<rustc_middle[468f886809330e9e]::util::bug::opt_span_bug_fmt<rustc_span[15d402de9654d1a3]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:        0x1102d44d0 - rustc_middle[468f886809330e9e]::util::bug::bug_fmt
  16:        0x10c1cf22c - <rustc_middle[468f886809330e9e]::ty::context::TyCtxt>::normalize_erasing_regions::<rustc_middle[468f886809330e9e]::ty::Ty>
  17:        0x10c13020c - <rustc_const_eval[cf4dd5d2083d19ff]::transform::validate::TypeChecker as rustc_middle[468f886809330e9e]::mir::visit::Visitor>::visit_rvalue
  18:        0x10c13299c - <rustc_const_eval[cf4dd5d2083d19ff]::transform::validate::TypeChecker as rustc_middle[468f886809330e9e]::mir::visit::Visitor>::visit_statement
  19:        0x10c12e384 - rustc_const_eval[cf4dd5d2083d19ff]::transform::validate::validate_types
  20:        0x10c12b268 - <rustc_const_eval[cf4dd5d2083d19ff]::transform::validate::Validator as rustc_middle[468f886809330e9e]::mir::MirPass>::run_pass
  21:        0x10d0a0160 - rustc_mir_transform[24ffb6cc83ca816a]::pass_manager::run_passes_inner
  22:        0x10cf66298 - rustc_mir_transform[24ffb6cc83ca816a]::optimized_mir
  23:        0x10d449e0c - rustc_query_impl[c603a22348a2ad2c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c603a22348a2ad2c]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 8usize]>>
  24:        0x10d5eb494 - <rustc_query_impl[c603a22348a2ad2c]::query_impl::optimized_mir::dynamic_query::{closure#2} as core[e7ee6eaff9d1e9]::ops::function::FnOnce<(rustc_middle[468f886809330e9e]::ty::context::TyCtxt, rustc_span[15d402de9654d1a3]::def_id::DefId)>>::call_once
  25:        0x10d3b0a34 - rustc_query_system[cfb412240652a0f]::query::plumbing::try_execute_query::<rustc_query_impl[c603a22348a2ad2c]::DynamicConfig<rustc_query_system[cfb412240652a0f]::query::caches::DefIdCache<rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[c603a22348a2ad2c]::plumbing::QueryCtxt, false>
  26:        0x10d4c0778 - rustc_query_impl[c603a22348a2ad2c]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  27:        0x10cc2da50 - rustc_middle[468f886809330e9e]::query::plumbing::query_get_at::<rustc_query_system[cfb412240652a0f]::query::caches::DefIdCache<rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 8usize]>>>
  28:        0x10db59128 - rustc_ty_utils[547c1a16b17b7b35]::layout::layout_of_uncached
  29:        0x10db5e0f0 - rustc_ty_utils[547c1a16b17b7b35]::layout::layout_of
  30:        0x10d44e6d8 - rustc_query_impl[c603a22348a2ad2c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c603a22348a2ad2c]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 16usize]>>
  31:        0x10d4b7f84 - <rustc_query_impl[c603a22348a2ad2c]::query_impl::layout_of::dynamic_query::{closure#2} as core[e7ee6eaff9d1e9]::ops::function::FnOnce<(rustc_middle[468f886809330e9e]::ty::context::TyCtxt, rustc_middle[468f886809330e9e]::ty::ParamEnvAnd<rustc_middle[468f886809330e9e]::ty::Ty>)>>::call_once
  32:        0x10d3bc09c - rustc_query_system[cfb412240652a0f]::query::plumbing::try_execute_query::<rustc_query_impl[c603a22348a2ad2c]::DynamicConfig<rustc_query_system[cfb412240652a0f]::query::caches::DefaultCache<rustc_middle[468f886809330e9e]::ty::ParamEnvAnd<rustc_middle[468f886809330e9e]::ty::Ty>, rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[c603a22348a2ad2c]::plumbing::QueryCtxt, false>
  33:        0x10d4d455c - rustc_query_impl[c603a22348a2ad2c]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  34:        0x10cf6b980 - rustc_middle[468f886809330e9e]::query::plumbing::query_get_at::<rustc_query_system[cfb412240652a0f]::query::caches::DefaultCache<rustc_middle[468f886809330e9e]::ty::ParamEnvAnd<rustc_middle[468f886809330e9e]::ty::Ty>, rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 16usize]>>>
  35:        0x10cf76250 - <rustc_mir_transform[24ffb6cc83ca816a]::known_panics_lint::KnownPanicsLint as rustc_mir_transform[24ffb6cc83ca816a]::pass_manager::MirLint>::run_lint
  36:        0x10d09fc68 - rustc_mir_transform[24ffb6cc83ca816a]::pass_manager::run_passes_inner
  37:        0x10cf65c44 - rustc_mir_transform[24ffb6cc83ca816a]::run_analysis_to_runtime_passes
  38:        0x10cf6590c - rustc_mir_transform[24ffb6cc83ca816a]::mir_drops_elaborated_and_const_checked
  39:        0x10d44de8c - rustc_query_impl[c603a22348a2ad2c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c603a22348a2ad2c]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 8usize]>>
  40:        0x10d556144 - <rustc_query_impl[c603a22348a2ad2c]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2} as core[e7ee6eaff9d1e9]::ops::function::FnOnce<(rustc_middle[468f886809330e9e]::ty::context::TyCtxt, rustc_span[15d402de9654d1a3]::def_id::LocalDefId)>>::call_once
  41:        0x10d3fc1bc - rustc_query_system[cfb412240652a0f]::query::plumbing::try_execute_query::<rustc_query_impl[c603a22348a2ad2c]::DynamicConfig<rustc_query_system[cfb412240652a0f]::query::caches::VecCache<rustc_span[15d402de9654d1a3]::def_id::LocalDefId, rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[c603a22348a2ad2c]::plumbing::QueryCtxt, false>
  42:        0x10d4bf510 - rustc_query_impl[c603a22348a2ad2c]::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
  43:        0x10c9e8364 - <rustc_session[b0b2e7afb6912a37]::session::Session>::time::<(), rustc_interface[c64a2a395e992482]::passes::analysis::{closure#2}>
  44:        0x10c993c58 - rustc_interface[c64a2a395e992482]::passes::analysis
  45:        0x10d44e3b8 - rustc_query_impl[c603a22348a2ad2c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c603a22348a2ad2c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 1usize]>>
  46:        0x10d50193c - <rustc_query_impl[c603a22348a2ad2c]::query_impl::analysis::dynamic_query::{closure#2} as core[e7ee6eaff9d1e9]::ops::function::FnOnce<(rustc_middle[468f886809330e9e]::ty::context::TyCtxt, ())>>::call_once
  47:        0x10d3b6460 - rustc_query_system[cfb412240652a0f]::query::plumbing::try_execute_query::<rustc_query_impl[c603a22348a2ad2c]::DynamicConfig<rustc_query_system[cfb412240652a0f]::query::caches::SingleCache<rustc_middle[468f886809330e9e]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[c603a22348a2ad2c]::plumbing::QueryCtxt, false>
  48:        0x10d4bb9dc - rustc_query_impl[c603a22348a2ad2c]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  49:        0x10c25d31c - <rustc_middle[468f886809330e9e]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[10f519aa03496fc]::run_compiler::{closure#0}::{closure#1}::{closure#3}, core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>>
  50:        0x10c25c544 - <rustc_interface[c64a2a395e992482]::interface::Compiler>::enter::<rustc_driver_impl[10f519aa03496fc]::run_compiler::{closure#0}::{closure#1}, core[e7ee6eaff9d1e9]::result::Result<core[e7ee6eaff9d1e9]::option::Option<rustc_interface[c64a2a395e992482]::queries::Linker>, rustc_span[15d402de9654d1a3]::ErrorGuaranteed>>
  51:        0x10c231c2c - rustc_span[15d402de9654d1a3]::create_session_globals_then::<core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>, rustc_interface[c64a2a395e992482]::interface::run_compiler<core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>, rustc_driver_impl[10f519aa03496fc]::run_compiler::{closure#0}>::{closure#0}>
  52:        0x10c25a268 - std[667740e72467fa52]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c64a2a395e992482]::util::run_in_thread_with_globals<rustc_interface[c64a2a395e992482]::interface::run_compiler<core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>, rustc_driver_impl[10f519aa03496fc]::run_compiler::{closure#0}>::{closure#0}, core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>>
  53:        0x10c239fdc - <<std[667740e72467fa52]::thread::Builder>::spawn_unchecked_<rustc_interface[c64a2a395e992482]::util::run_in_thread_with_globals<rustc_interface[c64a2a395e992482]::interface::run_compiler<core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>, rustc_driver_impl[10f519aa03496fc]::run_compiler::{closure#0}>::{closure#0}, core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e7ee6eaff9d1e9]::result::Result<(), rustc_span[15d402de9654d1a3]::ErrorGuaranteed>>::{closure#1} as core[e7ee6eaff9d1e9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  54:        0x102faa578 - std::sys::pal::unix::thread::Thread::new::thread_start::h720503677457678a
  55:        0x199a6ef94 - __pthread_joiner_wake

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.78.0-beta.9 (205af5d6b 2024-04-23) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C strip=debuginfo

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [optimized_mir] optimizing MIR for `create_task::{closure#0}`
#1 [layout_of] computing layout of `{async fn body@src/lib.rs:1:24: 3:2}`
#2 [mir_drops_elaborated_and_const_checked] elaborating drops for `create_task`
#3 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0412`.
error: could not compile `tmp2` (lib) due to 1 previous error

@rustbot label: -E-needs-mcve +S-has-mcve

@rustbot rustbot added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Apr 24, 2024
jieyouxu added a commit to jieyouxu/rust that referenced this issue Jun 19, 2024
Actually taint InferCtxt when a fulfillment error is emitted

And avoid checking the global error counter

fixes rust-lang#122044
fixes rust-lang#123255
fixes rust-lang#123276
fixes rust-lang#125799
jieyouxu added a commit to jieyouxu/rust that referenced this issue Jun 19, 2024
Actually taint InferCtxt when a fulfillment error is emitted

And avoid checking the global error counter

fixes rust-lang#122044
fixes rust-lang#123255
fixes rust-lang#123276
fixes rust-lang#125799
jieyouxu added a commit to jieyouxu/rust that referenced this issue Jun 19, 2024
Actually taint InferCtxt when a fulfillment error is emitted

And avoid checking the global error counter

fixes rust-lang#122044
fixes rust-lang#123255
fixes rust-lang#123276
fixes rust-lang#125799
@bors bors closed this as completed in e7be356 Jun 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 20, 2024
Rollup merge of rust-lang#126620 - oli-obk:taint_errors, r=fee1-dead

Actually taint InferCtxt when a fulfillment error is emitted

And avoid checking the global error counter

fixes rust-lang#122044
fixes rust-lang#123255
fixes rust-lang#123276
fixes rust-lang#125799
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 9, 2024
…wiser

allow overwriting the output of `rustc --version`

Our wonderful bisection folk [have to work around](rust-lang#123276 (comment)) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for.

This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by

* choosing when to update rustc
* choosing when to update dependencies
* choosing which nightly features they are willing to take the breakage for

The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency.

This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too.

This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_FORCE_RUSTC_VERSION` env var. The bisection issue is then fixed by rust-lang/cargo-bisect-rustc#335.

I mainly want to establish a compiler team policy:

> We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to.

Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection.

I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 26, 2024
…wiser

allow overwriting the output of `rustc --version`

Our wonderful bisection folk [have to work around](rust-lang#123276 (comment)) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for.

This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by

* choosing when to update rustc
* choosing when to update dependencies
* choosing which nightly features they are willing to take the breakage for

The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency.

This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too.

This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by rust-lang/cargo-bisect-rustc#335.

I mainly want to establish a compiler team policy:

> We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to.

Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection.

I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 29, 2024
allow overwriting the output of `rustc --version`

Our wonderful bisection folk [have to work around](rust-lang#123276 (comment)) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for.

This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by

* choosing when to update rustc
* choosing when to update dependencies
* choosing which nightly features they are willing to take the breakage for

The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency.

This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too.

This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by rust-lang/cargo-bisect-rustc#335.

I mainly want to establish a compiler team policy:

> We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to.

Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection.

I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 30, 2024
allow overwriting the output of `rustc --version`

Our wonderful bisection folk [have to work around](rust-lang#123276 (comment)) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for.

This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by

* choosing when to update rustc
* choosing when to update dependencies
* choosing which nightly features they are willing to take the breakage for

The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency.

This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too.

This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by rust-lang/cargo-bisect-rustc#335.

I mainly want to establish a compiler team policy:

> We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to.

Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection.

I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Aug 2, 2024
allow overwriting the output of `rustc --version`

Our wonderful bisection folk [have to work around](rust-lang/rust#123276 (comment)) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for.

This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by

* choosing when to update rustc
* choosing when to update dependencies
* choosing which nightly features they are willing to take the breakage for

The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency.

This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too.

This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by rust-lang/cargo-bisect-rustc#335.

I mainly want to establish a compiler team policy:

> We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to.

Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection.

I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants