diff --git a/.gitignore b/.gitignore index a82d7cc..83aeea4 100644 --- a/.gitignore +++ b/.gitignore @@ -404,3 +404,26 @@ /rustc-1.62.0-src.tar.xz /rustc-1.62.1-src.tar.xz /rustc-1.63.0-src.tar.xz +/rustc-1.64.0-src.tar.xz +/rustc-1.65.0-src.tar.xz +/wasi-libc-wasi-sdk-16.tar.gz +/rustc-1.66.0-src.tar.xz +/wasi-libc-wasi-sdk-17.tar.gz +/rustc-1.66.1-src.tar.xz +/rustc-1.67.0-src.tar.xz +/rustc-1.67.1-src.tar.xz +/rustc-1.68.0-src.tar.xz +/wasi-libc-wasi-sdk-19.tar.gz +/rustc-1.68.1-src.tar.xz +/rustc-1.68.2-src.tar.xz +/rustc-1.69.0-src.tar.xz +/wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz +/rustc-1.70.0-src.tar.xz +/wasi-libc-wasi-sdk-20.tar.gz +/rustc-1.71.0-src.tar.xz +/rustc-1.71.1-src.tar.xz +/rustc-1.72.0-src.tar.xz +/wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz +/rustc-1.72.1-src.tar.xz +/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz +/rustc-1.73.0-src.tar.xz diff --git a/0001-Let-environment-variables-override-some-default-CPUs.patch b/0001-Let-environment-variables-override-some-default-CPUs.patch new file mode 100644 index 0000000..04a0c9c --- /dev/null +++ b/0001-Let-environment-variables-override-some-default-CPUs.patch @@ -0,0 +1,53 @@ +From 87caaab3681b95fa633aac48b9794364e18c467d Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 9 Jun 2023 15:23:08 -0700 +Subject: [PATCH] Let environment variables override some default CPUs + +--- + compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs | 2 +- + compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs | 2 +- + compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs +index fd896e086b54..08d0c43d20b4 100644 +--- a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs +@@ -2,7 +2,7 @@ + + pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); +- base.cpu = "ppc64le".into(); ++ base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into(); + base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); + base.max_atomic_width = Some(64); + base.stack_probes = StackProbeType::Inline; +diff --git a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs +index f2c722b9a89d..17a14d10b27e 100644 +--- a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs +@@ -5,7 +5,7 @@ pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); + base.endian = Endian::Big; + // z10 is the oldest CPU supported by LLVM +- base.cpu = "z10".into(); ++ base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into(); + // FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector + // ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we + // also strip v128 from the data_layout below to match the older LLVM's expectation. +diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs +index 2f970f87cc64..7ee62cd62a5c 100644 +--- a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs ++++ b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs +@@ -2,7 +2,7 @@ + + pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); +- base.cpu = "x86-64".into(); ++ base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into(); + base.plt_by_default = false; + base.max_atomic_width = Some(64); + base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); +-- +2.41.0 + diff --git a/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch new file mode 100644 index 0000000..6806d2a --- /dev/null +++ b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch @@ -0,0 +1,30 @@ +From 35187c7e6474d346eea3113c4ae34d26d6b18756 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 22 Aug 2023 10:42:12 -0700 +Subject: [PATCH] Skip ExpandYamlAnchors when the config is missing + +The dist-src tarball does not include `.github/` at all, so we can't +check whether it needs to be regenerated. +--- + src/bootstrap/test.rs | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index db3b7ffbea4e..d1018978f78c 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -1174,6 +1174,11 @@ impl Step for ExpandYamlAnchors { + /// appropriate configuration for all our CI providers. This step ensures the tool was called + /// by the user before committing CI changes. + fn run(self, builder: &Builder<'_>) { ++ // Note: `.github/` is not included in dist-src tarballs ++ if !builder.src.join(".github/workflows/ci.yml").exists() { ++ builder.info("Skipping YAML anchors check: GitHub Actions config not found"); ++ return; ++ } + builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); + builder.run_delaying_failure( + &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), +-- +2.41.0 + diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch deleted file mode 100644 index fa75ad3..0000000 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b521511174b1a08dddfac243604d649b71cc7386 Mon Sep 17 00:00:00 2001 -From: Ivan Mironov -Date: Sun, 8 Dec 2019 17:23:08 +0500 -Subject: [PATCH] Use lld provided by system for wasm - ---- - compiler/rustc_target/src/spec/wasm_base.rs | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs -index de7b7374af31..eebbe616e9b6 100644 ---- a/compiler/rustc_target/src/spec/wasm_base.rs -+++ b/compiler/rustc_target/src/spec/wasm_base.rs -@@ -99,8 +99,7 @@ pub fn options() -> TargetOptions { - // arguments just yet - limit_rdylib_exports: false, - -- // we use the LLD shipped with the Rust toolchain by default -- linker: Some("rust-lld".into()), -+ linker: Some("lld".into()), - lld_flavor: LldFlavor::Wasm, - linker_is_gnu: false, - --- -2.35.1 - diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch new file mode 100644 index 0000000..2b22d48 --- /dev/null +++ b/0001-Use-lld-provided-by-system.patch @@ -0,0 +1,39 @@ +diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs +index 341763aadbaf..ee6358e72955 100644 +--- a/compiler/rustc_target/src/spec/wasm_base.rs ++++ b/compiler/rustc_target/src/spec/wasm_base.rs +@@ -89,8 +89,7 @@ macro_rules! args { + // arguments just yet + limit_rdylib_exports: false, + +- // we use the LLD shipped with the Rust toolchain by default +- linker: Some("rust-lld".into()), ++ linker: Some("lld".into()), + linker_flavor: LinkerFlavor::WasmLld(Cc::No), + + pre_link_args, +diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/x86_64_unknown_none.rs +index fe3b24f2d4af..1f1731d202ca 100644 +--- a/compiler/rustc_target/src/spec/x86_64_unknown_none.rs ++++ b/compiler/rustc_target/src/spec/x86_64_unknown_none.rs +@@ -17,7 +17,7 @@ pub fn target() -> Target { + static_position_independent_executables: true, + relro_level: RelroLevel::Full, + linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), +- linker: Some("rust-lld".into()), ++ linker: Some("lld".into()), + features: + "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float" + .into(), +diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs +index 67664a74710a..53153cd120a3 100644 +--- a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs ++++ b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs +@@ -12,6 +12,7 @@ pub fn target() -> Target { + base.cpu = "x86-64".into(); + base.plt_by_default = false; + base.max_atomic_width = Some(64); ++ base.linker = Some("lld".into()); + + // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to + // enable these CPU features explicitly before their first use, otherwise their instructions diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch new file mode 100644 index 0000000..d499588 --- /dev/null +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -0,0 +1,102 @@ +From 19c37083cdae94105f6429350dd0b6617e3c2d56 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 28 Sep 2023 18:14:28 -0700 +Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained + +--- + config.example.toml | 5 +++++ + src/bootstrap/compile.rs | 4 ++++ + src/bootstrap/config.rs | 8 ++++++++ + src/bootstrap/lib.rs | 5 +++++ + 4 files changed, 22 insertions(+) + +diff --git a/config.example.toml b/config.example.toml +index 0c65b25fe138..6a0f1c01c328 100644 +--- a/config.example.toml ++++ b/config.example.toml +@@ -789,6 +789,11 @@ changelog-seen = 2 + # target triples containing `-none`, `nvptx`, `switch`, or `-uefi`. + #no-std = (bool) + ++# Copy libc and CRT objects into the target lib/self-contained/ directory. ++# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other ++# targets may ignore this setting if they have nothing to be contained. ++#self-contained = (bool) ++ + # ============================================================================= + # Distribution options + # +diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs +index 14c3ef79a78f..7adbf091acbb 100644 +--- a/src/bootstrap/compile.rs ++++ b/src/bootstrap/compile.rs +@@ -263,6 +263,10 @@ fn copy_self_contained_objects( + compiler: &Compiler, + target: TargetSelection, + ) -> Vec<(PathBuf, DependencyType)> { ++ if builder.self_contained(target) != Some(true) { ++ return vec![]; ++ } ++ + let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained"); + t!(fs::create_dir_all(&libdir_self_contained)); + let mut target_deps = vec![]; +diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs +index fe932fd6bd30..a626badc3e8a 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -541,6 +541,7 @@ pub struct Target { + pub wasi_root: Option, + pub qemu_rootfs: Option, + pub no_std: bool, ++ pub self_contained: bool, + } + + impl Target { +@@ -553,6 +554,9 @@ pub fn from_triple(triple: &str) -> Self { + { + target.no_std = true; + } ++ if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") { ++ target.self_contained = true; ++ } + target + } + } +@@ -999,6 +1003,7 @@ struct TomlTarget { + wasi_root: Option = "wasi-root", + qemu_rootfs: Option = "qemu-rootfs", + no_std: Option = "no-std", ++ self_contained: Option = "self-contained", + } + } + +@@ -1524,6 +1529,9 @@ fn get_table(option: &str) -> Result { + if let Some(s) = cfg.no_std { + target.no_std = s; + } ++ if let Some(s) = cfg.self_contained { ++ target.self_contained = s; ++ } + target.cc = cfg.cc.map(PathBuf::from).or_else(|| { + target.ndk.as_ref().map(|ndk| ndk_compiler(Language::C, &triple, ndk)) + }); +diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs +index 0a7aff62257a..9b7c18a3353f 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -1285,6 +1285,11 @@ fn no_std(&self, target: TargetSelection) -> Option { + self.config.target_config.get(&target).map(|t| t.no_std) + } + ++ /// Returns `true` if this is a self-contained `target`, if defined ++ fn self_contained(&self, target: TargetSelection) -> Option { ++ self.config.target_config.get(&target).map(|t| t.self_contained) ++ } ++ + /// Returns `true` if the target will be tested using the `remote-test-client` + /// and `remote-test-server` binaries. + fn remote_tested(&self, target: TargetSelection) -> bool { +-- +2.41.0 + diff --git a/0001-wasi-round-up-the-size-for-aligned_alloc.patch b/0001-wasi-round-up-the-size-for-aligned_alloc.patch new file mode 100644 index 0000000..7fbe950 --- /dev/null +++ b/0001-wasi-round-up-the-size-for-aligned_alloc.patch @@ -0,0 +1,33 @@ +From 1c6d867d78475fd8c6274e2b64ebb27735b6cabf Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Sat, 26 Aug 2023 11:50:16 -0700 +Subject: [PATCH] wasi: round up the size for `aligned_alloc` + +C11 `aligned_alloc` requires that the size be a multiple of the +alignment. This is enforced in the wasi-libc emmalloc implementation, +which always returns NULL if the size is not a multiple. +(The default `MALLOC_IMPL=dlmalloc` does not currently check this.) +--- + library/std/src/sys/unix/alloc.rs | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/library/std/src/sys/unix/alloc.rs b/library/std/src/sys/unix/alloc.rs +index 8604b53983d6..af0089978ecb 100644 +--- a/library/std/src/sys/unix/alloc.rs ++++ b/library/std/src/sys/unix/alloc.rs +@@ -86,7 +86,11 @@ unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { + } else if #[cfg(target_os = "wasi")] { + #[inline] + unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { +- libc::aligned_alloc(layout.align(), layout.size()) as *mut u8 ++ // C11 aligned_alloc requires that the size be a multiple of the alignment. ++ // Layout already checks that the size rounded up doesn't overflow isize::MAX. ++ let align = layout.align(); ++ let size = layout.size().next_multiple_of(align); ++ libc::aligned_alloc(align, size) as *mut u8 + } + } else { + #[inline] +-- +2.41.0 + diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch new file mode 100644 index 0000000..e60433a --- /dev/null +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -0,0 +1,78 @@ +From 3016b2b7052d8b01d50c3a3c6591aeb99d918ca3 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 28 Sep 2023 18:18:16 -0700 +Subject: [PATCH 2/2] set an external library path for wasm32-wasi + +--- + compiler/rustc_codegen_ssa/src/back/link.rs | 9 +++++++++ + compiler/rustc_target/src/spec/mod.rs | 2 ++ + compiler/rustc_target/src/spec/wasm32_wasi.rs | 6 +++++- + 3 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs +index b603a8787460..40d878b64479 100644 +--- a/compiler/rustc_codegen_ssa/src/back/link.rs ++++ b/compiler/rustc_codegen_ssa/src/back/link.rs +@@ -1475,6 +1475,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat + return file_path; + } + } ++ if let Some(lib_path) = &sess.target.options.external_lib_path { ++ let file_path = Path::new(lib_path.as_ref()).join(name); ++ if file_path.exists() { ++ return file_path; ++ } ++ } + for search_path in fs.search_paths() { + let file_path = search_path.dir.join(name); + if file_path.exists() { +@@ -1967,6 +1973,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained: + let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path(); + cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path)); + } ++ if let Some(lib_path) = &sess.target.options.external_lib_path { ++ cmd.include_path(Path::new(lib_path.as_ref())); ++ } + } + + /// Add options making relocation sections in the produced ELF files read-only +diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs +index 2365dfaf1af8..35f3a686cf67 100644 +--- a/compiler/rustc_target/src/spec/mod.rs ++++ b/compiler/rustc_target/src/spec/mod.rs +@@ -1653,6 +1653,7 @@ pub struct TargetOptions { + /// Objects to link before and after all other object code. + pub pre_link_objects: CrtObjects, + pub post_link_objects: CrtObjects, ++ pub external_lib_path: Option>, + /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled. + pub pre_link_objects_self_contained: CrtObjects, + pub post_link_objects_self_contained: CrtObjects, +@@ -2124,6 +2125,7 @@ fn default() -> TargetOptions { + relro_level: RelroLevel::None, + pre_link_objects: Default::default(), + post_link_objects: Default::default(), ++ external_lib_path: None, + pre_link_objects_self_contained: Default::default(), + post_link_objects_self_contained: Default::default(), + link_self_contained: LinkSelfContainedDefault::False, +diff --git a/compiler/rustc_target/src/spec/wasm32_wasi.rs b/compiler/rustc_target/src/spec/wasm32_wasi.rs +index a0476d542e64..ad7160bf5fcd 100644 +--- a/compiler/rustc_target/src/spec/wasm32_wasi.rs ++++ b/compiler/rustc_target/src/spec/wasm32_wasi.rs +@@ -85,7 +85,11 @@ pub fn target() -> Target { + options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained(); + + // FIXME: Figure out cases in which WASM needs to link with a native toolchain. +- options.link_self_contained = LinkSelfContainedDefault::True; ++ options.link_self_contained = LinkSelfContainedDefault::False; ++ ++ options.pre_link_objects = options.pre_link_objects_self_contained.clone(); ++ options.post_link_objects = options.post_link_objects_self_contained.clone(); ++ options.external_lib_path = Some("/usr/wasm32-wasi/lib/wasm32-wasi".into()); + + // Right now this is a bit of a workaround but we're currently saying that + // the target by default has a static crt which we're taking as a signal +-- +2.41.0 + diff --git a/plans/ci.fmf b/plans/ci.fmf index 1ad2c12..3fd3ab7 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -1,6 +1,5 @@ summary: CI Gating Plan discover: how: fmf - directory: tests execute: - how: beakerlib + how: tmt diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..15b680b --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,8 @@ +--- +debuginfo: + ignore: + # i686 has limited debuginfo. From rust.spec + # full debuginfo is exhausting memory; just do libstd for now + # https://github.com/rust-lang/rust/issues/45854 + - /usr/lib/debug/usr/bin/rustc-*.i386.debug + diff --git a/rust.spec b/rust.spec index 7e54d78..c29fa40 100644 --- a/rust.spec +++ b/rust.spec @@ -1,4 +1,4 @@ -# Only x86_64 and i686 are Tier 1 platforms at this time. +# Only x86_64, i686, and aarch64 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html %global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x riscv64 @@ -8,9 +8,9 @@ # To bootstrap from scratch, set the channel and date from src/stage0.json # e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_version 1.62.0 -%global bootstrap_channel 1.62.0 -%global bootstrap_date 2022-06-30 +%global bootstrap_version 1.72.0 +%global bootstrap_channel 1.72.0 +%global bootstrap_date 2023-08-24 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -26,35 +26,46 @@ %if 0%{?fedora} %global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu %endif -%if 0%{?fedora} || 0%{?rhel} >= 8 %global wasm_targets wasm32-unknown-unknown wasm32-wasi +%if 0%{?fedora} || 0%{?rhel} >= 10 +%global extra_targets x86_64-unknown-none x86_64-unknown-uefi %endif %endif +%global all_targets %{?mingw_targets} %{?wasm_targets} %{?extra_targets} +%define target_enabled() %{lua: + print(string.find(rpm.expand(" %{all_targets} "), rpm.expand(" %1 "), 1, true) or 0) +} # We need CRT files for *-wasi targets, at least as new as the commit in # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh # (updated per https://github.com/rust-lang/rust/pull/96907) %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -%global wasi_libc_commit 9886d3d6200fcc3726329966860fc058707406cd -%global wasi_libc_name wasi-libc-%{wasi_libc_commit} -%global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_commit}/%{wasi_libc_name}.tar.gz +#global wasi_libc_ref wasi-sdk-20 +%global wasi_libc_ref bd950eb128bff337153de217b11270f948d04bb4 +%global wasi_libc_name wasi-libc-%{wasi_libc_ref} +%global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_ref}/%{wasi_libc_name}.tar.gz %global wasi_libc_dir %{_builddir}/%{wasi_libc_name} +%if 0%{?fedora} +%bcond_with bundled_wasi_libc +%else +%bcond_without bundled_wasi_libc +%endif # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM -# is insufficient. Rust currently requires LLVM 12.0+. -%global min_llvm_version 12.0.0 -%global bundled_llvm_version 14.0.5 +# is insufficient. Rust currently requires LLVM 15.0+. +%global min_llvm_version 15.0.0 +%global bundled_llvm_version 17.0.2 %bcond_with bundled_llvm -# Requires stable libgit2 1.4, and not the next minor soname change. +# Requires stable libgit2 1.6, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.4.0 -%global next_libgit2_version 1.5.0~ -%global bundled_libgit2_version 1.4.2 -%if 0%{?fedora} >= 99 +%global min_libgit2_version 1.6.4 +%global next_libgit2_version 1.7.0~ +%global bundled_libgit2_version 1.6.4 +%if 0%{?fedora} >= 38 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -69,28 +80,18 @@ %bcond_with disabled_libssh2 %endif -%if 0%{?rhel} && 0%{?rhel} < 8 -%bcond_with curl_http2 +%if 0%{?__isa_bits} == 32 +# Disable PGO on 32-bit to reduce build memory +%bcond_with rustc_pgo %else -%bcond_without curl_http2 -%endif - -# LLDB isn't available everywhere... -%ifnarch riscv64 -%if 0%{?rhel} && 0%{?rhel} < 8 -%bcond_with lldb -%else -%bcond_without lldb -%endif -%else -%bcond_with lldb +%bcond_without rustc_pgo %endif Name: rust -Version: 1.63.0 -Release: 1.1.riscv64%{?dist} +Version: 1.73.0 +Release: 2%{?dist} Summary: The Rust Programming Language -License: (ASL 2.0 or MIT) and (BSD and MIT) +License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016) # ^ written as: (rust itself) and (bundled libraries) URL: https://www.rust-lang.org ExclusiveArch: %{rust_arches} @@ -104,11 +105,29 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz Source1: %{wasi_libc_source} # Sources for bootstrap_arches are inserted by lua below -# By default, rust tries to use "rust-lld" as a linker for WebAssembly. -Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch +# By default, rust tries to use "rust-lld" as a linker for some targets. +Patch1: 0001-Use-lld-provided-by-system.patch # Set a substitute-path in rust-gdb for standard library sources. -Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch +Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch + +# Override default target CPUs to match distro settings +# TODO: upstream this ability into the actual build configuration +Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch + +# Override the default self-contained system libraries +# TODO: the first can probably be upstreamed, but the second is hard-coded, +# and we're only applying that if not with bundled_wasi_libc. +Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch +Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch + +# The dist-src tarball doesn't include .github/ +# https://github.com/rust-lang/rust/pull/115109 +Patch6: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch + +# wasi: round up the size for aligned_alloc +# https://github.com/rust-lang/rust/pull/115254 +Patch7: 0001-wasi-round-up-the-size-for-aligned_alloc.patch ### RHEL-specific patches below ### @@ -116,16 +135,7 @@ Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.59.0-disable-libssh2.patch - -# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys -# will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.63.0-disable-http2.patch - -# kernel rh1410097 causes too-small stacks for PIE. -# (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.58.0-no-default-pie.patch - +Patch100: rustc-1.73.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -145,6 +155,11 @@ end} %global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} +# Get the environment form of the Rust triple +%global rust_triple_env %{lua: + print(string.upper(string.gsub(rpm.expand("%{rust_triple}"), "-", "_"))) +} + %if %defined bootstrap_arches # For each bootstrap arch, add an additional binary Source. # Also define bootstrap_source just for the current target. @@ -177,12 +192,7 @@ end} Provides: bundled(%{name}-bootstrap) = %{bootstrap_version} %else BuildRequires: cargo >= %{bootstrap_version} -%if 0%{?rhel} && 0%{?rhel} < 8 -BuildRequires: %{name} >= %{bootstrap_version} -BuildConflicts: %{name} > %{version} -%else BuildRequires: (%{name} >= %{bootstrap_version} with %{name} <= %{version}) -%endif %global local_rust_root %{_prefix} %endif @@ -219,7 +229,7 @@ Provides: bundled(llvm) = %{bundled_llvm_version} %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 -%global llvm llvm13 +%global llvm llvm14 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -256,7 +266,7 @@ Requires: %{name}-std-static%{?_isa} = %{version}-%{release} Requires: /usr/bin/cc %if 0%{?epel} == 7 -%global devtoolset_name devtoolset-9 +%global devtoolset_name devtoolset-11 BuildRequires: %{devtoolset_name}-binutils BuildRequires: %{devtoolset_name}-gcc BuildRequires: %{devtoolset_name}-gcc-c++ @@ -280,14 +290,7 @@ BuildRequires: %{devtoolset_name}-gcc-c++ # While we don't want to encourage dynamic linking to Rust shared libraries, as # there's no stable ABI, we still need the unallocated metadata (.rustc) to # support custom-derive plugins like #[proc_macro_derive(Foo)]. -%if 0%{?rhel} && 0%{?rhel} < 8 -# eu-strip is very eager by default, so we have to limit it to -g, only debugging symbols. -%global _find_debuginfo_opts -g -%undefine _include_minidebuginfo -%else -# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 %global _find_debuginfo_opts --keep-section .rustc -%endif %if %{without bundled_llvm} %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} @@ -312,7 +315,11 @@ BuildRequires: mingw64-winpthreads-static %endif %if %defined wasm_targets +%if %with bundled_wasi_libc BuildRequires: clang +%else +BuildRequires: wasi-libc-static +%endif BuildRequires: lld # brp-strip-static-archive breaks the archive index for wasm %global __os_install_post \ @@ -321,6 +328,13 @@ find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' %{nil} %endif +# For profiler_builtins +BuildRequires: compiler-rt + +# This component was removed as of Rust 1.69.0. +# https://github.com/rust-lang/rust/pull/101841 +Obsoletes: %{name}-analysis < 1.69.0~ + %description Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. @@ -330,72 +344,75 @@ This package includes the Rust compiler and documentation generator. %package std-static Summary: Standard library for Rust +Provides: %{name}-std-static-%{rust_triple} = %{version}-%{release} Requires: %{name} = %{version}-%{release} -Requires: glibc-devel%{?_isa} >= 2.11 +Requires: glibc-devel%{?_isa} >= 2.17 %description std-static This package includes the standard libraries for building applications written in Rust. -%if %defined mingw_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do - local subs = { - triple = triple, - name = rpm.expand("%{name}"), - verrel = rpm.expand("%{version}-%{release}"), - mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64", - } - local s = string.gsub([[ +%global target_package() \ +%package std-static-%1 \ +Summary: Standard library for Rust %1 \ +Requires: %{name} = %{version}-%{release} -%package std-static-{{triple}} -Summary: Standard library for Rust {{triple}} +%global target_description() \ +%description std-static-%1 \ +This package includes the standard libraries for building applications \ +written in Rust for the %2 target %1. + +%if %target_enabled i686-pc-windows-gnu +%target_package i686-pc-windows-gnu +Requires: mingw32-crt +Requires: mingw32-gcc +Requires: mingw32-winpthreads-static +Provides: mingw32-rust = %{version}-%{release} +Provides: mingw32-rustc = %{version}-%{release} BuildArch: noarch -Provides: {{mingw}}-rust = {{verrel}} -Provides: {{mingw}}-rustc = {{verrel}} -Requires: {{mingw}}-crt -Requires: {{mingw}}-gcc -Requires: {{mingw}}-winpthreads-static -Requires: {{name}} = {{verrel}} - -%description std-static-{{triple}} -This package includes the standard libraries for building applications -written in Rust for the MinGW target {{triple}}. - -]], "{{(%w+)}}", subs) - print(s) - end -end} +%target_description i686-pc-windows-gnu MinGW %endif -%if %defined wasm_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do - local subs = { - triple = triple, - name = rpm.expand("%{name}"), - verrel = rpm.expand("%{version}-%{release}"), - wasi = string.find(triple, "-wasi") and 1 or 0, - } - local s = string.gsub([[ - -%package std-static-{{triple}} -Summary: Standard library for Rust {{triple}} +%if %target_enabled x86_64-pc-windows-gnu +%target_package x86_64-pc-windows-gnu +Requires: mingw64-crt +Requires: mingw64-gcc +Requires: mingw64-winpthreads-static +Provides: mingw64-rust = %{version}-%{release} +Provides: mingw64-rustc = %{version}-%{release} BuildArch: noarch -Requires: {{name}} = {{verrel}} +%target_description x86_64-pc-windows-gnu MinGW +%endif + +%if %target_enabled wasm32-unknown-unknown +%target_package wasm32-unknown-unknown Requires: lld >= 8.0 -%if {{wasi}} -Provides: bundled(wasi-libc) +BuildArch: noarch +%target_description wasm32-unknown-unknown WebAssembly %endif -%description std-static-{{triple}} -This package includes the standard libraries for building applications -written in Rust for the WebAssembly target {{triple}}. +%if %target_enabled wasm32-wasi +%target_package wasm32-wasi +Requires: lld >= 8.0 +%if %with bundled_wasi_libc +Provides: bundled(wasi-libc) +%else +Requires: wasi-libc-static +%endif +BuildArch: noarch +%target_description wasm32-wasi WebAssembly +%endif -]], "{{(%w+)}}", subs) - print(s) - end -end} +%if %target_enabled x86_64-unknown-none +%target_package x86_64-unknown-none +Requires: lld +%target_description x86_64-unknown-none embedded +%endif + +%if %target_enabled x86_64-unknown-uefi +%target_package x86_64-unknown-uefi +Requires: lld +%target_description x86_64-unknown-uefi embedded %endif @@ -418,8 +435,6 @@ This package includes the rust-gdb script, which allows easier debugging of Rust programs. -%if %with lldb - %package lldb Summary: LLDB pretty printers for Rust BuildArch: noarch @@ -431,8 +446,6 @@ Requires: %{name}-debugger-common = %{version}-%{release} This package includes the rust-lldb script, which allows easier debugging of Rust programs. -%endif - %package doc Summary: Documentation for Rust @@ -441,6 +454,12 @@ Summary: Documentation for Rust # Koji will fail the build in rpmdiff if two architectures build a noarch # subpackage differently, so instead we have to keep its arch. +# Cargo no longer builds its own documentation +# https://github.com/rust-lang/cargo/pull/4904 +# We used to keep a shim cargo-doc package, but now that's merged too. +Obsoletes: cargo-doc < 1.65.0~ +Provides: cargo-doc = %{version}-%{release} + %description doc This package includes HTML documentation for the Rust programming language and its standard library. @@ -466,21 +485,13 @@ Cargo is a tool that allows Rust projects to declare their various dependencies and ensure that you'll always get a repeatable build. -%package -n cargo-doc -Summary: Documentation for Cargo -BuildArch: noarch -# Cargo no longer builds its own documentation -# https://github.com/rust-lang/cargo/pull/4904 -Requires: %{name}-doc = %{version}-%{release} - -%description -n cargo-doc -This package includes HTML documentation for Cargo. - - %package -n rustfmt Summary: Tool to find and fix Rust formatting issues Requires: cargo +# /usr/bin/rustfmt is dynamically linked against internal rustc libs +Requires: %{name}%{?_isa} = %{version}-%{release} + # The component/package was rustfmt-preview until Rust 1.31. Obsoletes: rustfmt-preview < 1.0.0 Provides: rustfmt-preview = %{version}-%{release} @@ -489,24 +500,22 @@ Provides: rustfmt-preview = %{version}-%{release} A tool for formatting Rust code according to style guidelines. -%package -n rls -Summary: Rust Language Server for IDE integration -%if %with bundled_libgit2 -Provides: bundled(libgit2) = %{bundled_libgit2_version} -%endif -Requires: %{name}-analysis -# /usr/bin/rls is dynamically linked against internal rustc libs -Requires: %{name}%{?_isa} = %{version}-%{release} +%package analyzer +Summary: Rust implementation of the Language Server Protocol +# The standard library sources are needed for most functionality. +Recommends: %{name}-src + +# RLS is no longer available as of Rust 1.65, but we're including the stub +# binary that implements LSP just enough to recommend rust-analyzer. +Obsoletes: rls < 1.65.0~ # The component/package was rls-preview until Rust 1.31. Obsoletes: rls-preview < 1.31.6 -Provides: rls-preview = %{version}-%{release} -%description -n rls -The Rust Language Server provides a server that runs in the background, -providing IDEs, editors, and other tools with information about Rust programs. -It supports functionality such as 'goto definition', symbol search, -reformatting, and code completion, and enables renaming and refactorings. +%description analyzer +rust-analyzer is an implementation of Language Server Protocol for the Rust +programming language. It provides features like completion and goto definition +for many code editors, including VS Code, Emacs and Vim. %package -n clippy @@ -526,28 +535,20 @@ A collection of lints to catch common mistakes and improve your Rust code. %package src Summary: Sources for the Rust standard library BuildArch: noarch +Recommends: %{name}-std-static = %{version}-%{release} %description src This package includes source files for the Rust standard library. It may be useful as a reference for code completion tools in various editors. -%package analysis -Summary: Compiler analysis data for the Rust standard library -Requires: %{name}-std-static%{?_isa} = %{version}-%{release} - -%description analysis -This package contains analysis data files produced with rustc's -Zsave-analysis -feature for the Rust standard library. The RLS (Rust Language Server) uses this -data to provide information about the Rust standard library. - - -%if 0%{?rhel} && 0%{?rhel} >= 8 +%if 0%{?rhel} %package toolset Summary: Rust Toolset -Requires: rust%{?_isa} = %{version}-%{release} -Requires: cargo%{?_isa} = %{version}-%{release} +BuildArch: noarch +Requires: rust = %{version}-%{release} +Requires: cargo = %{version}-%{release} %description toolset This is the metapackage for Rust Toolset, bringing in the Rust compiler, @@ -570,26 +571,25 @@ test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif -%if %defined wasm_targets +%if %{defined wasm_targets} && %{with bundled_wasi_libc} %setup -q -n %{wasi_libc_name} -T -b 1 +rm -rf %{wasi_libc_dir}/dlmalloc/ %endif %setup -q -n %{rustc_package} -%patch1 -p1 -%patch2 -p1 +%patch -P1 -p1 +%patch -P2 -p1 +%patch -P3 -p1 +%patch -P4 -p1 +%if %without bundled_wasi_libc +%patch -P5 -p1 +%endif +%patch -P6 -p1 +%patch -P7 -p1 %if %with disabled_libssh2 -%patch100 -p1 -%endif - -%if %without curl_http2 -%patch101 -p1 -rm -rf vendor/libnghttp2-sys/ -%endif - -%if 0%{?rhel} && 0%{?rhel} < 8 -%patch102 -p1 +%patch -P100 -p1 %endif # Use our explicit python3 first @@ -604,21 +604,21 @@ mkdir -p src/llvm-project/libunwind/ %endif # Remove other unused vendored libraries -rm -rf vendor/curl-sys/curl/ +rm -rf vendor/curl-sys*/curl/ rm -rf vendor/*jemalloc-sys*/jemalloc/ -rm -rf vendor/libmimalloc-sys/c_src/mimalloc/ -rm -rf vendor/libssh2-sys/libssh2/ -rm -rf vendor/libz-sys/src/zlib/ -rm -rf vendor/libz-sys/src/zlib-ng/ -rm -rf vendor/lzma-sys/xz-*/ -rm -rf vendor/openssl-src/openssl/ +rm -rf vendor/libffi-sys*/libffi/ +rm -rf vendor/libmimalloc-sys*/c_src/mimalloc/ +rm -rf vendor/libssh2-sys*/libssh2/ +rm -rf vendor/libz-sys*/src/zlib{,-ng}/ +rm -rf vendor/lzma-sys*/xz-*/ +rm -rf vendor/openssl-src*/openssl/ %if %without bundled_libgit2 -rm -rf vendor/libgit2-sys/libgit2/ +rm -rf vendor/libgit2-sys*/libgit2/ %endif %if %with disabled_libssh2 -rm -rf vendor/libssh2-sys/ +rm -rf vendor/libssh2-sys*/ %endif # This only affects the transient rust-installer, but let it use our dynamic xz-libs @@ -647,9 +647,28 @@ find vendor -name .cargo-checksum.json \ # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' +# The distro flags are only appropriate for the host, not our cross-targets, +# and they're not as fine-grained as the settings we choose for std vs rustc. +%if %defined build_rustflags +%global build_rustflags %{nil} +%endif + +# These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros +%global rustc_target_cpus %{lua: do + local fedora = tonumber(rpm.expand("0%{?fedora}")) + local rhel = tonumber(rpm.expand("0%{?rhel}")) + local env = + " RUSTC_TARGET_CPU_X86_64=x86-64" .. ((rhel >= 10) and "-v3" or (rhel == 9) and "-v2" or "") + .. " RUSTC_TARGET_CPU_PPC64LE=" .. ((rhel >= 9) and "pwr9" or "pwr8") + .. " RUSTC_TARGET_CPU_S390X=" .. + ((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or + (fedora >= 26) and "zEC12" or (rhel == 7) and "z196" or "z10") + print(env) +end} + # Set up shared environment variables for build/install/check -%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} -%if 0%{?cmake_path:1} +%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{rustc_target_cpus} +%if %defined cmake_path %global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH" %endif %if %without disabled_libssh2 @@ -658,20 +677,13 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %endif %global export_rust_env %{?rust_env:export %{rust_env}} - %build %{export_rust_env} -%ifarch %{arm} %{ix86} s390x riscv64 +%ifarch %{arm} %{ix86} # full debuginfo is exhausting memory; just do libstd for now # https://github.com/rust-lang/rust/issues/45854 -%if 0%{?rhel} && 0%{?rhel} < 8 -# Older rpmbuild didn't work with partial debuginfo coverage. -%global debug_package %{nil} -%define enable_debuginfo --debuginfo-level=0 -%else %define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2 -%endif %else %define enable_debuginfo --debuginfo-level=2 %endif @@ -685,39 +697,40 @@ if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then fi %if %defined mingw_targets -%{lua: do - local cfg = "" - for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do - local subs = { - triple = triple, - mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64", - } - local s = string.gsub([[ - --set target.{{triple}}.linker=%{{{mingw}}_cc} - --set target.{{triple}}.cc=%{{{mingw}}_cc} - --set target.{{triple}}.ar=%{{{mingw}}_ar} - --set target.{{triple}}.ranlib=%{{{mingw}}_ranlib} - ]], "{{(%w+)}}", subs) - cfg = cfg .. " " .. s - end - cfg = string.gsub(cfg, "%s+", " ") - rpm.define("mingw_target_config " .. cfg) -end} +%define mingw_target_config %{shrink: + --set target.i686-pc-windows-gnu.linker=%{mingw32_cc} + --set target.i686-pc-windows-gnu.cc=%{mingw32_cc} + --set target.i686-pc-windows-gnu.ar=%{mingw32_ar} + --set target.i686-pc-windows-gnu.ranlib=%{mingw32_ranlib} + --set target.i686-pc-windows-gnu.self-contained=false + --set target.x86_64-pc-windows-gnu.linker=%{mingw64_cc} + --set target.x86_64-pc-windows-gnu.cc=%{mingw64_cc} + --set target.x86_64-pc-windows-gnu.ar=%{mingw64_ar} + --set target.x86_64-pc-windows-gnu.ranlib=%{mingw64_ranlib} + --set target.x86_64-pc-windows-gnu.self-contained=false +} %endif %if %defined wasm_targets -%make_build --quiet -C %{wasi_libc_dir} CC=clang AR=llvm-ar NM=llvm-nm -%{lua: do - local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot" - local cfg = "" - for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do - if string.find(triple, "-wasi") then - cfg = cfg .. " --set target." .. triple .. ".wasi-root=" .. wasi_root - end - end - rpm.define("wasm_target_config "..cfg) -end} +%if %with bundled_wasi_libc +%make_build --quiet -C %{wasi_libc_dir} MALLOC_IMPL=emmalloc CC=clang AR=llvm-ar NM=llvm-nm +%define wasm_target_config --set target.wasm32-wasi.wasi-root=%{wasi_libc_dir}/sysroot +%else +%define wasm_target_config %{shrink: + --set target.wasm32-wasi.wasi-root=%{_prefix}/wasm32-wasi + --set target.wasm32-wasi.self-contained=false +} %endif +%endif + +# Find the compiler-rt library for the Rust profiler_builtins crate. +%if 0%{?clang_major_version} >= 17 +%define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a +%else +# The exact profiler path is version dependent.. +%define profiler %(echo %{_libdir}/clang/??/lib/libclang_rt.profile-*.a) +%endif +test -r "%{profiler}" %configure --disable-option-checking \ --libdir=%{common_libdir} \ @@ -727,6 +740,7 @@ end} --set target.%{rust_triple}.cxx=%{__cxx} \ --set target.%{rust_triple}.ar=%{__ar} \ --set target.%{rust_triple}.ranlib=%{__ranlib} \ + --set target.%{rust_triple}.profiler="%{profiler}" \ %{?mingw_target_config} \ %{?wasm_target_config} \ --python=%{__python3} \ @@ -738,34 +752,69 @@ end} --disable-llvm-static-stdcpp \ --disable-rpath \ %{enable_debuginfo} \ - --set rust.codegen-units-std=1 \ + --set rust.codegen-units=1 \ + --set rust.lto=thin \ + --set build.build-stage=2 \ + --set build.doc-stage=2 \ + --set build.install-stage=2 \ + --set build.test-stage=2 \ --enable-extended \ - --tools=analysis,cargo,clippy,rls,rustfmt,src \ + --tools=cargo,clippy,rls,rust-analyzer,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ --dist-compression-formats=gz \ --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" -%{__python3} ./x.py build -j "$ncpus" --stage 2 -%{__python3} ./x.py doc --stage 2 +%global x %{__python3} ./x.py +%global xk %{x} --keep-stage=0 --keep-stage=1 -for triple in %{?mingw_targets} %{?wasm_targets}; do - %{__python3} ./x.py build --stage 2 --target=$triple std +%if %with rustc_pgo +# Build the compiler with profile instrumentation +PROFRAW="$PWD/build/profiles" +PROFDATA="$PWD/build/rustc.profdata" +mkdir -p "$PROFRAW" +%{x} build -j "$ncpus" sysroot --rust-profile-generate="$PROFRAW" +# Build cargo as a workload to generate compiler profiles +env LLVM_PROFILE_FILE="$PROFRAW/default_%%m_%%p.profraw" %{xk} build cargo +llvm-profdata merge -o "$PROFDATA" "$PROFRAW" +rm -r "$PROFRAW" build/%{rust_triple}/stage2*/ +# Rebuild the compiler using the profile data +%{x} build -j "$ncpus" sysroot --rust-profile-use="$PROFDATA" +%else +# Build the compiler without PGO +%{x} build -j "$ncpus" sysroot +%endif + +# Build everything else normally +%{xk} build +%{xk} doc + +for triple in %{?all_targets} ; do + %{xk} build --target=$triple std done %install +%if 0%{?rhel} && 0%{?rhel} <= 9 +%{?set_build_flags} +%endif %{export_rust_env} -DESTDIR=%{buildroot} %{__python3} ./x.py install +DESTDIR=%{buildroot} %{xk} install -for triple in %{?mingw_targets} %{?wasm_targets}; do - DESTDIR=%{buildroot} %{__python3} ./x.py install --target=$triple std +for triple in %{?all_targets} ; do + DESTDIR=%{buildroot} %{xk} install --target=$triple std done +# The rls stub doesn't have an install target, but we can just copy it. +%{__install} -t %{buildroot}%{_bindir} build/%{rust_triple}/stage2-tools-bin/rls + # These are transient files used by x.py dist and install rm -rf ./build/dist/ ./build/tmp/ +# Some of the components duplicate-install binaries, leaving backups we don't want +rm -f %{buildroot}%{_bindir}/*.old + # Make sure the shared libraries are in the proper libdir %if "%{_libdir}" != "%{common_libdir}" mkdir -p %{buildroot}%{_libdir} @@ -780,15 +829,15 @@ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \ # The libdir libraries are identical to those under rustlib/. It's easier on # library loading if we keep them in libdir, but we do need them in rustlib/ # to support dynamic linking for compiler plugins, so we'll symlink. -(cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" && - find ../../../../%{_lib} -maxdepth 1 -name '*.so' | - while read lib; do - if [ -f "${lib##*/}" ]; then - # make sure they're actually identical! - cmp "$lib" "${lib##*/}" - ln -v -f -s -t . "$lib" - fi - done) +find %{buildroot}%{rustlibdir}/%{rust_triple}/lib/ -maxdepth 1 -type f -name '*.so' | +while read lib; do + lib2="%{buildroot}%{_libdir}/${lib##*/}" + if [ -f "$lib2" ]; then + # make sure they're actually identical! + cmp "$lib" "$lib2" + ln -v -f -r -s -T "$lib2" "$lib" + fi +done # Remove installer artifacts (manifests, uninstall scripts, etc.) find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+' @@ -824,50 +873,55 @@ mkdir -p %{buildroot}%{_datadir}/cargo/registry mkdir -p %{buildroot}%{_docdir}/cargo ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html -%if %without lldb -rm -f %{buildroot}%{_bindir}/rust-lldb -rm -f %{buildroot}%{rustlibdir}/etc/lldb_* -%endif - # We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp) rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* -%if 0%{?rhel} && 0%{?rhel} >= 8 +%if 0%{?rhel} # This allows users to build packages using Rust Toolset. %{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset %endif %check +%if 0%{?rhel} && 0%{?rhel} <= 9 +%{?set_build_flags} +%endif %{export_rust_env} # Sanity-check the installed binaries, debuginfo-stripped and all. %{buildroot}%{_bindir}/cargo new build/hello-world -env RUSTC=%{buildroot}%{_bindir}/rustc \ - LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ - %{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml +( + cd build/hello-world + export RUSTC=%{buildroot}%{_bindir}/rustc \ + LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" + %{buildroot}%{_bindir}/cargo run --verbose -# Try a build sanity-check for other targets -for triple in %{?mingw_targets} %{?wasm_targets}; do - env RUSTC=%{buildroot}%{_bindir}/rustc \ - LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ - %{buildroot}%{_bindir}/cargo build --manifest-path build/hello-world/Cargo.toml --target=$triple -done + # Sanity-check that code-coverage builds and runs + env RUSTFLAGS="-Cinstrument-coverage" %{buildroot}%{_bindir}/cargo run --verbose + test -r default_*.profraw + + # Try a build sanity-check for other std-enabled targets + for triple in %{?mingw_targets} %{?wasm_targets}; do + %{buildroot}%{_bindir}/cargo build --verbose --target=$triple + done +) # The results are not stable on koji, so mask errors and just log it. # Some of the larger test artifacts are manually cleaned to save space. -%{__python3} ./x.py test --no-fail-fast --stage 2 || : + +# Bootstrap is excluded because it's not something we ship, and a lot of its +# tests are geared toward the upstream CI environment. +%{xk} test --no-fail-fast --skip src/bootstrap || : rm -rf "./build/%{rust_triple}/test/" -%{__python3} ./x.py test --no-fail-fast --stage 2 cargo || : +%{xk} test --no-fail-fast cargo || : rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" -%{__python3} ./x.py test --no-fail-fast --stage 2 clippy || : +%{xk} test --no-fail-fast clippy || : -env RLS_TEST_WAIT_FOR_AGES=1 \ -%{__python3} ./x.py test --no-fail-fast --stage 2 rls || : +%{xk} test --no-fail-fast rust-analyzer || : -%{__python3} ./x.py test --no-fail-fast --stage 2 rustfmt || : +%{xk} test --no-fail-fast rustfmt || : %ldconfig_scriptlets @@ -879,6 +933,7 @@ env RLS_TEST_WAIT_FOR_AGES=1 \ %{_bindir}/rustc %{_bindir}/rustdoc %{_libdir}/*.so +%{_libexecdir}/rust-analyzer-proc-macro-srv %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* %dir %{rustlibdir} @@ -893,58 +948,46 @@ env RLS_TEST_WAIT_FOR_AGES=1 \ %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib +%global target_files() \ +%files std-static-%1 \ +%dir %{rustlibdir} \ +%dir %{rustlibdir}/%1 \ +%dir %{rustlibdir}/%1/lib \ +%{rustlibdir}/%1/lib/*.rlib -%if %defined mingw_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do - local subs = { - triple = triple, - rustlibdir = rpm.expand("%{rustlibdir}"), - } - local s = string.gsub([[ - -%files std-static-{{triple}} -%dir {{rustlibdir}} -%dir {{rustlibdir}}/{{triple}} -%dir {{rustlibdir}}/{{triple}}/lib -{{rustlibdir}}/{{triple}}/lib/*.rlib -{{rustlibdir}}/{{triple}}/lib/rs*.o -%exclude {{rustlibdir}}/{{triple}}/lib/*.dll -%exclude {{rustlibdir}}/{{triple}}/lib/*.dll.a -%exclude {{rustlibdir}}/{{triple}}/lib/self-contained - -]], "{{(%w+)}}", subs) - print(s) - end -end} +%if %target_enabled i686-pc-windows-gnu +%target_files i686-pc-windows-gnu +%{rustlibdir}/i686-pc-windows-gnu/lib/rs*.o +%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll +%exclude %{rustlibdir}/i686-pc-windows-gnu/lib/*.dll.a %endif - -%if %defined wasm_targets -%{lua: do - for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do - local subs = { - triple = triple, - rustlibdir = rpm.expand("%{rustlibdir}"), - wasi = string.find(triple, "-wasi") and 1 or 0, - } - local s = string.gsub([[ - -%files std-static-{{triple}} -%dir {{rustlibdir}} -%dir {{rustlibdir}}/{{triple}} -%dir {{rustlibdir}}/{{triple}}/lib -{{rustlibdir}}/{{triple}}/lib/*.rlib -%if {{wasi}} -%dir {{rustlibdir}}/{{triple}}/lib/self-contained -{{rustlibdir}}/{{triple}}/lib/self-contained/crt*.o -{{rustlibdir}}/{{triple}}/lib/self-contained/libc.a +%if %target_enabled x86_64-pc-windows-gnu +%target_files x86_64-pc-windows-gnu +%{rustlibdir}/x86_64-pc-windows-gnu/lib/rs*.o +%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll +%exclude %{rustlibdir}/x86_64-pc-windows-gnu/lib/*.dll.a %endif -]], "{{(%w+)}}", subs) - print(s) - end -end} +%if %target_enabled wasm32-unknown-unknown +%target_files wasm32-unknown-unknown +%endif + +%if %target_enabled wasm32-wasi +%target_files wasm32-wasi +%if %with bundled_wasi_libc +%dir %{rustlibdir}/wasm32-wasi/lib/self-contained +%{rustlibdir}/wasm32-wasi/lib/self-contained/crt*.o +%{rustlibdir}/wasm32-wasi/lib/self-contained/libc.a +%endif +%endif + +%if %target_enabled x86_64-unknown-none +%target_files x86_64-unknown-none +%endif + +%if %target_enabled x86_64-unknown-uefi +%target_files x86_64-unknown-uefi %endif @@ -960,33 +1003,25 @@ end} %exclude %{_bindir}/rust-gdbgui -%if %with lldb %files lldb %{_bindir}/rust-lldb %{rustlibdir}/etc/lldb_* -%endif %files doc %docdir %{_docdir}/%{name} %dir %{_docdir}/%{name} -%dir %{_docdir}/%{name}/html -%{_docdir}/%{name}/html/*/ -%{_docdir}/%{name}/html/*.html -%{_docdir}/%{name}/html/*.css -%{_docdir}/%{name}/html/*.js -%{_docdir}/%{name}/html/*.png -%{_docdir}/%{name}/html/*.svg -%{_docdir}/%{name}/html/*.woff2 -%license %{_docdir}/%{name}/html/*.txt -%license %{_docdir}/%{name}/html/*.md +%{_docdir}/%{name}/html +# former cargo-doc +%docdir %{_docdir}/cargo +%dir %{_docdir}/cargo +%{_docdir}/cargo/html %files -n cargo -%license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY +%license src/tools/cargo/LICENSE-{APACHE,MIT,THIRD-PARTY} %doc src/tools/cargo/README.md %{_bindir}/cargo -%{_libexecdir}/cargo* %{_mandir}/man1/cargo*.1* %{_sysconfdir}/bash_completion.d/cargo %{_datadir}/zsh/site-functions/_cargo @@ -994,12 +1029,6 @@ end} %dir %{_datadir}/cargo/registry -%files -n cargo-doc -%docdir %{_docdir}/cargo -%dir %{_docdir}/cargo -%{_docdir}/cargo/html - - %files -n rustfmt %{_bindir}/rustfmt %{_bindir}/cargo-fmt @@ -1007,10 +1036,11 @@ end} %license src/tools/rustfmt/LICENSE-{APACHE,MIT} -%files -n rls +%files analyzer %{_bindir}/rls -%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md} -%license src/tools/rls/LICENSE-{APACHE,MIT} +%{_bindir}/rust-analyzer +%doc src/tools/rust-analyzer/README.md +%license src/tools/rust-analyzer/LICENSE-{APACHE,MIT} %files -n clippy @@ -1025,22 +1055,112 @@ end} %{rustlibdir}/src -%files analysis -%{rustlibdir}/%{rust_triple}/analysis/ - - -%if 0%{?rhel} && 0%{?rhel} >= 8 +%if 0%{?rhel} %files toolset %{rpmmacrodir}/macros.rust-toolset %endif %changelog -* Mon Sep 05 2022 David Abdurachmanov - 1.63.0-1.1.riscv64 -- Disable bootstrap on riscv64 +* Thu Oct 26 2023 Josh Stone - 1.73.0-2 +- Use thin-LTO and PGO for rustc itself. -* Fri Sep 02 2022 David Abdurachmanov - 1.63.0-1.0.riscv64 -- Bootstrap riscv64 +* Thu Oct 05 2023 Josh Stone - 1.73.0-1 +- Update to 1.73.0. +- Drop el7 conditionals from the spec. + +* Fri Sep 29 2023 Josh Stone - 1.72.1-3 +- Fix the profiler runtime with compiler-rt-17 +- Switch to unbundled wasi-libc on Fedora +- Use emmalloc instead of CC0 dlmalloc when bundling wasi-libc + +* Mon Sep 25 2023 Josh Stone - 1.72.1-2 +- Fix LLVM dependency for ELN +- Add build target for x86_64-unknown-none +- Add build target for x86_64-unknown-uefi + +* Tue Sep 19 2023 Josh Stone - 1.72.1-1 +- Update to 1.72.1. +- Migrated to SPDX license + +* Thu Aug 24 2023 Josh Stone - 1.72.0-1 +- Update to 1.72.0. + +* Mon Aug 07 2023 Josh Stone - 1.71.1-1 +- Update to 1.71.1. +- Security fix for CVE-2023-38497 + +* Tue Jul 25 2023 Josh Stone - 1.71.0-3 +- Relax the suspicious_double_ref_op lint +- Enable the profiler runtime for native hosts + +* Fri Jul 21 2023 Fedora Release Engineering - 1.71.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jul 17 2023 Josh Stone - 1.71.0-1 +- Update to 1.71.0. + +* Fri Jun 23 2023 Josh Stone - 1.70.0-2 +- Override default target CPUs to match distro settings + +* Thu Jun 01 2023 Josh Stone - 1.70.0-1 +- Update to 1.70.0. + +* Fri May 05 2023 Josh Stone - 1.69.0-3 +- Fix debuginfo with LLVM 16 + +* Mon May 01 2023 Josh Stone - 1.69.0-2 +- Build with LLVM 15 on Fedora 38+ + +* Thu Apr 20 2023 Josh Stone - 1.69.0-1 +- Update to 1.69.0. +- Obsolete rust-analysis. + +* Tue Mar 28 2023 Josh Stone - 1.68.2-1 +- Update to 1.68.2. + +* Thu Mar 23 2023 Josh Stone - 1.68.1-1 +- Update to 1.68.1. + +* Thu Mar 09 2023 Josh Stone - 1.68.0-1 +- Update to 1.68.0. + +* Tue Mar 07 2023 David Michael - 1.67.1-3 +- Add a virtual Provides to rust-std-static containing the target triple. + +* Mon Feb 20 2023 Orion Poplawski - 1.67.1-2 +- Ship rust-toolset for EPEL7 + +* Thu Feb 09 2023 Josh Stone - 1.67.1-1 +- Update to 1.67.1. + +* Fri Feb 03 2023 Josh Stone - 1.67.0-3 +- Unbundle libgit2 on Fedora 38. + +* Fri Jan 27 2023 Adam Williamson - 1.67.0-2 +- Backport PR #107360 to fix build of mesa +- Backport 675fa0b3 to fix bootstrapping failure + +* Thu Jan 26 2023 Josh Stone - 1.67.0-1 +- Update to 1.67.0. + +* Fri Jan 20 2023 Fedora Release Engineering - 1.66.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Jan 10 2023 Josh Stone - 1.66.1-1 +- Update to 1.66.1. +- Security fix for CVE-2022-46176 + +* Thu Dec 15 2022 Josh Stone - 1.66.0-1 +- Update to 1.66.0. + +* Thu Nov 03 2022 Josh Stone - 1.65.0-1 +- Update to 1.65.0. +- rust-analyzer now obsoletes rls. + +* Thu Sep 22 2022 Josh Stone - 1.64.0-1 +- Update to 1.64.0. +- Add rust-analyzer. * Thu Aug 11 2022 Josh Stone - 1.63.0-1 - Update to 1.63.0. diff --git a/rustc-1.58.0-no-default-pie.patch b/rustc-1.58.0-no-default-pie.patch deleted file mode 100644 index 67fb0c6..0000000 --- a/rustc-1.58.0-no-default-pie.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index 638b2a7b5a9f..79d4ecf4cb91 100644 ---- a/compiler/rustc_codegen_ssa/src/back/link.rs -+++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -763,7 +763,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( - && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie") - { - info!("linker output: {:?}", out); -- warn!("Linker does not support -no-pie command line option. Retrying without."); -+ info!("Linker does not support -no-pie command line option. Retrying without."); - for arg in cmd.take_args() { - if arg.to_string_lossy() != "-no-pie" { - cmd.arg(arg); -@@ -782,7 +782,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( - && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie") - { - info!("linker output: {:?}", out); -- warn!( -+ info!( - "Linker does not support -static-pie command line option. Retrying with -static instead." - ); - // Mirror `add_(pre,post)_link_objects` to replace CRT objects. -@@ -1507,15 +1507,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - } - - fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { -- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { -+ // Only use PIE if explicitly specified. -+ let explicit_pic = -+ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); -+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { - (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, -- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => { -- LinkOutputKind::DynamicPicExe -- } -+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, - (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, -- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => { -- LinkOutputKind::StaticPicExe -- } -+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, - (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, - (_, true, _) => LinkOutputKind::StaticDylib, - (_, false, _) => LinkOutputKind::DynamicDylib, diff --git a/rustc-1.59.0-disable-libssh2.patch b/rustc-1.59.0-disable-libssh2.patch deleted file mode 100644 index 4afd67c..0000000 --- a/rustc-1.59.0-disable-libssh2.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- rustc-1.59.0-src/Cargo.lock.orig 2022-02-21 18:48:37.000000000 -0800 -+++ rustc-1.59.0-src/Cargo.lock 2022-02-22 10:16:10.381962862 -0800 -@@ -1935,7 +1935,6 @@ - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -1968,20 +1967,6 @@ - ] - - [[package]] --name = "libssh2-sys" --version = "0.2.23" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" --dependencies = [ -- "cc", -- "libc", -- "libz-sys", -- "openssl-sys", -- "pkg-config", -- "vcpkg", --] -- --[[package]] - name = "libz-sys" - version = "1.1.3" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.59.0-src/vendor/git2/Cargo.toml.orig 2022-02-21 20:14:37.000000000 -0800 -+++ rustc-1.59.0-src/vendor/git2/Cargo.toml 2022-02-22 10:12:23.021772490 -0800 -@@ -51,7 +51,7 @@ - version = "0.1.39" - - [features] --default = ["ssh", "https", "ssh_key_from_memory"] -+default = ["https"] - https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] - ssh = ["libgit2-sys/ssh"] - ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] diff --git a/rustc-1.61.0-rust-gdb-substitute-path.patch b/rustc-1.61.0-rust-gdb-substitute-path.patch deleted file mode 100644 index b94e23e..0000000 --- a/rustc-1.61.0-rust-gdb-substitute-path.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- rustc-1.61.0-src/src/etc/rust-gdb.orig 2022-05-17 18:29:36.000000000 -0700 -+++ rustc-1.61.0-src/src/etc/rust-gdb 2022-05-18 11:18:13.732709661 -0700 -@@ -14,6 +14,9 @@ fi - RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" - GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" - -+RUST_STD_BUILD="@BUILDDIR@/library/" -+RUST_STD_SRC="$RUSTC_SYSROOT/lib/rustlib/src/rust/library/" -+ - # Run GDB with the additional arguments that load the pretty printers - # Set the environment variable `RUST_GDB` to overwrite the call to a - # different/specific command (defaults to `gdb`). -@@ -21,4 +24,5 @@ RUST_GDB="${RUST_GDB:-gdb}" - PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \ - --directory="$GDB_PYTHON_MODULE_DIRECTORY" \ - -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \ -+ -iex "set substitute-path $RUST_STD_BUILD $RUST_STD_SRC" \ - "$@" diff --git a/rustc-1.63.0-disable-http2.patch b/rustc-1.63.0-disable-http2.patch deleted file mode 100644 index 2e0c8f2..0000000 --- a/rustc-1.63.0-disable-http2.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- rustc-1.63.0-src/Cargo.lock.orig 2022-08-10 12:25:16.512185135 -0700 -+++ rustc-1.63.0-src/Cargo.lock 2022-08-10 12:25:16.513185114 -0700 -@@ -1054,7 +1054,6 @@ - dependencies = [ - "cc", - "libc", -- "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -2160,16 +2159,6 @@ - checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - - [[package]] --name = "libnghttp2-sys" --version = "0.1.4+1.41.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" --dependencies = [ -- "cc", -- "libc", --] -- --[[package]] - name = "libz-sys" - version = "1.1.3" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.63.0-src/src/tools/cargo/Cargo.toml.orig 2022-08-10 12:25:16.514185093 -0700 -+++ rustc-1.63.0-src/src/tools/cargo/Cargo.toml 2022-08-10 12:25:51.441455282 -0700 -@@ -22,7 +22,7 @@ - cargo-util = { path = "crates/cargo-util", version = "0.2.1" } - crates-io = { path = "crates/crates-io", version = "0.34.0" } - crossbeam-utils = "0.8" --curl = { version = "0.4.43", features = ["http2"] } -+curl = { version = "0.4.43", features = [] } - curl-sys = "0.4.55" - env_logger = "0.9.0" - pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-08-08 15:47:35.000000000 -0700 -+++ rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-08-10 12:25:16.514185093 -0700 -@@ -192,16 +192,8 @@ - } - self.fetch_started = true; - -- // We've enabled the `http2` feature of `curl` in Cargo, so treat -- // failures here as fatal as it would indicate a build-time problem. -- self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true); -- -- self.multi -- .pipelining(false, self.multiplexing) -- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; -- -- // let's not flood the server with connections -- self.multi.set_max_host_connections(2)?; -+ // Multiplexing is disabled because the system libcurl doesn't support it. -+ self.multiplexing = false; - - self.config - .shell() ---- rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-08-08 15:47:35.000000000 -0700 -+++ rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-08-10 12:25:16.514185093 -0700 -@@ -403,16 +403,9 @@ - sources: SourceMap<'cfg>, - config: &'cfg Config, - ) -> CargoResult> { -- // We've enabled the `http2` feature of `curl` in Cargo, so treat -- // failures here as fatal as it would indicate a build-time problem. -- let mut multi = Multi::new(); -- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); -- multi -- .pipelining(false, multiplexing) -- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; -- -- // let's not flood crates.io with connections -- multi.set_max_host_connections(2)?; -+ // Multiplexing is disabled because the system libcurl doesn't support it. -+ let multi = Multi::new(); -+ let multiplexing = false; - - Ok(PackageSet { - packages: package_ids -@@ -658,7 +651,7 @@ - macro_rules! try_old_curl { - ($e:expr, $msg:expr) => { - let result = $e; -- if cfg!(target_os = "macos") { -+ if cfg!(any(target_os = "linux", target_os = "macos")) { - if let Err(e) = result { - warn!("ignoring libcurl {} error: {}", $msg, e); - } diff --git a/rustc-1.70.0-rust-gdb-substitute-path.patch b/rustc-1.70.0-rust-gdb-substitute-path.patch new file mode 100644 index 0000000..e9e5e2e --- /dev/null +++ b/rustc-1.70.0-rust-gdb-substitute-path.patch @@ -0,0 +1,21 @@ +diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb +index 9abed30ea6f7..e4bf55df3688 100755 +--- a/src/etc/rust-gdb ++++ b/src/etc/rust-gdb +@@ -13,8 +13,6 @@ fi + # Find out where the pretty printer Python module is + RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" + GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" +-# Get the commit hash for path remapping +-RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')" + + # Run GDB with the additional arguments that load the pretty printers + # Set the environment variable `RUST_GDB` to overwrite the call to a +@@ -23,6 +21,6 @@ RUST_GDB="${RUST_GDB:-gdb}" + PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \ + --directory="$GDB_PYTHON_MODULE_DIRECTORY" \ + -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \ +- -iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \ ++ -iex "set substitute-path @BUILDDIR@ $RUSTC_SYSROOT/lib/rustlib/src/rust" \ + "$@" + diff --git a/rustc-1.73.0-disable-libssh2.patch b/rustc-1.73.0-disable-libssh2.patch new file mode 100644 index 0000000..96b5f4f --- /dev/null +++ b/rustc-1.73.0-disable-libssh2.patch @@ -0,0 +1,42 @@ +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-09-01 10:51:15.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-09-05 16:59:08.837345133 -0700 +@@ -1973,7 +1973,6 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -2006,20 +2005,6 @@ + ] + + [[package]] +-name = "libssh2-sys" +-version = "0.3.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +-dependencies = [ +- "cc", +- "libc", +- "libz-sys", +- "openssl-sys", +- "pkg-config", +- "vcpkg", +-] +- +-[[package]] + name = "libz-sys" + version = "1.1.9" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-09-05 16:59:08.837345133 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-09-05 17:00:00.828461993 -0700 +@@ -37,7 +37,7 @@ + filetime = "0.2.21" + flate2 = { version = "1.0.26", default-features = false, features = ["zlib"] } + fwdansi = "1.1.0" +-git2 = "0.17.2" ++git2 = { version = "0.17.2", default-features = false, features = ["https"] } + git2-curl = "0.18.0" + gix = { version = "0.45.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] } + gix-features-for-configuration-only = { version = "0.30.0", package = "gix-features", features = [ "parallel" ] } diff --git a/sources b/sources index 88d8af1..1626147 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.63.0-src.tar.xz) = 0dd3cd1546bd9c1438afe0c4694e1ed80507f6b437674682c0474e13f83457e9ced4560ddeee58602e01837140f9e34a9e24c6828643dd6f613e07755af6997c -SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132 +SHA512 (rustc-1.73.0-src.tar.xz) = 75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c +SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066 diff --git a/tests/Sanity/rpmbuild-librsvg2/runtest.sh b/tests/Sanity/rpmbuild-librsvg2/runtest.sh index 8965c9e..470ecb5 100755 --- a/tests/Sanity/rpmbuild-librsvg2/runtest.sh +++ b/tests/Sanity/rpmbuild-librsvg2/runtest.sh @@ -48,7 +48,10 @@ rlJournalStart rlRun "rpm -ivh $SRPM" rlRun SPECDIR="$(rpm -E '%{_specdir}')" - rlRun "yum-builddep -y ${SPECDIR}/${PKG_TO_BUILD}.spec ${YUM_SWITCHES}" + # librsvg2 contains dynamic dependencies. builddep needs to be run + # from the srpm (not the spec file) to be able to generate them: + # https://fedoraproject.org/wiki/Changes/DynamicBuildRequires#rpmbuild + rlRun "yum-builddep -y ${SRPM} ${YUM_SWITCHES}" rlPhaseEnd rlPhaseStartTest