diff options
Diffstat (limited to 'debian/patches/upstream')
8 files changed, 395 insertions, 0 deletions
diff --git a/debian/patches/upstream/d-disable-download-tests.patch b/debian/patches/upstream/d-disable-download-tests.patch new file mode 100644 index 000000000..85700f999 --- /dev/null +++ b/debian/patches/upstream/d-disable-download-tests.patch @@ -0,0 +1,33 @@ +From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Date: Thu, 13 Jun 2024 11:16:39 +0200 +Subject: d-disable-download-tests + +Forwarded: no +--- + src/bootstrap/src/tests/config.rs | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/bootstrap/src/tests/config.rs b/src/bootstrap/src/tests/config.rs +index 6f43234..0f1471d 100644 +--- a/src/bootstrap/src/tests/config.rs ++++ b/src/bootstrap/src/tests/config.rs +@@ -18,6 +18,9 @@ fn parse(config: &str) -> Config { + + #[test] + fn download_ci_llvm() { ++ // Debian: this will attempt to download LLVM ++ return; ++ + if crate::core::build_steps::llvm::is_ci_llvm_modified(&parse("")) { + eprintln!("Detected LLVM as non-available: running in CI and modified LLVM in this change"); + return; +@@ -46,6 +49,9 @@ fn download_ci_llvm() { + // - https://github.com/rust-lang/rust/pull/109162#issuecomment-1496782487 + #[test] + fn detect_src_and_out() { ++ // Debian: this will attempt to download a toolchain ++ return; ++ + fn test(cfg: Config, build_dir: Option<&str>) { + // This will bring absolute form of `src/bootstrap` path + let current_dir = std::env::current_dir().unwrap(); diff --git a/debian/patches/upstream/d-ignore-test_arc_condvar_poison-ppc.patch b/debian/patches/upstream/d-ignore-test_arc_condvar_poison-ppc.patch new file mode 100644 index 000000000..491e51bf3 --- /dev/null +++ b/debian/patches/upstream/d-ignore-test_arc_condvar_poison-ppc.patch @@ -0,0 +1,21 @@ +From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Date: Thu, 13 Jun 2024 11:16:39 +0200 +Subject: d-ignore-test_arc_condvar_poison-ppc + +Forwarded: no +--- + library/std/src/sync/mutex/tests.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/library/std/src/sync/mutex/tests.rs b/library/std/src/sync/mutex/tests.rs +index 1786a3c..812ec51 100644 +--- a/library/std/src/sync/mutex/tests.rs ++++ b/library/std/src/sync/mutex/tests.rs +@@ -145,6 +145,7 @@ fn test_mutex_arc_condvar() { + } + } + ++#[cfg(not(target_arch = "powerpc"))] + #[test] + fn test_arc_condvar_poison() { + let packet = Packet(Arc::new((Mutex::new(1), Condvar::new()))); diff --git a/debian/patches/upstream/u-avoid-blessing-cargo-deps-s-source-code-in-ui-tests.patch b/debian/patches/upstream/u-avoid-blessing-cargo-deps-s-source-code-in-ui-tests.patch new file mode 100644 index 000000000..905b2b075 --- /dev/null +++ b/debian/patches/upstream/u-avoid-blessing-cargo-deps-s-source-code-in-ui-tests.patch @@ -0,0 +1,47 @@ +From: Josh Stone <jistone@redhat.com> +Date: Mon, 8 Apr 2024 15:04:44 -0700 +Subject: [PATCH] Fix UI tests with dist-vendored dependencies + +There is already a workaround in `compiletest` to deal with custom +`CARGO_HOME` using `-Zignore-directory-in-diagnostics-source-blocks={}`. +A similar need exists when dependencies come from the local `vendor` +directory, which distro builds often use, so now we ignore that too. + +Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably +expecting a version suffix, but the vendored path doesn't include the +version. Now that matches `[\\/]hashbrown` instead. + +Forwarded: yes +--- + src/tools/compiletest/src/runtest.rs | 5 +++++ + tests/ui/issues/issue-21763.rs | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs +index 5d53a4d..9bb30ad 100644 +--- a/src/tools/compiletest/src/runtest.rs ++++ b/src/tools/compiletest/src/runtest.rs +@@ -2342,6 +2342,11 @@ impl<'test> TestCx<'test> { + "ignore-directory-in-diagnostics-source-blocks={}", + home::cargo_home().expect("failed to find cargo home").to_str().unwrap() + )); ++ // Similarly, vendored sources shouldn't be shown when running from a dist tarball. ++ rustc.arg("-Z").arg(format!( ++ "ignore-directory-in-diagnostics-source-blocks={}", ++ self.config.find_rust_src_root().unwrap().join("vendor").display(), ++ )); + + // Optionally prevent default --sysroot if specified in test compile-flags. + if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot")) +diff --git a/tests/ui/issues/issue-21763.rs b/tests/ui/issues/issue-21763.rs +index 38103ff..cc1a006 100644 +--- a/tests/ui/issues/issue-21763.rs ++++ b/tests/ui/issues/issue-21763.rs +@@ -1,6 +1,6 @@ + // Regression test for HashMap only impl'ing Send/Sync if its contents do + +-// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION" ++// normalize-stderr-test: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION" + + use std::collections::HashMap; + use std::rc::Rc; diff --git a/debian/patches/upstream/u-fix-get-toml-when-test.patch b/debian/patches/upstream/u-fix-get-toml-when-test.patch new file mode 100644 index 000000000..cbe054b73 --- /dev/null +++ b/debian/patches/upstream/u-fix-get-toml-when-test.patch @@ -0,0 +1,54 @@ +From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Date: Thu, 13 Jun 2024 11:16:38 +0200 +Subject: Fix get_toml() when cfg(test) + +Bug: https://github.com/rust-lang/rust/issues/105766 +Last-Update: 2023-03-29 + +When cfg(test), Config::parse doesn't parse a config.toml but uses default +values, failing when the initial rustc is needed. This is a workaround before +upstream issue gets solved. +Last-Update: 2023-03-29 +--- + src/bootstrap/src/core/config/config.rs | 28 ++++++++++++++++++++++++++-- + 1 file changed, 26 insertions(+), 2 deletions(-) + +diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs +index f1e1b89..738d2e1 100644 +--- a/src/bootstrap/src/core/config/config.rs ++++ b/src/bootstrap/src/core/config/config.rs +@@ -1180,8 +1180,32 @@ impl Config { + + pub fn parse(args: &[String]) -> Config { + #[cfg(test)] +- fn get_toml(_: &Path) -> TomlConfig { +- TomlConfig::default() ++ fn get_toml(file: &Path) -> TomlConfig { ++ // Debian: We use previous version as a custom rustc, which ++ // unfortunately won't be picked up because config.toml isn't ++ // read when cfg!(test). Making tests use the entirety of our ++ // config.toml isn't feasible either as it panicks on ++ // GitRepo::Llvm (d-bootstrap-custom-debuginfo-path.patch), so ++ // only give paths of initial rustc and cargo. ++ let contents = ++ t!(fs::read_to_string(file), format!("config file {} not found", file.display())); ++ // Deserialize to Value and then TomlConfig to prevent the Deserialize impl of ++ // TomlConfig and sub types to be monomorphized 5x by toml. ++ toml::from_str(&contents) ++ .and_then(|table: toml::Value| TomlConfig::deserialize(table)) ++ .map(|table| { ++ let mut config = TomlConfig::default(); ++ let mut build = Build::default(); ++ let cbuild = table.build.unwrap(); ++ build.rustc = cbuild.rustc; ++ build.cargo = cbuild.cargo; ++ config.build = Some(build); ++ config ++ }) ++ .unwrap_or_else(|err| { ++ eprintln!("failed to parse TOML configuration '{}': {err}", file.display()); ++ crate::detail_exit(2); ++ }) + } + + #[cfg(not(test))] diff --git a/debian/patches/upstream/u-hurd-tests.patch b/debian/patches/upstream/u-hurd-tests.patch new file mode 100644 index 000000000..3f2740f32 --- /dev/null +++ b/debian/patches/upstream/u-hurd-tests.patch @@ -0,0 +1,64 @@ +From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Date: Thu, 13 Jun 2024 11:16:39 +0200 +Subject: These tests hang or make the box OOM + +Forwarded: no +--- + tests/run-make/long-linker-command-lines/foo.rs | 7 +++++++ + tests/ui/associated-consts/issue-93775.rs | 1 + + tests/ui/issues/issue-74564-if-expr-stack-overflow.rs | 1 + + tests/ui/threads-sendsync/mpsc_stress.rs | 1 + + 4 files changed, 10 insertions(+) + +diff --git a/tests/run-make/long-linker-command-lines/foo.rs b/tests/run-make/long-linker-command-lines/foo.rs +index db238c0..c8ad6b8 100644 +--- a/tests/run-make/long-linker-command-lines/foo.rs ++++ b/tests/run-make/long-linker-command-lines/foo.rs +@@ -44,6 +44,13 @@ fn read_linker_args(path: &Path) -> String { + } + } + ++#[cfg(target_os = "hurd")] ++// Debian: test causes build to fail on hurd ++fn main() { ++ return; ++} ++ ++#[cfg(not(target_os = "hurd"))] + fn main() { + let tmpdir = PathBuf::from(env::var_os("TMPDIR").unwrap()); + let ok = tmpdir.join("ok"); +diff --git a/tests/ui/associated-consts/issue-93775.rs b/tests/ui/associated-consts/issue-93775.rs +index db788fe..ae4a64e 100644 +--- a/tests/ui/associated-consts/issue-93775.rs ++++ b/tests/ui/associated-consts/issue-93775.rs +@@ -1,5 +1,6 @@ + // build-pass + // ignore-tidy-linelength ++// ignore-hurd + + // Regression for #93775, needs build-pass to test it. + +diff --git a/tests/ui/issues/issue-74564-if-expr-stack-overflow.rs b/tests/ui/issues/issue-74564-if-expr-stack-overflow.rs +index 36e9932..19c04b6 100644 +--- a/tests/ui/issues/issue-74564-if-expr-stack-overflow.rs ++++ b/tests/ui/issues/issue-74564-if-expr-stack-overflow.rs +@@ -1,5 +1,6 @@ + // build-pass + // ignore-tidy-filelength ++// ignore-hurd + #![crate_type = "rlib"] + + fn banana(v: &str) -> u32 { +diff --git a/tests/ui/threads-sendsync/mpsc_stress.rs b/tests/ui/threads-sendsync/mpsc_stress.rs +index c2e1912..a0e7b6d 100644 +--- a/tests/ui/threads-sendsync/mpsc_stress.rs ++++ b/tests/ui/threads-sendsync/mpsc_stress.rs +@@ -1,6 +1,7 @@ + // run-pass + // compile-flags:--test + // ignore-emscripten ++// ignore-hurd + + use std::sync::mpsc::channel; + use std::sync::mpsc::TryRecvError; diff --git a/debian/patches/upstream/u-ignore-ppc-hangs.patch b/debian/patches/upstream/u-ignore-ppc-hangs.patch new file mode 100644 index 000000000..f2311225a --- /dev/null +++ b/debian/patches/upstream/u-ignore-ppc-hangs.patch @@ -0,0 +1,34 @@ +From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Date: Thu, 14 Jul 2022 13:17:37 +0200 +Subject: u-ignore-ppc-hangs + +Bug: https://github.com/rust-lang/rust/issues/89607 +--- + library/alloc/tests/arc.rs | 1 + + library/alloc/tests/rc.rs | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/library/alloc/tests/arc.rs b/library/alloc/tests/arc.rs +index d564a30..b607abc 100644 +--- a/library/alloc/tests/arc.rs ++++ b/library/alloc/tests/arc.rs +@@ -95,6 +95,7 @@ const SHARED_ITER_MAX: u16 = 100; + + fn assert_trusted_len<I: TrustedLen>(_: &I) {} + ++#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))] + #[test] + fn shared_from_iter_normal() { + // Exercise the base implementation for non-`TrustedLen` iterators. +diff --git a/library/alloc/tests/rc.rs b/library/alloc/tests/rc.rs +index 499740e..e418a7d 100644 +--- a/library/alloc/tests/rc.rs ++++ b/library/alloc/tests/rc.rs +@@ -91,6 +91,7 @@ const SHARED_ITER_MAX: u16 = 100; + + fn assert_trusted_len<I: TrustedLen>(_: &I) {} + ++#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))] + #[test] + fn shared_from_iter_normal() { + // Exercise the base implementation for non-`TrustedLen` iterators. diff --git a/debian/patches/upstream/u-riscv-disable-unpacked-split-debuginfo.patch b/debian/patches/upstream/u-riscv-disable-unpacked-split-debuginfo.patch new file mode 100644 index 000000000..ced256d18 --- /dev/null +++ b/debian/patches/upstream/u-riscv-disable-unpacked-split-debuginfo.patch @@ -0,0 +1,120 @@ +From: kxxt <rsworktech@outlook.com> +Date: Wed, 31 Jan 2024 09:02:18 +0800 +Subject: [PATCH] riscv only supports split_debuginfo=off for now + +Disable packed/unpacked options for riscv linux/android. +Other riscv targets already only have the off option. + +The packed/unpacked options might be supported in the future. +See upstream issue for more details: +https://github.com/llvm/llvm-project/issues/56642 + +Bug: https://github.com/rust-lang/rust/issues/110224 +--- + .../rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs | 5 ++++- + .../rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs | 5 ++++- + compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs | 5 ++++- + .../rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs | 5 ++++- + .../rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs | 5 ++++- + 5 files changed, 20 insertions(+), 5 deletions(-) + +diff --git a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs +index 06e8f18..0be32cb 100644 +--- a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs +@@ -1,4 +1,6 @@ +-use crate::spec::{base, CodeModel, Target, TargetOptions}; ++use std::borrow::Cow; ++ ++use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; + + pub fn target() -> Target { + Target { +@@ -12,6 +14,7 @@ pub fn target() -> Target { + features: "+m,+a,+f,+d,+c".into(), + llvm_abiname: "ilp32d".into(), + max_atomic_width: Some(32), ++ supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), + ..base::linux_gnu::opts() + }, + } +diff --git a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs +index 722703d..cfa9990 100644 +--- a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs ++++ b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs +@@ -1,4 +1,6 @@ +-use crate::spec::{base, CodeModel, Target, TargetOptions}; ++use std::borrow::Cow; ++ ++use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; + + pub fn target() -> Target { + Target { +@@ -12,6 +14,7 @@ pub fn target() -> Target { + features: "+m,+a,+f,+d,+c".into(), + llvm_abiname: "ilp32d".into(), + max_atomic_width: Some(32), ++ supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), + ..base::linux_musl::opts() + }, + } +diff --git a/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs b/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs +index 40e447d..762197d 100644 +--- a/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs ++++ b/compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs +@@ -1,4 +1,6 @@ +-use crate::spec::{base, CodeModel, SanitizerSet, Target, TargetOptions}; ++use std::borrow::Cow; ++ ++use crate::spec::{base, CodeModel, SanitizerSet, SplitDebuginfo, Target, TargetOptions}; + + pub fn target() -> Target { + Target { +@@ -13,6 +15,7 @@ pub fn target() -> Target { + llvm_abiname: "lp64d".into(), + supported_sanitizers: SanitizerSet::ADDRESS, + max_atomic_width: Some(64), ++ supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), + ..base::android::opts() + }, + } +diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs +index c0969d4..e71929a 100644 +--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs +@@ -1,4 +1,6 @@ +-use crate::spec::{base, CodeModel, Target, TargetOptions}; ++use std::borrow::Cow; ++ ++use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; + + pub fn target() -> Target { + Target { +@@ -12,6 +14,7 @@ pub fn target() -> Target { + features: "+m,+a,+f,+d,+c".into(), + llvm_abiname: "lp64d".into(), + max_atomic_width: Some(64), ++ supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), + ..base::linux_gnu::opts() + }, + } +diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs +index 656e260..8ea28d6 100644 +--- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs ++++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs +@@ -1,4 +1,6 @@ +-use crate::spec::{base, CodeModel, Target, TargetOptions}; ++use std::borrow::Cow; ++ ++use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; + + pub fn target() -> Target { + Target { +@@ -12,6 +14,7 @@ pub fn target() -> Target { + features: "+m,+a,+f,+d,+c".into(), + llvm_abiname: "lp64d".into(), + max_atomic_width: Some(64), ++ supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), + ..base::linux_musl::opts() + }, + } diff --git a/debian/patches/upstream/u-rustc-llvm-cross-flags.patch b/debian/patches/upstream/u-rustc-llvm-cross-flags.patch new file mode 100644 index 000000000..22f59eab2 --- /dev/null +++ b/debian/patches/upstream/u-rustc-llvm-cross-flags.patch @@ -0,0 +1,22 @@ +From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Date: Thu, 14 Jul 2022 13:17:37 +0200 +Subject: u-rustc-llvm-cross-flags + +=================================================================== +--- + compiler/rustc_llvm/build.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs +index 4b0c122..77baa7b 100644 +--- a/compiler/rustc_llvm/build.rs ++++ b/compiler/rustc_llvm/build.rs +@@ -319,7 +319,7 @@ fn main() { + 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") { +- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); ++ if stripped.contains(&host) { println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); } + } + } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") { + println!("cargo:rustc-link-search=native={stripped}"); |