diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:30 +0000 |
commit | 637c3db19c24b32baf8f7d6f51bf7bfab7771f89 (patch) | |
tree | 50c71574fc7d8223c826e3f563c521c815ebb9d0 /debian/patches | |
parent | Merging upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-637c3db19c24b32baf8f7d6f51bf7bfab7771f89.tar.xz rustc-637c3db19c24b32baf8f7d6f51bf7bfab7771f89.zip |
Adding debian version 1.67.1+dfsg1-1.debian/1.67.1+dfsg1-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
27 files changed, 192 insertions, 446 deletions
diff --git a/debian/patches/d-0000-ignore-removed-submodules.patch b/debian/patches/d-0000-ignore-removed-submodules.patch index 7fdae2bd9..5ce806e79 100644 --- a/debian/patches/d-0000-ignore-removed-submodules.patch +++ b/debian/patches/d-0000-ignore-removed-submodules.patch @@ -5,20 +5,20 @@ Subject: d-0000-ignore-removed-submodules --- Cargo.toml | 15 --------------- src/bootstrap/bootstrap.py | 4 ---- - src/bootstrap/builder.rs | 15 +-------------- + src/bootstrap/builder.rs | 17 +---------------- src/bootstrap/doc.rs | 1 - src/bootstrap/test.rs | 12 +----------- src/tools/clippy/Cargo.toml | 5 ----- src/tools/rust-analyzer/Cargo.toml | 11 ++++++++++- src/tools/rustfmt/Cargo.toml | 5 ----- src/tools/tidy/src/deps.rs | 2 +- - 9 files changed, 13 insertions(+), 57 deletions(-) + 9 files changed, 13 insertions(+), 59 deletions(-) diff --git a/Cargo.toml b/Cargo.toml -index e49fe5e..863c800 100644 +index 000c10a..7442a0e 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -16,27 +16,15 @@ members = [ +@@ -17,27 +17,15 @@ members = [ "src/tools/tidy", "src/tools/tier-check", "src/tools/build-manifest", @@ -44,9 +44,9 @@ index e49fe5e..863c800 100644 - "src/tools/bump-stage0", - "src/tools/replace-version-placeholder", "src/tools/lld-wrapper", - ] - -@@ -99,9 +87,6 @@ miniz_oxide.debug = 0 + "src/tools/collect-license-metadata", + "src/tools/generate-copyright", +@@ -102,9 +90,6 @@ miniz_oxide.debug = 0 object.debug = 0 [patch.crates-io] @@ -57,10 +57,10 @@ index e49fe5e..863c800 100644 # See comments in `library/rustc-std-workspace-core/README.md` for what's going on # here diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py -index 5712868..5a6ab27 100644 +index 2d5018d..cc2ae13 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py -@@ -766,10 +766,6 @@ class RustBuild(object): +@@ -767,10 +767,6 @@ class RustBuild(object): os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")] for _ in range(0, self.verbose): args.append("--verbose") @@ -72,10 +72,10 @@ index 5712868..5a6ab27 100644 args.append("--features") args.append("build-metrics") diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 8b144f1..c4bed1ec 100644 +index 8ee6d49..8bc92c8 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -599,8 +599,6 @@ impl<'a> Builder<'a> { +@@ -596,8 +596,6 @@ impl<'a> Builder<'a> { tool::RemoteTestClient, tool::RustInstaller, tool::Cargo, @@ -84,16 +84,18 @@ index 8b144f1..c4bed1ec 100644 tool::RustAnalyzerProcMacroSrv, tool::RustDemangler, tool::Rustdoc, -@@ -621,8 +619,6 @@ impl<'a> Builder<'a> { +@@ -618,10 +616,6 @@ impl<'a> Builder<'a> { check::CodegenBackend, check::Clippy, check::Miri, +- check::CargoMiri, +- check::MiroptTestTools, - check::Rls, - check::RustAnalyzer, check::Rustfmt, check::Bootstrap ), -@@ -650,7 +646,6 @@ impl<'a> Builder<'a> { +@@ -650,7 +644,6 @@ impl<'a> Builder<'a> { test::ReplacePlaceholderTest, test::Cargotest, test::Cargo, @@ -101,7 +103,7 @@ index 8b144f1..c4bed1ec 100644 test::ErrorIndex, test::Distcheck, test::RunMakeFullDeps, -@@ -698,10 +693,8 @@ impl<'a> Builder<'a> { +@@ -698,10 +691,8 @@ impl<'a> Builder<'a> { doc::RustdocBook, doc::RustByExample, doc::RustcBook, @@ -112,7 +114,7 @@ index 8b144f1..c4bed1ec 100644 doc::EmbeddedBook, doc::EditionGuide, doc::StyleGuide, -@@ -717,8 +710,6 @@ impl<'a> Builder<'a> { +@@ -717,8 +708,6 @@ impl<'a> Builder<'a> { dist::Analysis, dist::Src, dist::Cargo, @@ -121,7 +123,7 @@ index 8b144f1..c4bed1ec 100644 dist::Rustfmt, dist::RustDemangler, dist::Clippy, -@@ -739,7 +730,6 @@ impl<'a> Builder<'a> { +@@ -739,7 +728,6 @@ impl<'a> Builder<'a> { install::Docs, install::Std, install::Cargo, @@ -129,7 +131,7 @@ index 8b144f1..c4bed1ec 100644 install::Rustfmt, install::RustDemangler, install::Clippy, -@@ -2062,10 +2052,7 @@ impl<'a> Builder<'a> { +@@ -1823,10 +1811,7 @@ impl<'a> Builder<'a> { } } @@ -142,7 +144,7 @@ index 8b144f1..c4bed1ec 100644 } diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs -index ea06caf..5d8247f 100644 +index 2c6fd1e..52c3eba 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -74,7 +74,6 @@ macro_rules! book { @@ -154,10 +156,10 @@ index ea06caf..5d8247f 100644 EditionGuide, "src/doc/edition-guide", "edition-guide", submodule; EmbeddedBook, "src/doc/embedded-book", "embedded-book", submodule; diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index 791c35c..964e2e0 100644 +index 39cedfd..7ed7d97 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs -@@ -1909,17 +1909,7 @@ impl Step for RustcGuide { +@@ -1975,17 +1975,7 @@ impl Step for RustcGuide { } fn run(self, builder: &Builder<'_>) { @@ -177,7 +179,7 @@ index 791c35c..964e2e0 100644 } diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml -index 60200a8..3980db9 100644 +index fe425a2..23beb15 100644 --- a/src/tools/clippy/Cargo.toml +++ b/src/tools/clippy/Cargo.toml @@ -36,11 +36,6 @@ walkdir = "2.3" @@ -229,10 +231,10 @@ index 7a4e02d..27b91f2 100644 [package.metadata.rust-analyzer] diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs -index 8a0239e..9b35cba 100644 +index 296db9d..0369861 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs -@@ -311,7 +311,7 @@ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[ +@@ -333,7 +333,7 @@ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[ // This crate takes quite a long time to build, so don't allow two versions of them // to accidentally sneak into our dependency graph, in order to ensure we keep our CI times // under control. @@ -241,3 +243,12 @@ index 8a0239e..9b35cba 100644 ]; /// Dependency checks. +@@ -629,6 +629,8 @@ + } + + fn check_rustfix(metadata: &Metadata, bad: &mut bool) { ++ // Debian: we don't build cargo here, so this function doens't function. ++ return; + let cargo = pkg_from_name(metadata, "cargo"); + let compiletest = pkg_from_name(metadata, "compiletest"); + let cargo_deps = deps_of(metadata, &cargo.id); diff --git a/debian/patches/d-0002-mdbook-strip-embedded-libs.patch b/debian/patches/d-0002-mdbook-strip-embedded-libs.patch index 2fae76fe5..c544053bc 100644 --- a/debian/patches/d-0002-mdbook-strip-embedded-libs.patch +++ b/debian/patches/d-0002-mdbook-strip-embedded-libs.patch @@ -14,10 +14,10 @@ Comment: Use https://github.com/infinity0/mdBook/tree/debian to help you rebase 7 files changed, 35 insertions(+), 203 deletions(-) diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs -index 7842611..4ccccf1 100644 +index 4170c32..d7dcda7 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs -@@ -183,7 +183,17 @@ impl Checker { +@@ -159,7 +159,17 @@ impl Checker { for entry in t!(dir.read_dir()).map(|e| t!(e)) { let path = entry.path(); // Goes through symlinks @@ -36,7 +36,7 @@ index 7842611..4ccccf1 100644 if metadata.is_dir() { self.walk(&path, report); } else { -@@ -196,7 +206,15 @@ impl Checker { +@@ -172,7 +182,15 @@ impl Checker { fn check(&mut self, file: &Path, report: &mut Report) { let (pretty_path, entry) = self.load_file(file, report); let source = match entry { @@ -53,7 +53,7 @@ index 7842611..4ccccf1 100644 FileEntry::Dir => unreachable!("never with `check` path"), FileEntry::OtherFile => return, FileEntry::Redirect { .. } => return, -@@ -262,6 +280,12 @@ impl Checker { +@@ -238,6 +256,12 @@ impl Checker { let (target_pretty_path, target_entry) = self.load_file(&path, report); let (target_source, target_ids) = match target_entry { FileEntry::Missing => { diff --git a/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch b/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch index 4d793cb81..9446070f0 100644 --- a/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch +++ b/debian/patches/d-0003-cc-psm-rebuild-wasm32.patch @@ -8,10 +8,10 @@ Subject: d-0003-cc-psm-rebuild-wasm32 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/vendor/cc/src/lib.rs b/vendor/cc/src/lib.rs -index e3a2b98..9312931 100644 +index a89e353..ccf99d2 100644 --- a/vendor/cc/src/lib.rs +++ b/vendor/cc/src/lib.rs -@@ -2238,7 +2238,7 @@ impl Build { +@@ -2341,7 +2341,7 @@ impl Build { || target == "wasm32-unknown-wasi" || target == "wasm32-unknown-unknown" { @@ -21,7 +21,7 @@ index e3a2b98..9312931 100644 if self.cpp { "wr-c++".to_string() diff --git a/vendor/psm/build.rs b/vendor/psm/build.rs -index 01a13bf..30bd68d 100644 +index 9d40212..e39549d 100644 --- a/vendor/psm/build.rs +++ b/vendor/psm/build.rs @@ -50,7 +50,7 @@ fn find_assembly( @@ -30,10 +30,10 @@ index 01a13bf..30bd68d 100644 ("riscv64", _, _, _) => Some(("src/arch/riscv64.s", true)), - ("wasm32", _, _, _) => Some(("src/arch/wasm32.o", true)), + ("wasm32", _, _, _) => Some(("src/arch/wasm32.s", true)), + ("loongarch64", _, _, _) => Some(("src/arch/loongarch64.s", true)), _ => None, } - } -@@ -94,11 +94,8 @@ fn main() { +@@ -97,11 +97,8 @@ fn main() { cfg.define(&*format!("CFG_TARGET_ENV_{}", env), None); } diff --git a/debian/patches/d-0004-clippy-feature-sync.patch b/debian/patches/d-0004-clippy-feature-sync.patch index 64b1c3eed..f92cfd4bd 100644 --- a/debian/patches/d-0004-clippy-feature-sync.patch +++ b/debian/patches/d-0004-clippy-feature-sync.patch @@ -10,7 +10,7 @@ this is what rustc_workspace_hack does in the upstream build. 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml -index 3980db9..fdf1a03 100644 +index 23beb15..ad8231a 100644 --- a/src/tools/clippy/Cargo.toml +++ b/src/tools/clippy/Cargo.toml @@ -43,7 +43,7 @@ if_chain = "1.0" diff --git a/debian/patches/d-0005-no-jemalloc.patch b/debian/patches/d-0005-no-jemalloc.patch index 24ad1c6fd..ac23de8bb 100644 --- a/debian/patches/d-0005-no-jemalloc.patch +++ b/debian/patches/d-0005-no-jemalloc.patch @@ -26,7 +26,7 @@ index 27ee3dd..87fb29f 100644 max_level_info = ['rustc_driver/max_level_info'] rustc_use_parallel_compiler = ['rustc_driver/rustc_use_parallel_compiler'] diff --git a/src/tools/rust-analyzer/crates/profile/Cargo.toml b/src/tools/rust-analyzer/crates/profile/Cargo.toml -index 5697aea..ae9bbd5 100644 +index 01d1735..bf0ba06 100644 --- a/src/tools/rust-analyzer/crates/profile/Cargo.toml +++ b/src/tools/rust-analyzer/crates/profile/Cargo.toml @@ -15,7 +15,6 @@ cfg-if = "1.0.0" diff --git a/debian/patches/d-armel-fix-lldb.patch b/debian/patches/d-armel-fix-lldb.patch index 1205dbe86..21072dbb1 100644 --- a/debian/patches/d-armel-fix-lldb.patch +++ b/debian/patches/d-armel-fix-lldb.patch @@ -4,7 +4,7 @@ diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index c0fa8c9acb..2b5559efc7 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs -@@ -1462,7 +1462,11 @@ +@@ -1524,7 +1524,11 @@ .ok(); if let Some(ref vers) = lldb_version { cmd.arg("--lldb-version").arg(vers); diff --git a/debian/patches/d-bootstrap-cargo-check-cfg.patch b/debian/patches/d-bootstrap-cargo-check-cfg.patch index 24bc7499c..cf633ae2b 100644 --- a/debian/patches/d-bootstrap-cargo-check-cfg.patch +++ b/debian/patches/d-bootstrap-cargo-check-cfg.patch @@ -5,7 +5,7 @@ diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 0ab4824ac0a..76c476f449b 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -1480,9 +1480,9 @@ +@@ -1241,9 +1241,9 @@ // complete list of features, so for that reason we don't enable checking of // features for std crates. cargo.arg(if mode != Mode::Std { diff --git a/debian/patches/d-bootstrap-cargo-doc-paths.patch b/debian/patches/d-bootstrap-cargo-doc-paths.patch index c3b2e8b72..235c93a50 100644 --- a/debian/patches/d-bootstrap-cargo-doc-paths.patch +++ b/debian/patches/d-bootstrap-cargo-doc-paths.patch @@ -228,7 +228,7 @@ diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index a22dc5f..c8d521a 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs -@@ -285,6 +285,12 @@ impl Checker { +@@ -262,6 +262,12 @@ return; } } diff --git a/debian/patches/d-bootstrap-custom-debuginfo-path.patch b/debian/patches/d-bootstrap-custom-debuginfo-path.patch index 6333e8a58..955b1e905 100644 --- a/debian/patches/d-bootstrap-custom-debuginfo-path.patch +++ b/debian/patches/d-bootstrap-custom-debuginfo-path.patch @@ -10,7 +10,7 @@ Subject: d-bootstrap-custom-debuginfo-path --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -1040,10 +1040,9 @@ +@@ -1053,10 +1053,9 @@ match which { GitRepo::Rustc => { diff --git a/debian/patches/d-bootstrap-disable-git.patch b/debian/patches/d-bootstrap-disable-git.patch index ddbe186e6..3e744b599 100644 --- a/debian/patches/d-bootstrap-disable-git.patch +++ b/debian/patches/d-bootstrap-disable-git.patch @@ -12,7 +12,7 @@ Forwarded: not-needed --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs -@@ -33,6 +33,12 @@ +@@ -36,6 +36,12 @@ impl GitInfo { pub fn new(ignore_git: bool, dir: &Path) -> GitInfo { @@ -27,15 +27,15 @@ Forwarded: not-needed match read_commit_info_file(dir) { --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs -@@ -925,7 +925,10 @@ +@@ -968,7 +968,10 @@ } // If we're building from git sources, we need to vendor a complete distribution. -- if builder.rust_info.is_managed_git_subrepository() { +- if builder.rust_info().is_managed_git_subrepository() { + // + // Debian: short-circuited because the Debian package is also in a git + // repository, but cargo-vendor should not be installed or run. -+ if false && builder.rust_info.is_managed_git_subrepository() { ++ if false && builder.rust_info().is_managed_git_subrepository() { // Ensure we have the submodules checked out. builder.update_submodule(Path::new("src/tools/rust-analyzer")); diff --git a/debian/patches/d-bootstrap-old-cargo-compat.patch b/debian/patches/d-bootstrap-old-cargo-compat.patch index 1caa3675a..463e70369 100644 --- a/debian/patches/d-bootstrap-old-cargo-compat.patch +++ b/debian/patches/d-bootstrap-old-cargo-compat.patch @@ -17,15 +17,15 @@ Subject: Backwards-compat for cargo 0.47 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs -@@ -618,7 +618,6 @@ - cargo +@@ -598,7 +598,6 @@ + .arg(&*target_dir.to_string_lossy()) .arg("-p") .arg(package) - .arg("-Zskip-rustdoc-fingerprint") .arg("--") .arg("-Z") .arg("unstable-options") -@@ -715,7 +714,6 @@ +@@ -695,7 +694,6 @@ cargo.rustdocflag("--generate-link-to-definition"); compile::rustc_cargo(builder, &mut cargo, target); cargo.arg("-Zunstable-options"); @@ -33,7 +33,7 @@ Subject: Backwards-compat for cargo 0.47 // Only include compiler crates, no dependencies of those, such as `libc`. // Do link to dependencies on `docs.rs` however using `rustdoc-map`. -@@ -837,7 +835,6 @@ +@@ -811,7 +809,6 @@ &[], ); diff --git a/debian/patches/d-bootstrap-permit-symlink-in-docs.patch b/debian/patches/d-bootstrap-permit-symlink-in-docs.patch index 2eed7043a..4ccec3cd8 100644 --- a/debian/patches/d-bootstrap-permit-symlink-in-docs.patch +++ b/debian/patches/d-bootstrap-permit-symlink-in-docs.patch @@ -2,7 +2,7 @@ partial revert of b9eedea4b0368fd1f00f204db75109ff444fab5b upstream --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs -@@ -72,6 +72,7 @@ +@@ -77,6 +77,7 @@ tarball.set_product_name("Rust Documentation"); tarball.add_bulk_dir(&builder.doc_out(host), dest); tarball.add_file(&builder.src.join("src/doc/robots.txt"), dest, 0o644); diff --git a/debian/patches/d-bootstrap-read-beta-version-from-file.patch b/debian/patches/d-bootstrap-read-beta-version-from-file.patch index 9738aa740..15ebb93c8 100644 --- a/debian/patches/d-bootstrap-read-beta-version-from-file.patch +++ b/debian/patches/d-bootstrap-read-beta-version-from-file.patch @@ -9,7 +9,7 @@ Subject: d-bootstrap-read-beta-version-from-file --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -1283,14 +1283,15 @@ +@@ -1296,14 +1296,15 @@ return s; } diff --git a/debian/patches/d-bootstrap-rustflags.patch b/debian/patches/d-bootstrap-rustflags.patch index 33b3d1e34..f73c6ba2b 100644 --- a/debian/patches/d-bootstrap-rustflags.patch +++ b/debian/patches/d-bootstrap-rustflags.patch @@ -9,7 +9,7 @@ Subject: d-bootstrap-rustflags --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -1507,6 +1507,18 @@ +@@ -1268,6 +1268,18 @@ } } diff --git a/debian/patches/d-bootstrap-use-local-css.patch b/debian/patches/d-bootstrap-use-local-css.patch index 894bd03c7..72595d9d3 100644 --- a/debian/patches/d-bootstrap-use-local-css.patch +++ b/debian/patches/d-bootstrap-use-local-css.patch @@ -9,18 +9,36 @@ Subject: d-bootstrap-use-local-css --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs -@@ -365,6 +365,10 @@ +@@ -350,7 +350,27 @@ + .arg("--index-page") .arg(&builder.src.join("src/doc/index.md")) .arg("--markdown-playground-url") - .arg("https://play.rust-lang.org/") -+ .arg("--markdown-css") -+ .arg(format!("rustdoc{}.css", &builder.version)) -+ .arg("--markdown-css") +- .arg("https://play.rust-lang.org/") ++ .arg("https://play.rust-lang.org/"); ++ ++ // Debian: librustdoc now generates a resource-suffix for static ++ // files with rustc_hash::FxHasher, so we need to find it. ++ let _dir = out.join("static.files"); ++ if _dir.is_dir() { ++ let _css = _dir.read_dir().expect("Debian: failed to read static.files/ when is_dir() == true") ++ .find_map(|entry| entry.ok().map(|entry| { ++ let name = entry.file_name().into_string() ++ .expect("Debian: rustc files should have UTF-8 name"); ++ if name.starts_with("rustdoc-") && name.ends_with(".css") { ++ Some(name) ++ } else { None } ++ })).flatten(); ++ if let Some(name) = _css { ++ cmd.arg("--markdown-css").arg(name); ++ } ++ } ++ ++ cmd.arg("--markdown-css") + .arg("rust.css") .arg("-o") .arg(&out) .arg(&path); -@@ -373,11 +377,6 @@ +@@ -359,11 +379,6 @@ cmd.arg("--disable-minification"); } diff --git a/debian/patches/d-fix-rustix-outline.patch b/debian/patches/d-fix-rustix-outline.patch index 1800de9e3..91b8530de 100644 --- a/debian/patches/d-fix-rustix-outline.patch +++ b/debian/patches/d-fix-rustix-outline.patch @@ -3,11 +3,9 @@ Always enable cc even if the feature is not enabled. Some Debian architectures need outline asm, and Debian does not ship pre-built outline asm. -Index: rust/vendor/rustix/Cargo.toml -=================================================================== ---- rust.orig/vendor/rustix/Cargo.toml -+++ rust/vendor/rustix/Cargo.toml -@@ -103,9 +103,9 @@ version = "0.6" +--- a/vendor/rustix/Cargo.toml ++++ b/vendor/rustix/Cargo.toml +@@ -115,9 +115,9 @@ [dev-dependencies.tempfile] version = "3.2.0" @@ -19,18 +17,16 @@ Index: rust/vendor/rustix/Cargo.toml [features] all-apis = [ -@@ -168,6 +168,7 @@ use-libc = [ - "libc_errno", - "libc", +@@ -230,6 +230,7 @@ + "Win32_NetworkManagement_IpHelper", + "Win32_System_Threading", ] +cc = [] - [target."cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", any(target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"), all(target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"powerpc64\", target_arch = \"riscv64\", target_arch = \"mips\", target_arch = \"mips64\"))))))))".dependencies.linux-raw-sys] - version = "0.0.46" -Index: rust/vendor/rustix/build.rs -=================================================================== ---- rust.orig/vendor/rustix/build.rs -+++ rust/vendor/rustix/build.rs + [target."cfg(windows)".dev-dependencies.ctor] + version = "0.1.21" +--- a/vendor/rustix/build.rs ++++ b/vendor/rustix/build.rs @@ -1,5 +1,4 @@ -#[cfg(feature = "cc")] -use cc::Build; @@ -38,7 +34,7 @@ Index: rust/vendor/rustix/build.rs use std::env::var; use std::io::Write; -@@ -113,16 +112,16 @@ fn link_in_librustix_outline(arch: &str, +@@ -118,16 +117,16 @@ println!("cargo:rerun-if-changed={}", to); // If "cc" is not enabled, use a pre-built library. diff --git a/debian/patches/d-rustc-add-soname.patch b/debian/patches/d-rustc-add-soname.patch index 277f431d2..cae59b5bc 100644 --- a/debian/patches/d-rustc-add-soname.patch +++ b/debian/patches/d-rustc-add-soname.patch @@ -26,7 +26,7 @@ using a GNU linker). --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -2280,6 +2280,13 @@ +@@ -2241,6 +2241,13 @@ } add_rpath_args(cmd, sess, codegen_results, out_filename); diff --git a/debian/patches/d-rustc-fix-mips64el-bootstrap.patch b/debian/patches/d-rustc-fix-mips64el-bootstrap.patch index 17ce2e563..2c09c60c9 100644 --- a/debian/patches/d-rustc-fix-mips64el-bootstrap.patch +++ b/debian/patches/d-rustc-fix-mips64el-bootstrap.patch @@ -40,7 +40,7 @@ index e0d5f6f..57ad8c4 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py -@@ -745,6 +745,8 @@ +@@ -746,6 +746,8 @@ # preserve existing RUSTFLAGS env.setdefault("RUSTFLAGS", "") diff --git a/debian/patches/d-rustdoc-disable-embedded-fonts.patch b/debian/patches/d-rustdoc-disable-embedded-fonts.patch index 49337108c..5ec7bacb6 100644 --- a/debian/patches/d-rustdoc-disable-embedded-fonts.patch +++ b/debian/patches/d-rustdoc-disable-embedded-fonts.patch @@ -9,21 +9,6 @@ Subject: d-rustdoc-disable-embedded-fonts src/librustdoc/html/static_files.rs | 23 ----------------------- 3 files changed, 33 deletions(-) -diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs -index 68f2a54..86f7487 100644 ---- a/src/librustdoc/html/render/write_shared.rs -+++ b/src/librustdoc/html/render/write_shared.rs -@@ -33,8 +33,6 @@ static FILES_UNVERSIONED: Lazy<FxHashMap - "SourceCodePro-Semibold.ttf.woff2" => static_files::source_code_pro::SEMIBOLD, - "SourceCodePro-It.ttf.woff2" => static_files::source_code_pro::ITALIC, - "SourceCodePro-LICENSE.txt" => static_files::source_code_pro::LICENSE, -- "NanumBarunGothic.ttf.woff2" => static_files::nanum_barun_gothic::REGULAR, -- "NanumBarunGothic-LICENSE.txt" => static_files::nanum_barun_gothic::LICENSE, - "LICENSE-MIT.txt" => static_files::LICENSE_MIT, - "LICENSE-APACHE.txt" => static_files::LICENSE_APACHE, - "COPYRIGHT.txt" => static_files::COPYRIGHT, -diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css -index 0f4d842..9aec0d6 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -67,14 +67,6 @@ @@ -33,7 +18,7 @@ index 0f4d842..9aec0d6 100644 -/* Avoid using legacy CJK serif fonts in Windows like Batang. */ -@font-face { - font-family: 'NanumBarunGothic'; -- src: url("NanumBarunGothic.ttf.woff2") format("woff2"); +- src: url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2"); - font-display: swap; - unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF; -} @@ -41,37 +26,14 @@ index 0f4d842..9aec0d6 100644 * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs -index bec5c08..1f6ccf2 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs -@@ -138,29 +138,6 @@ crate mod source_code_pro { - pub(crate) static LICENSE: &[u8] = include_bytes!("static/fonts/SourceCodePro-LICENSE.txt"); +@@ -126,8 +126,6 @@ + source_code_pro_semibold => "static/fonts/SourceCodePro-Semibold.ttf.woff2", + source_code_pro_italic => "static/fonts/SourceCodePro-It.ttf.woff2", + source_code_pro_license => "static/fonts/SourceCodePro-LICENSE.txt", +- nanum_barun_gothic_regular => "static/fonts/NanumBarunGothic.ttf.woff2", +- nanum_barun_gothic_license => "static/fonts/NanumBarunGothic-LICENSE.txt", } --/// Files related to the Nanum Barun Gothic font. --/// --/// These files are used to avoid some legacy CJK serif fonts in Windows. --/// --/// Note that the Noto Sans KR font, which was used previously but was not very readable on Windows, --/// has been replaced by the Nanum Barun Gothic font. This is due to Windows' implementation of font --/// rendering that distorts OpenType fonts too much. --/// --/// The font files were generated with these commands: --/// --/// ```sh --/// pyftsubset NanumBarunGothic.ttf \ --/// --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \ --/// --output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2 --/// ``` --pub(crate) mod nanum_barun_gothic { -- /// The file `NanumBarunGothic.ttf.woff2`, the Regular variant of the Nanum Barun Gothic font. -- pub(crate) static REGULAR: &[u8] = include_bytes!("static/fonts/NanumBarunGothic.ttf.woff2"); -- -- /// The file `NanumBarunGothic-LICENSE.txt`, the license text of the Nanum Barun Gothic font. -- pub(crate) static LICENSE: &[u8] = include_bytes!("static/fonts/NanumBarunGothic-LICENSE.txt"); --} -- - /// Files related to the sidebar in rustdoc sources. - pub(crate) mod sidebar { - /// File script to handle sidebar. + pub(crate) static SCRAPE_EXAMPLES_HELP_MD: &str = include_str!("static/scrape-examples-help.md"); diff --git a/debian/patches/series b/debian/patches/series index d3d42890b..c848c82e1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,8 +4,8 @@ u-ignore-reproducible-failure.patch u-reproducible-build.patch u-ignore-endian-big-diff.patch -u-make-compiletest-work-without-rpath.patch u-fix-get-toml-when-test.patch +u-fix-sysroot-detection-logic.patch # can be dropped once upstream updates rustix u-fix-rustix-for-sparc64.patch diff --git a/debian/patches/u-fix-get-toml-when-test.patch b/debian/patches/u-fix-get-toml-when-test.patch index 229bd1432..a9dd0fee0 100644 --- a/debian/patches/u-fix-get-toml-when-test.patch +++ b/debian/patches/u-fix-get-toml-when-test.patch @@ -8,7 +8,7 @@ Last-Update: 2023-03-29 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -896,9 +896,9 @@ +@@ -907,9 +907,9 @@ config.stage0_metadata = t!(serde_json::from_slice::<Stage0Metadata>(&stage0_json)); diff --git a/debian/patches/u-fix-rustix-for-sparc64.patch b/debian/patches/u-fix-rustix-for-sparc64.patch index 88995cd5b..d0c636e3b 100644 --- a/debian/patches/u-fix-rustix-for-sparc64.patch +++ b/debian/patches/u-fix-rustix-for-sparc64.patch @@ -1,203 +1,103 @@ ---- rustc-1.64.0+dfsg1.orig/vendor/rustix/src/imp/libc/process/types.rs -+++ rustc-1.64.0+dfsg1/vendor/rustix/src/imp/libc/process/types.rs -@@ -199,7 +199,12 @@ pub enum Signal { - target_os = "openbsd", - all( - any(target_os = "android", target_os = "linux"), -- any(target_arch = "mips", target_arch = "mips64"), -+ any( -+ target_arch = "mips", -+ target_arch = "mips64", -+ target_arch = "sparc", -+ target_arch = "sparc64" -+ ), - ) - )))] - Stkflt = c::SIGSTKFLT, -@@ -276,7 +281,12 @@ impl Signal { - target_os = "openbsd", - all( - any(target_os = "android", target_os = "linux"), -- any(target_arch = "mips", target_arch = "mips64"), -+ any( -+ target_arch = "mips", -+ target_arch = "mips64", -+ target_arch = "sparc", -+ target_arch = "sparc64" -+ ), - ) - )))] - c::SIGSTKFLT => Some(Self::Stkflt), ---- rustc-1.64.0+dfsg1.orig/vendor/rustix/src/imp/libc/termios/types.rs -+++ rustc-1.64.0+dfsg1/vendor/rustix/src/imp/libc/termios/types.rs -@@ -704,6 +704,8 @@ pub const B2000000: Speed = c::B2000000; - - /// `B2500000` - #[cfg(not(any( -+ target_arch = "sparc", -+ target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", -@@ -715,6 +717,8 @@ pub const B2500000: Speed = c::B2500000; - - /// `B3000000` - #[cfg(not(any( -+ target_arch = "sparc", -+ target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", -@@ -726,6 +730,8 @@ pub const B3000000: Speed = c::B3000000; - - /// `B3500000` - #[cfg(not(any( -+ target_arch = "sparc", -+ target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", -@@ -737,6 +743,8 @@ pub const B3500000: Speed = c::B3500000; - - /// `B4000000` - #[cfg(not(any( -+ target_arch = "sparc", -+ target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", ---- rustc-1.64.0+dfsg1.orig/vendor/rustix/src/imp/linux_raw/termios/types.rs -+++ rustc-1.64.0+dfsg1/vendor/rustix/src/imp/linux_raw/termios/types.rs -@@ -338,15 +338,19 @@ pub const B1500000: Speed = linux_raw_sy - pub const B2000000: Speed = linux_raw_sys::general::B2000000; - - /// `B2500000` -+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))] - pub const B2500000: Speed = linux_raw_sys::general::B2500000; - - /// `B3000000` -+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))] - pub const B3000000: Speed = linux_raw_sys::general::B3000000; - - /// `B3500000` -+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))] - pub const B3500000: Speed = linux_raw_sys::general::B3500000; - - /// `B4000000` -+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))] - pub const B4000000: Speed = linux_raw_sys::general::B4000000; - - /// `CSIZE` ---- rustc-1.64.0+dfsg1.orig/vendor/rustix/src/termios/constants.rs -+++ rustc-1.64.0+dfsg1/vendor/rustix/src/termios/constants.rs -@@ -45,6 +45,8 @@ pub use imp::termios::types::B2000000; +--- a/vendor/rustix/src/termios/constants.rs ++++ b/vendor/rustix/src/termios/constants.rs +@@ -33,6 +33,8 @@ )))] - pub use imp::termios::types::B2500000; + pub use backend::termios::types::B1500000; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "ios", -@@ -54,6 +56,8 @@ pub use imp::termios::types::B2500000; + target_os = "haiku", +@@ -96,6 +98,8 @@ )))] - pub use imp::termios::types::B3000000; + pub use backend::termios::types::B4000000; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", - target_os = "freebsd", + target_os = "haiku", target_os = "ios", -@@ -63,6 +67,8 @@ pub use imp::termios::types::B3000000; +@@ -104,6 +108,8 @@ )))] - pub use imp::termios::types::B3500000; + pub use backend::termios::types::B460800; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "ios", -@@ -74,6 +80,8 @@ pub use imp::termios::types::B4000000; - #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))] - pub use imp::termios::types::B460800; + target_os = "haiku", +@@ -116,6 +122,8 @@ + )))] + pub use backend::termios::types::B500000; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "illumos", -@@ -688,6 +696,8 @@ pub fn speed_value(speed: imp::termios:: + target_os = "haiku", +@@ -732,6 +740,8 @@ )))] - imp::termios::types::B2500000 => Some(2_500_000), + backend::termios::types::B500000 => Some(500_000), #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "ios", -@@ -697,6 +707,8 @@ pub fn speed_value(speed: imp::termios:: + target_os = "haiku", +@@ -744,6 +754,8 @@ )))] - imp::termios::types::B3000000 => Some(3_000_000), + backend::termios::types::B576000 => Some(576_000), #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", - target_os = "freebsd", + target_os = "haiku", target_os = "ios", -@@ -706,6 +718,8 @@ pub fn speed_value(speed: imp::termios:: +@@ -752,6 +764,8 @@ )))] - imp::termios::types::B3500000 => Some(3_500_000), + backend::termios::types::B921600 => Some(921_600), #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "ios", ---- rustc-1.64.0+dfsg1.orig/vendor/rustix/src/termios/mod.rs -+++ rustc-1.64.0+dfsg1/vendor/rustix/src/termios/mod.rs -@@ -44,6 +44,8 @@ pub use constants::B1500000; + target_os = "haiku", +--- a/vendor/rustix/src/termios/mod.rs ++++ b/vendor/rustix/src/termios/mod.rs +@@ -41,6 +41,8 @@ )))] - pub use constants::B2000000; + pub use constants::B1500000; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "ios", -@@ -53,6 +55,8 @@ pub use constants::B2000000; + target_os = "haiku", +@@ -104,6 +106,8 @@ )))] - pub use constants::B2500000; + pub use constants::B4000000; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", - target_os = "freebsd", + target_os = "haiku", target_os = "ios", -@@ -62,6 +66,8 @@ pub use constants::B2500000; +@@ -112,6 +116,8 @@ )))] - pub use constants::B3000000; + pub use constants::B460800; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "ios", -@@ -71,6 +77,8 @@ pub use constants::B3000000; + target_os = "haiku", +@@ -124,6 +130,8 @@ )))] - pub use constants::B3500000; + pub use constants::B500000; #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", target_os = "dragonfly", target_os = "freebsd", - target_os = "ios", ---- rustc-1.64.0+dfsg1.orig/vendor/rustix/tests/time/y2038.rs -+++ rustc-1.64.0+dfsg1/vendor/rustix/tests/time/y2038.rs -@@ -14,6 +14,7 @@ - #[cfg(not(all(target_env = "musl", target_pointer_width = "32")))] - #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] - #[cfg(not(all(target_os = "emscripten", target_pointer_width = "32")))] -+#[cfg(not(all(target_os = "linux", target_arch = "sparc")))] - #[test] - fn test_y2038() { - use rustix::time::{Secs, Timespec}; + target_os = "haiku", diff --git a/debian/patches/u-fix-sysroot-detection-logic.patch b/debian/patches/u-fix-sysroot-detection-logic.patch new file mode 100644 index 000000000..3bb0797ba --- /dev/null +++ b/debian/patches/u-fix-sysroot-detection-logic.patch @@ -0,0 +1,44 @@ +Description: Fix sysroot detection which would result in /usr/lib/lib/rustlib + This patch is a mixture of two upstream fix attempts. The first from + https://github.com/rust-lang/rust/pull/108376 didn't actually solve the + problem in Debian's case. After reporting that in $Bug, a second attempt is + made at https://github.com/rust-lang/rust/pull/110281, which worked. +Bug: https://github.com/rust-lang/rust/issues/109994 +--- a/compiler/rustc_session/src/filesearch.rs ++++ b/compiler/rustc_session/src/filesearch.rs +@@ -180,18 +180,29 @@ + ))?; + + // if `dir` points target's dir, move up to the sysroot +- if dir.ends_with(crate::config::host_triple()) { ++ let mut sysroot_dir = if dir.ends_with(crate::config::host_triple()) { + dir.parent() // chop off `$target` + .and_then(|p| p.parent()) // chop off `rustlib` + .and_then(|p| p.parent()) // chop off `lib` + .map(|s| s.to_owned()) +- .ok_or(format!( +- "Could not move 3 levels upper using `parent()` on {}", +- dir.display() +- )) ++ .ok_or_else(|| { ++ format!("Could not move 3 levels upper using `parent()` on {}", dir.display()) ++ })? + } else { +- Ok(dir.to_owned()) ++ dir.to_owned() ++ }; ++ ++ // On multiarch linux systems, there will be multiarch directory named ++ // with the architecture(e.g `x86_64-linux-gnu`) under the `lib` directory. ++ // Which cause us to mistakenly end up in the lib directory instead of the sysroot directory. ++ if sysroot_dir.ends_with("lib") { ++ sysroot_dir = ++ sysroot_dir.parent().map(|real_sysroot| real_sysroot.to_owned()).ok_or_else( ++ || format!("Could not move to parent path of {}", sysroot_dir.display()), ++ )? + } ++ ++ Ok(sysroot_dir) + } + + // Use env::args().next() to get the path of the executable without diff --git a/debian/patches/u-ignore-endian-big-diff.patch b/debian/patches/u-ignore-endian-big-diff.patch index 21e2de1e9..aec8c5255 100644 --- a/debian/patches/u-ignore-endian-big-diff.patch +++ b/debian/patches/u-ignore-endian-big-diff.patch @@ -33,7 +33,7 @@ Bug: https://github.com/rust-lang/rust/issues/89577 @@ -1,3 +1,4 @@ +// ignore-test // stderr-per-bitwidth - #![feature(rustc_attrs)] + #![feature(rustc_attrs, ptr_metadata)] #![allow(invalid_value)] // make sure we cannot allow away the errors tested here --- a/src/test/ui/consts/const-eval/ub-ref-ptr.rs +++ b/src/test/ui/consts/const-eval/ub-ref-ptr.rs diff --git a/debian/patches/u-make-compiletest-work-without-rpath.patch b/debian/patches/u-make-compiletest-work-without-rpath.patch deleted file mode 100644 index 7e852a586..000000000 --- a/debian/patches/u-make-compiletest-work-without-rpath.patch +++ /dev/null @@ -1,185 +0,0 @@ -From f8a0cc2ca8a644ddb63867526711ba17cb7508c8 Mon Sep 17 00:00:00 2001 -From: Josh Stone <jistone@redhat.com> -Date: Fri, 14 Oct 2022 16:11:28 -0700 -Subject: [PATCH] compiletest: set the dylib path when gathering target cfg -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If the compiler is built with `rpath = false`, then it won't find its -own libraries unless the library search path is set. We already do that -while running the actual compiletests, but #100260 added another rustc -command for getting the target cfg. - - Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) - thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" - --- stdout - - --- stderr - [...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory - ', src/tools/compiletest/src/common.rs:476:13 - -Now the library path is set here as well, so it works without rpath. - -FG: Context adapted - -Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> ---- - src/tools/compiletest/src/common.rs | 18 +++++++++++------- - src/tools/compiletest/src/runtest.rs | 27 +++------------------------ - src/tools/compiletest/src/util.rs | 23 +++++++++++++++++++++++ - 3 files changed, 37 insertions(+), 31 deletions(-) - -diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs -index 64df76e2772..98a35810cfd 100644 ---- a/src/tools/compiletest/src/common.rs -+++ b/src/tools/compiletest/src/common.rs -@@ -2,11 +2,12 @@ pub use self::Mode::*; - - use std::ffi::OsString; - use std::fmt; -+use std::iter; - use std::path::{Path, PathBuf}; - use std::process::Command; - use std::str::FromStr; - --use crate::util::PathBufExt; -+use crate::util::{add_dylib_path, PathBufExt}; - use lazycell::LazyCell; - use test::ColorConfig; - -@@ -386,7 +387,7 @@ - - fn target_cfg(&self) -> &TargetCfg { - self.target_cfg -- .borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target, &self.target_rustcflags)) -+ .borrow_with(|| TargetCfg::new(self)) - } - - pub fn matches_arch(&self, arch: &str) -> bool { -@@ -457,21 +458,22 @@ - } - - impl TargetCfg { -- fn new(rustc_path: &Path, target: &str, target_rustcflags: &Vec<String>) -> TargetCfg { -- let output = match Command::new(rustc_path) -+ fn new(config: &Config) -> TargetCfg { -+ let mut command = Command::new(&config.rustc_path); -+ add_dylib_path(&mut command, iter::once(&config.compile_lib_path)); -+ let output = match command - .arg("--print=cfg") - .arg("--target") -- .arg(target) -- .args(target_rustcflags) -+ .arg(&config.target) - .output() - { - Ok(output) => output, -- Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", rustc_path), -+ Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", config.rustc_path), - }; - if !output.status.success() { - panic!( - "error: failed to get cfg info from {:?}\n--- stdout\n{}\n--- stderr\n{}", -- rustc_path, -+ config.rustc_path, - String::from_utf8(output.stdout).unwrap(), - String::from_utf8(output.stderr).unwrap(), - ); -diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs -index 8f289876f73..eb467170249 100644 ---- a/src/tools/compiletest/src/runtest.rs -+++ b/src/tools/compiletest/src/runtest.rs -@@ -13,7 +13,7 @@ use crate::errors::{self, Error, ErrorKind}; - use crate::header::TestProps; - use crate::json; - use crate::read2::read2_abbreviated; --use crate::util::{logv, PathBufExt}; -+use crate::util::{add_dylib_path, dylib_env_var, logv, PathBufExt}; - use crate::ColorConfig; - use regex::{Captures, Regex}; - use rustfix::{apply_suggestions, get_suggestions_from_json, Filter}; -@@ -26,6 +26,7 @@ use std::fs::{self, create_dir_all, File, OpenOptions}; - use std::hash::{Hash, Hasher}; - use std::io::prelude::*; - use std::io::{self, BufReader}; -+use std::iter; - use std::path::{Path, PathBuf}; - use std::process::{Child, Command, ExitStatus, Output, Stdio}; - use std::str; -@@ -72,19 +73,6 @@ fn disable_error_reporting<F: FnOnce() -> R, R>(f: F) -> R { - f() - } - --/// The name of the environment variable that holds dynamic library locations. --pub fn dylib_env_var() -> &'static str { -- if cfg!(windows) { -- "PATH" -- } else if cfg!(target_os = "macos") { -- "DYLD_LIBRARY_PATH" -- } else if cfg!(target_os = "haiku") { -- "LIBRARY_PATH" -- } else { -- "LD_LIBRARY_PATH" -- } --} -- - /// The platform-specific library name - pub fn get_lib_name(lib: &str, dylib: bool) -> String { - // In some casess (e.g. MUSL), we build a static -@@ -1811,16 +1799,7 @@ - - // Need to be sure to put both the lib_path and the aux path in the dylib - // search path for the child. -- let mut path = -- env::split_paths(&env::var_os(dylib_env_var()).unwrap_or_default()).collect::<Vec<_>>(); -- if let Some(p) = aux_path { -- path.insert(0, PathBuf::from(p)) -- } -- path.insert(0, PathBuf::from(lib_path)); -- -- // Add the new dylib search path var -- let newpath = env::join_paths(&path).unwrap(); -- command.env(dylib_env_var(), newpath); -+ add_dylib_path(&mut command, iter::once(lib_path).chain(aux_path)); - - let mut child = disable_error_reporting(|| command.spawn()) - .unwrap_or_else(|_| panic!("failed to exec `{:?}`", &command)); -diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs -index 9d047b63c85..4b73be0fbb9 100644 ---- a/src/tools/compiletest/src/util.rs -+++ b/src/tools/compiletest/src/util.rs -@@ -2,6 +2,7 @@ use crate::common::Config; - use std::env; - use std::ffi::OsStr; - use std::path::PathBuf; -+use std::process::Command; - - use tracing::*; - -@@ -111,3 +112,25 @@ - } - } - } -+ -+/// The name of the environment variable that holds dynamic library locations. -+pub fn dylib_env_var() -> &'static str { -+ if cfg!(windows) { -+ "PATH" -+ } else if cfg!(target_os = "macos") { -+ "DYLD_LIBRARY_PATH" -+ } else if cfg!(target_os = "haiku") { -+ "LIBRARY_PATH" -+ } else { -+ "LD_LIBRARY_PATH" -+ } -+} -+ -+/// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. -+/// If the dylib_path_var is already set for this cmd, the old value will be overwritten! -+pub fn add_dylib_path(cmd: &mut Command, paths: impl Iterator<Item = impl Into<PathBuf>>) { -+ let path_env = env::var_os(dylib_env_var()); -+ let old_paths = path_env.as_ref().map(env::split_paths); -+ let new_paths = paths.map(Into::into).chain(old_paths.into_iter().flatten()); -+ cmd.env(dylib_env_var(), env::join_paths(new_paths).unwrap()); -+} diff --git a/debian/patches/u-rustc-llvm-cross-flags.patch b/debian/patches/u-rustc-llvm-cross-flags.patch index 0e544db8e..6ee382aba 100644 --- a/debian/patches/u-rustc-llvm-cross-flags.patch +++ b/debian/patches/u-rustc-llvm-cross-flags.patch @@ -11,7 +11,7 @@ diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index b8f67ee..e9b1d0a 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs -@@ -301,7 +301,7 @@ fn main() { +@@ -304,7 +304,7 @@ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") { println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); } else if let Some(stripped) = lib.strip_prefix("-L") { diff --git a/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch b/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch index 4acfdcb2f..7cb501e76 100644 --- a/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch +++ b/debian/patches/ubuntu-disable-ppc64el-asm-tests.patch @@ -16,7 +16,7 @@ /// unsafe { asm!("", options(noreturn)); } --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs -@@ -3130,7 +3130,10 @@ +@@ -3238,7 +3238,10 @@ /// ### Example /// /// ```rust,compile_fail |