Closed songday closed 1 year ago
cc @Aaron1011 that looks similar to #80691 and could be fixed by #83220, right ?
if it does reproduce the same issue, it would be interesting because it's smaller than the substrate-node-template
repro, and could possibly be minimized more still
This can be reproduced by running touch src/service/asset_list.rs
in-between builds, instead of modifying build.rs
I've worked on reducing this.
From the initial 320 dependencies to 50 or so, something like this and its dependencies is enough to trigger the bug:
async fn index() -> Result<impl Reply, Rejection> { Ok(warp::reply::html("")) }
pub async fn create_warp_server() -> Result<impl Future<Output = ()> + 'static, Box<dyn std::error::Error>> {
let index = get().and_then(crate::index);
let cors = allow_origins(vec!["http://localhost:8080"].into_iter());
let routes = index.with(cors);
let server = serve(routes).bind_with_graceful_shutdown();
Ok(server)
}
fn main() {
let runtime = Builder::new_current_thread().build().unwrap();
let server = runtime.block_on(create_warp_server()).unwrap();
runtime.block_on(server);
}
(modulo changes made while reducing warp)
but that still depends on:
[dependencies]
futures = { version = "0.3", default-features = false, features = ["alloc"] }
http = "0.2"
hyper = { version = "0.14", features = ["server", "http1", "tcp"] }
tokio = { version = "1.0", features = ["sync"] }
The most tedious parts of minimizing this project are done, but it's not finished yet. warp
is complicated to reduce, and I've ran out of time on this, so here goes: with parts of the warp
crate inlined in the test, it still is 380 lines and it seems the bug is triggered from code in hyper
.
In any case, to reproduce:
cargo build
, which will worktouch src/main.rs
cargo build
will now ICEthread 'rustc' panicked at 'found unstable fingerprints for evaluate_obligation(1996d96fad4914f7-2e8343523a99712d)', /rustc/36f1f04f18b89ba4a999bcfd6584663fd6fc1c5d\compiler\rustc_query_system\src\query\plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: 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-compiler&template=ice.md
note: rustc 1.52.0-nightly (36f1f04f1 2021-03-17) running on x86_64-pc-windows-msvc
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `hyper::Body: std::convert::From<&str>`
#1 [normalize_projection_ty] normalizing `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: ProjectionTy { substs: [futures::future::Map<hyper::Server<hyper::server::conn::AddrIncoming, hyper::service::make::MakeServiceFn<[closure@backend\src\main.rs:348:48: 351:18]>>, [closure@backend\src\main.rs:354:35: 354:61]>], item_def_id: DefId(2:11838 ~ core[f48f]::future::future::Future::Output) } } }`
end of query stack
error: could not compile `blog-backend`
With some parts of hyper
and tokio
integrated, and more reduction, it should be doable to have a minimal example we could use in a unit test.
it happens on rust-analyzer as well (also without mimalloc)
i~/g/rust-analyzer
λ (master|✔️ ) rustc --version --verbose 5ms
rustc 1.52.0-nightly (1705a7d64 2021-03-18)
binary: rustc
commit-hash: 1705a7d64b833d1c4b69958b0627bd054e6d764b
commit-date: 2021-03-18
host: aarch64-apple-darwin
release: 1.52.0-nightly
LLVM version: 12.0.0
i~/g/rust-analyzer
λ (master|✔️ ) git rev-parse HEAD 139ms
fc21640a65b5caef8dbbc9e85e9616b843847fb4
i~/g/rust-analyzer
λ (master|✔️ ) cargo xtask install --mimalloc 10ms
Finished dev [unoptimized] target(s) in 0.06s
Running `target/debug/xtask install --mimalloc`
$ cargo install --path crates/rust-analyzer --locked --force --features force-always-assert --features mimalloc
Installing rust-analyzer v0.0.0 (/Users/benediktmandelkow/gits/rust-analyzer/crates/rust-analyzer)
Updating crates.io index
Compiling hir_ty v0.0.0 (/Users/benediktmandelkow/gits/rust-analyzer/crates/hir_ty)
Compiling hir v0.0.0 (/Users/benediktmandelkow/gits/rust-analyzer/crates/hir)
Compiling ide_db v0.0.0 (/Users/benediktmandelkow/gits/rust-analyzer/crates/ide_db)
thread 'rustc' panicked at 'found unstable fingerprints for evaluate_obligation(3af516d87091aad7-c89d9033dbef420c)', /rustc/1705a7d64b833d1c4b69958b0627bd054e6d764b/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: 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-compiler&template=ice.md
note: rustc 1.52.0-nightly (1705a7d64 2021-03-18) running on aarch64-apple-darwin
note: compiler flags: -C opt-level=3 -C linker-plugin-lto -C split-debuginfo=unpacked -C debuginfo=0 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `RootDatabase: base_db::Upcast<dyn hir::db::AstDatabase>`
#1 [typeck] type-checking `symbol_index::crate_symbols`
end of query stack
error: could not compile `ide_db`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
thread 'rustc' panicked at 'found unstable fingerprints for evaluate_obligation(b804705c3ed9ee58-9edc697b7a408cab)', /rustc/1705a7d64b833d1c4b69958b0627bd054e6d764b/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: 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-compiler&template=ice.md
note: rustc 1.52.0-nightly (1705a7d64 2021-03-18) running on aarch64-apple-darwin
note: compiler flags: -C opt-level=3 -C linker-plugin-lto -C split-debuginfo=unpacked -C debuginfo=0 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `chalk_ir::BindersIntoIterator<&std::vec::Vec<chalk_ir::Binders<chalk_ir::WhereClause<traits::chalk::interner::Interner>>>>: std::marker::Sized`
#1 [normalize_projection_ty] normalizing `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: ProjectionTy { substs: [std::iter::Map<chalk_ir::BindersIntoIterator<&std::vec::Vec<chalk_ir::Binders<chalk_ir::WhereClause<traits::chalk::interner::Interner>>>>, [closure@<chalk_solve::rust_ir::AssociatedTyValue<traits::chalk::interner::Interner> as chalk_solve::clauses::program_clauses::ToProgramClauses<traits::chalk::interner::Interner>>::to_program_clauses::{closure#0}::{closure#3}]>], item_def_id: DefId(2:7000 ~ core[ae58]::iter::traits::collect::IntoIterator::IntoIter) } } }`
end of query stack
error: failed to compile `rust-analyzer v0.0.0 (/Users/benediktmandelkow/gits/rust-analyzer/crates/rust-analyzer)`, intermediate artifacts can be found at `/Users/benediktmandelkow/gits/rust-analyzer/target`
Caused by:
build failed
Error: install server
Caused by:
command `cargo install --path crates/rust-analyzer --locked --force --features force-always-assert --features mimalloc` failed, exit code: 101
Is this still a problem on the latest nightly? It may have been fixed by https://github.com/rust-lang/rust/pull/85186.
Triage: No one said it was still a problem, and the linked PR includes regression tests. Closing.
Code
please clone code by running:
git clone https://github.com/songday/blog-rs.git
reproduce steps
build.rs
, modify line: 69, add` after
], ex
writeln!(&mut service_asset_file, r##"] "##,)?;`cargo b
againOnce I run
cargo clean
and build again, everything will be fine.Meta
rustc --version --verbose
:Error output
Backtrace
``` Same as above output ```