Skip to content

Commit 63a9c09

Browse files
authored
Unrolled build for rust-lang#119815
Rollup merge of rust-lang#119815 - nagisa:nagisa/polishes-libloading-use-somewhat, r=bjorn3 Format sources into the error message when loading codegen backends cc rust-lang/rustc_codegen_cranelift#1447 cc `@bjorn3`
2 parents 0547c41 + 1dc3ab0 commit 63a9c09

File tree

7 files changed

+20
-23
lines changed

7 files changed

+20
-23
lines changed

Cargo.lock

+3-13
Original file line numberDiff line numberDiff line change
@@ -2187,16 +2187,6 @@ dependencies = [
21872187
"cc",
21882188
]
21892189

2190-
[[package]]
2191-
name = "libloading"
2192-
version = "0.7.4"
2193-
source = "registry+https://github.com/rust-lang/crates.io-index"
2194-
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
2195-
dependencies = [
2196-
"cfg-if",
2197-
"winapi",
2198-
]
2199-
22002190
[[package]]
22012191
name = "libloading"
22022192
version = "0.8.1"
@@ -2479,7 +2469,7 @@ dependencies = [
24792469
"lazy_static",
24802470
"libc",
24812471
"libffi",
2482-
"libloading 0.8.1",
2472+
"libloading",
24832473
"log",
24842474
"measureme",
24852475
"rand",
@@ -4005,7 +3995,7 @@ dependencies = [
40053995
name = "rustc_interface"
40063996
version = "0.0.0"
40073997
dependencies = [
4008-
"libloading 0.7.4",
3998+
"libloading",
40093999
"rustc-rayon",
40104000
"rustc-rayon-core",
40114001
"rustc_ast",
@@ -4135,7 +4125,7 @@ name = "rustc_metadata"
41354125
version = "0.0.0"
41364126
dependencies = [
41374127
"bitflags 2.4.1",
4138-
"libloading 0.7.4",
4128+
"libloading",
41394129
"odht",
41404130
"rustc_ast",
41414131
"rustc_attr",

compiler/rustc_codegen_cranelift/Cargo.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
246246

247247
[[package]]
248248
name = "libloading"
249-
version = "0.7.4"
249+
version = "0.8.1"
250250
source = "registry+https://github.com/rust-lang/crates.io-index"
251-
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
251+
checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
252252
dependencies = [
253253
"cfg-if",
254-
"winapi",
254+
"windows-sys",
255255
]
256256

257257
[[package]]

compiler/rustc_codegen_cranelift/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ gimli = { version = "0.28", default-features = false, features = ["write"]}
1919
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
2020

2121
indexmap = "2.0.0"
22-
libloading = { version = "0.7.3", optional = true }
22+
libloading = { version = "0.8.0", optional = true }
2323
smallvec = "1.8.1"
2424

2525
[patch.crates-io]

compiler/rustc_interface/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
libloading = "0.7.1"
8+
libloading = "0.8.0"
99
rustc-rayon = { version = "0.5.0", optional = true }
1010
rustc-rayon-core = { version = "0.5.0", optional = true }
1111
rustc_ast = { path = "../rustc_ast" }

compiler/rustc_interface/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#![feature(box_patterns)]
22
#![feature(decl_macro)]
3+
#![feature(error_iter)]
34
#![feature(internal_output_capture)]
4-
#![feature(thread_spawn_unchecked)]
55
#![feature(lazy_cell)]
66
#![feature(let_chains)]
7+
#![feature(thread_spawn_unchecked)]
78
#![feature(try_blocks)]
89
#![recursion_limit = "256"]
910
#![deny(rustc::untranslatable_diagnostic)]

compiler/rustc_interface/src/util.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,21 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>(
162162
}
163163

164164
fn load_backend_from_dylib(early_dcx: &EarlyDiagCtxt, path: &Path) -> MakeBackendFn {
165+
fn format_err(e: &(dyn std::error::Error + 'static)) -> String {
166+
e.sources().map(|e| format!(": {e}")).collect()
167+
}
165168
let lib = unsafe { Library::new(path) }.unwrap_or_else(|err| {
166-
let err = format!("couldn't load codegen backend {path:?}: {err}");
169+
let err = format!("couldn't load codegen backend {path:?}{}", format_err(&err));
167170
early_dcx.early_fatal(err);
168171
});
169172

170173
let backend_sym = unsafe { lib.get::<MakeBackendFn>(b"__rustc_codegen_backend") }
171174
.unwrap_or_else(|e| {
172-
let err = format!("couldn't load codegen backend: {e}");
173-
early_dcx.early_fatal(err);
175+
let e = format!(
176+
"`__rustc_codegen_backend` symbol lookup in the codegen backend failed{}",
177+
format_err(&e)
178+
);
179+
early_dcx.early_fatal(e);
174180
});
175181

176182
// Intentionally leak the dynamic library. We can't ever unload it

compiler/rustc_metadata/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
libloading = "0.7.1"
9+
libloading = "0.8.0"
1010
odht = { version = "0.3.1", features = ["nightly"] }
1111
rustc_ast = { path = "../rustc_ast" }
1212
rustc_attr = { path = "../rustc_attr" }

0 commit comments

Comments
 (0)