Skip to content

Teach rustc to write the ICE backtrace and query stack to disk #106691

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 75 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,16 @@ dependencies = [
"tracing-tree",
]

[[package]]
name = "chrono"
version = "0.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00"
dependencies = [
"num",
"time 0.1.43",
]

[[package]]
name = "chrono"
version = "0.4.19"
Expand All @@ -625,6 +635,15 @@ dependencies = [
"winapi",
]

[[package]]
name = "ci_info"
version = "0.14.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62a62f39080c8c83e899dff6abd46c4fac05c1cf8dafece96ad8238e79addbf8"
dependencies = [
"envmnt",
]

[[package]]
name = "clap"
version = "3.2.20"
Expand Down Expand Up @@ -1414,6 +1433,16 @@ dependencies = [
"termcolor",
]

[[package]]
name = "envmnt"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d73999a2b8871e74c8b8bc23759ee9f3d85011b24fafc91a4b3b5c8cc8185501"
dependencies = [
"fsio",
"indexmap",
]

[[package]]
name = "errno"
version = "0.2.8"
Expand Down Expand Up @@ -1619,6 +1648,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674"

[[package]]
name = "fsio"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0"
dependencies = [
"dunce",
]

[[package]]
name = "futf"
version = "0.1.5"
Expand Down Expand Up @@ -2535,7 +2573,7 @@ checksum = "23f3e133c6d515528745ffd3b9f0c7d975ae039f0b6abb099f2168daa2afb4f9"
dependencies = [
"ammonia",
"anyhow",
"chrono",
"chrono 0.4.19",
"clap 3.2.20",
"clap_complete",
"elasticlunr-rs",
Expand Down Expand Up @@ -2703,6 +2741,17 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"

[[package]]
name = "num"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
dependencies = [
"num-integer",
"num-iter",
"num-traits",
]

[[package]]
name = "num-integer"
version = "0.1.43"
Expand All @@ -2713,6 +2762,17 @@ dependencies = [
"num-traits",
]

[[package]]
name = "num-iter"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]

[[package]]
name = "num-traits"
version = "0.2.12"
Expand Down Expand Up @@ -3915,9 +3975,13 @@ dependencies = [
name = "rustc_driver"
version = "0.0.0"
dependencies = [
"backtrace",
"chrono 0.2.25",
"ci_info",
"libc",
"rustc_ast",
"rustc_ast_pretty",
"rustc_codegen_llvm",
"rustc_codegen_ssa",
"rustc_data_structures",
"rustc_error_codes",
Expand All @@ -3934,12 +3998,15 @@ dependencies = [
"rustc_middle",
"rustc_parse",
"rustc_plugin_impl",
"rustc_query_impl",
"rustc_query_system",
"rustc_save_analysis",
"rustc_session",
"rustc_span",
"rustc_target",
"serde_json",
"tracing",
"urlqstring",
"winapi",
]

Expand Down Expand Up @@ -5248,7 +5315,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3c02f6eb7e7b4100c272f685a9ccaccaab302324e8c7ec3e2ee72340fb29ff3"
dependencies = [
"chrono",
"chrono 0.4.19",
"log",
"nom",
"serde",
Expand Down Expand Up @@ -6054,6 +6121,12 @@ dependencies = [
"serde",
]

[[package]]
name = "urlqstring"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25ef3473a06a065718d8ec7cd7acc6a35fc20f836dee7661ad3b64ea3cc2e0cc"

[[package]]
name = "utf-8"
version = "0.7.5"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern crate tracing;
use back::write::{create_informational_target_machine, create_target_machine};

use errors::FailParsingTargetMachineConfigToTargetMachine;
pub use llvm_util::target_features;
pub use llvm_util::{get_version, target_features};
use rustc_ast::expand::allocator::AllocatorKind;
use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule};
use rustc_codegen_ssa::back::write::{
Expand Down
9 changes: 8 additions & 1 deletion compiler/rustc_driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ edition = "2021"
crate-type = ["dylib"]

[dependencies]
tracing = { version = "0.1.35" }
backtrace = "0.3.66"
serde_json = "1.0.59"
chrono = "0.2"
ci_info = "0.14.9"
urlqstring = "*"
tracing = { version = "0.1.35" }
rustc_log = { path = "../rustc_log" }
rustc_middle = { path = "../rustc_middle" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
Expand All @@ -25,11 +29,14 @@ rustc_parse = { path = "../rustc_parse" }
rustc_plugin_impl = { path = "../rustc_plugin_impl" }
rustc_save_analysis = { path = "../rustc_save_analysis" }
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
rustc_codegen_llvm = { path = "../rustc_codegen_llvm" }
rustc_session = { path = "../rustc_session" }
rustc_error_codes = { path = "../rustc_error_codes" }
rustc_interface = { path = "../rustc_interface" }
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
rustc_query_system = { path = "../rustc_query_system" }
rustc_query_impl = { path = "../rustc_query_impl" }
rustc_hir_analysis = { path = "../rustc_hir_analysis" }

[target.'cfg(unix)'.dependencies]
Expand Down
Loading