diff --git a/.gitignore b/.gitignore index 771739a..999f79e 100644 --- a/.gitignore +++ b/.gitignore @@ -449,3 +449,6 @@ /wasi-libc-wasi-sdk-25.tar.gz /rustc-1.84.1-src.tar.xz /rustc-1.85.0-src.tar.xz +/rustc-1.85.1-src.tar.xz +/rustc-1.86.0-src.tar.xz +/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz diff --git a/0001-Only-translate-profile-flags-for-Clang.patch b/0001-Only-translate-profile-flags-for-Clang.patch deleted file mode 100644 index 3353c10..0000000 --- a/0001-Only-translate-profile-flags-for-Clang.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e4e678eb9cbd90acf2ba51e9ec0209b05c4403b5 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 9 Jan 2025 16:47:10 -0800 -Subject: [PATCH] Only translate profile flags for Clang - ---- - src/flags.rs | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/src/flags.rs b/src/flags.rs -index 81834cf625f7..1a53c1b2345c 100644 ---- a/src/flags.rs -+++ b/src/flags.rs -@@ -201,13 +201,15 @@ impl<'this> RustcCodegenFlags<'this> { - if self.no_vectorize_slp { - push_if_supported("-fno-slp-vectorize".into()); - } -- // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate -- if let Some(value) = self.profile_generate { -- push_if_supported(format!("-fprofile-generate={value}").into()); -- } -- // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use -- if let Some(value) = self.profile_use { -- push_if_supported(format!("-fprofile-use={value}").into()); -+ if let ToolFamily::Clang { .. } = family { -+ // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-generate -+ if let Some(value) = self.profile_generate { -+ push_if_supported(format!("-fprofile-generate={value}").into()); -+ } -+ // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-use -+ if let Some(value) = self.profile_use { -+ push_if_supported(format!("-fprofile-use={value}").into()); -+ } - } - // https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mguard - if let Some(value) = self.control_flow_guard { --- -2.47.1 - diff --git a/0001-Use-lld-provided-by-system.patch b/0001-Use-lld-provided-by-system.patch index 063d66a..63c9b14 100644 --- a/0001-Use-lld-provided-by-system.patch +++ b/0001-Use-lld-provided-by-system.patch @@ -1,4 +1,4 @@ -From 3d8c6d095581e8d7585f3772cfd16f6367f3c008 Mon Sep 17 00:00:00 2001 +From 687112c89c9058ef1e79f1c3a974940b1ae43ea3 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 16 Aug 2024 10:12:58 -0700 Subject: [PATCH] Use lld provided by system @@ -12,7 +12,7 @@ Subject: [PATCH] Use lld provided by system 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs -index f237391016e7..08bcd9699b4a 100644 +index 81b96cd39ffa..4c9916af826b 100644 --- a/compiler/rustc_target/src/spec/base/wasm.rs +++ b/compiler/rustc_target/src/spec/base/wasm.rs @@ -85,8 +85,7 @@ macro_rules! args { @@ -26,10 +26,10 @@ index f237391016e7..08bcd9699b4a 100644 pre_link_args, diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs -index 222d5651b521..4b780bc8a8e7 100644 +index 3b719ebaf07e..8b4fecee68f0 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs -@@ -14,7 +14,7 @@ pub fn target() -> Target { +@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target { let opts = TargetOptions { abi: "softfloat".into(), linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), @@ -39,10 +39,10 @@ index 222d5651b521..4b780bc8a8e7 100644 relocation_model: RelocModel::Static, disable_redzone: true, diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs -index 429303170b6b..19d4ec53f6d8 100644 +index 9656024ddaa1..2099fa17229f 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs -@@ -9,6 +9,7 @@ pub fn target() -> Target { +@@ -9,6 +9,7 @@ pub(crate) fn target() -> Target { base.max_atomic_width = Some(128); base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]); base.features = "+v8a".into(); @@ -51,23 +51,23 @@ index 429303170b6b..19d4ec53f6d8 100644 Target { llvm_target: "aarch64-unknown-windows".into(), diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs -index 549706998d46..b7e9158ddef5 100644 +index e14a36735894..b493d7d98b46 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs -@@ -17,7 +17,7 @@ pub fn target() -> Target { +@@ -19,7 +19,7 @@ pub(crate) 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()), + rustc_abi: Some(RustcAbi::X86Softfloat), features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(), supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, - disable_redzone: true, diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs -index 6da1fcca58c8..c84ae44576d4 100644 +index bce6aa0ebc6b..7fa1148a1de7 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs -@@ -16,6 +16,7 @@ pub fn target() -> Target { +@@ -14,6 +14,7 @@ pub(crate) fn target() -> Target { base.plt_by_default = false; base.max_atomic_width = Some(64); base.entry_abi = Conv::X86_64Win64; @@ -76,5 +76,5 @@ index 6da1fcca58c8..c84ae44576d4 100644 // 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 -- -2.46.0 +2.48.1 diff --git a/0001-bootstrap-allow-disabling-target-self-contained.patch b/0001-bootstrap-allow-disabling-target-self-contained.patch index bd6d0ed..9ee7b78 100644 --- a/0001-bootstrap-allow-disabling-target-self-contained.patch +++ b/0001-bootstrap-allow-disabling-target-self-contained.patch @@ -1,4 +1,4 @@ -From eeb171e5de6da8790d01135754cbb9b6c248c476 Mon Sep 17 00:00:00 2001 +From c3307f4e1826cabd8e7e4a54636b0e79afb97835 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 @@ -11,12 +11,12 @@ Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained 4 files changed, 22 insertions(+) diff --git a/config.example.toml b/config.example.toml -index 5ea6774ce035..ec08a319e77f 100644 +index f5395375afe4..a96368ae4ef2 100644 --- a/config.example.toml +++ b/config.example.toml -@@ -922,6 +922,11 @@ - # argument as the test binary. - #runner = (string) +@@ -927,6 +927,11 @@ + # order to run `x check`. + #optimized-compiler-builtins = build.optimized-compiler-builtins (bool) +# Copy libc and CRT objects into the target lib/self-contained/ directory. +# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other @@ -27,10 +27,10 @@ index 5ea6774ce035..ec08a319e77f 100644 # Distribution options # diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index ca337aa9f4c3..6175f93e50ed 100644 +index 479327d63695..97d2bf2df8bb 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -325,6 +325,10 @@ fn copy_self_contained_objects( +@@ -327,6 +327,10 @@ fn copy_self_contained_objects( compiler: &Compiler, target: TargetSelection, ) -> Vec<(PathBuf, DependencyType)> { @@ -42,18 +42,18 @@ index ca337aa9f4c3..6175f93e50ed 100644 builder.sysroot_target_libdir(*compiler, target).join("self-contained"); t!(fs::create_dir_all(&libdir_self_contained)); diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs -index dd2f11ad4690..e10ed666099c 100644 +index 65f286a05bd5..dc4d6f741bcf 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs -@@ -634,6 +634,7 @@ pub struct Target { - pub runner: Option, +@@ -643,6 +643,7 @@ pub struct Target { pub no_std: bool, pub codegen_backends: Option>, + pub optimized_compiler_builtins: Option, + pub self_contained: bool, } impl Target { -@@ -645,6 +646,9 @@ pub fn from_triple(triple: &str) -> Self { +@@ -654,6 +655,9 @@ pub fn from_triple(triple: &str) -> Self { if triple.contains("emscripten") { target.runner = Some("node".into()); } @@ -63,15 +63,15 @@ index dd2f11ad4690..e10ed666099c 100644 target } } -@@ -1219,6 +1223,7 @@ struct TomlTarget { - no_std: Option = "no-std", +@@ -1234,6 +1238,7 @@ struct TomlTarget { codegen_backends: Option> = "codegen-backends", runner: Option = "runner", + optimized_compiler_builtins: Option = "optimized-compiler-builtins", + self_contained: Option = "self-contained", } } -@@ -2082,6 +2087,9 @@ fn get_table(option: &str) -> Result { +@@ -2146,6 +2151,9 @@ fn get_table(option: &str) -> Result { if let Some(s) = cfg.no_std { target.no_std = s; } @@ -82,10 +82,10 @@ index dd2f11ad4690..e10ed666099c 100644 target.cxx = cfg.cxx.map(PathBuf::from); target.ar = cfg.ar.map(PathBuf::from); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index 8405c22aff08..7e1582207b8a 100644 +index 21b02a3b541a..6b98c67457e8 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs -@@ -1327,6 +1327,11 @@ fn no_std(&self, target: TargetSelection) -> Option { +@@ -1366,6 +1366,11 @@ fn no_std(&self, target: TargetSelection) -> Option { self.config.target_config.get(&target).map(|t| t.no_std) } @@ -98,5 +98,5 @@ index 8405c22aff08..7e1582207b8a 100644 /// and `remote-test-server` binaries. fn remote_tested(&self, target: TargetSelection) -> bool { -- -2.47.1 +2.48.1 diff --git a/0002-set-an-external-library-path-for-wasm32-wasi.patch b/0002-set-an-external-library-path-for-wasm32-wasi.patch index 3534abb..2441d07 100644 --- a/0002-set-an-external-library-path-for-wasm32-wasi.patch +++ b/0002-set-an-external-library-path-for-wasm32-wasi.patch @@ -1,4 +1,4 @@ -From e8e50258df70b39d2425dacf90c3d5f6d0720bc0 Mon Sep 17 00:00:00 2001 +From 9551ffded09131ac225261ab55a7b3c9d09ad3bb 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 @@ -11,10 +11,10 @@ Subject: [PATCH 2/2] set an external library path for wasm32-wasi 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index e2081ad75633..a308bae8b644 100644 +index 105a4cb81f0d..21bd626842c7 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1639,6 +1639,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat +@@ -1686,6 +1686,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat return file_path; } } @@ -27,7 +27,7 @@ index e2081ad75633..a308bae8b644 100644 for search_path in sess.target_filesearch().search_paths(PathKind::Native) { let file_path = search_path.dir.join(name); if file_path.exists() { -@@ -2139,6 +2145,10 @@ fn add_library_search_dirs( +@@ -2186,6 +2192,10 @@ fn add_library_search_dirs( ControlFlow::<()>::Continue(()) }, ); @@ -39,10 +39,10 @@ index e2081ad75633..a308bae8b644 100644 /// Add options making relocation sections in the produced ELF files read-only diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs -index 9cdc0801b1f0..70fe8396b353 100644 +index f703132e51f0..c4821be7d12e 100644 --- a/compiler/rustc_target/src/spec/json.rs +++ b/compiler/rustc_target/src/spec/json.rs -@@ -527,6 +527,7 @@ macro_rules! key { +@@ -540,6 +540,7 @@ macro_rules! key { key!(linker_is_gnu_json = "linker-is-gnu", bool); key!(pre_link_objects = "pre-link-objects", link_objects); key!(post_link_objects = "post-link-objects", link_objects); @@ -50,7 +50,7 @@ index 9cdc0801b1f0..70fe8396b353 100644 key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects); key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects); // Deserializes the backwards-compatible variants of `-Clink-self-contained` -@@ -708,6 +709,7 @@ macro_rules! target_option_val { +@@ -723,6 +724,7 @@ macro_rules! target_option_val { target_option_val!(linker_is_gnu_json, "linker-is-gnu"); target_option_val!(pre_link_objects); target_option_val!(post_link_objects); @@ -59,10 +59,10 @@ index 9cdc0801b1f0..70fe8396b353 100644 target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback"); target_option_val!(link_args - pre_link_args_json, "pre-link-args"); diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 02962d55a60e..169f5a74bbfd 100644 +index 794d6457cb78..b2d88a14bb57 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -2197,6 +2197,7 @@ pub struct TargetOptions { +@@ -2237,6 +2237,7 @@ pub struct TargetOptions { /// Objects to link before and after all other object code. pub pre_link_objects: CrtObjects, pub post_link_objects: CrtObjects, @@ -70,7 +70,7 @@ index 02962d55a60e..169f5a74bbfd 100644 /// 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, -@@ -2712,6 +2713,7 @@ fn default() -> TargetOptions { +@@ -2754,6 +2755,7 @@ fn default() -> TargetOptions { relro_level: RelroLevel::None, pre_link_objects: Default::default(), post_link_objects: Default::default(), @@ -99,5 +99,5 @@ index 0862958d05da..b1e736d68627 100644 // 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.47.1 +2.48.1 diff --git a/rust.spec b/rust.spec index e05a912..6581a02 100644 --- a/rust.spec +++ b/rust.spec @@ -1,5 +1,5 @@ Name: rust -Version: 1.85.0 +Version: 1.86.0 Release: %autorelease Summary: The Rust Programming Language License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0) @@ -14,9 +14,9 @@ ExclusiveArch: %{rust_arches} # 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.84.0 -%global bootstrap_channel 1.84.0 -%global bootstrap_date 2025-01-09 +%global bootstrap_version 1.85.0 +%global bootstrap_channel 1.85.0 +%global bootstrap_date 2025-02-20 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -28,7 +28,8 @@ ExclusiveArch: %{rust_arches} # 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 %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -%global wasi_libc_ref wasi-sdk-25 +#global wasi_libc_ref wasi-sdk-25 +%global wasi_libc_ref 640c0cfc19a96b099e0791824be5ef0105ce2084 %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} @@ -45,15 +46,15 @@ ExclusiveArch: %{rust_arches} # is insufficient. Rust currently requires LLVM 18.0+. %global min_llvm_version 18.0.0 %global bundled_llvm_version 19.1.7 -#global llvm_compat_version 18 +#global llvm_compat_version 19 %global llvm llvm%{?llvm_compat_version} %bcond_with bundled_llvm -# Requires stable libgit2 1.8, and not the next minor soname change. +# Requires stable libgit2 1.9, and not the next minor soname change. # This needs to be consistent with the bindings in vendor/libgit2-sys. -%global min_libgit2_version 1.8.1 -%global next_libgit2_version 1.9.0~ -%global bundled_libgit2_version 1.8.1 +%global min_libgit2_version 1.9.0 +%global next_libgit2_version 1.10.0~ +%global bundled_libgit2_version 1.9.0 %if 0%{?fedora} >= 41 %bcond_with bundled_libgit2 %else @@ -71,7 +72,7 @@ ExclusiveArch: %{rust_arches} # Cargo uses UPSERTs with omitted conflict targets %global min_sqlite3_version 3.35 -%global bundled_sqlite3_version 3.46.0 +%global bundled_sqlite3_version 3.48.0 %if 0%{?rhel} && 0%{?rhel} < 10 %bcond_without bundled_sqlite3 %else @@ -137,10 +138,7 @@ Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch # We don't want to use the bundled library in libsqlite3-sys -Patch6: rustc-1.85.0-unbundle-sqlite.patch - -# https://github.com/rust-lang/cc-rs/issues/1354 -Patch7: 0001-Only-translate-profile-flags-for-Clang.patch +Patch6: rustc-1.86.0-unbundle-sqlite.patch ### RHEL-specific patches below ### @@ -151,7 +149,7 @@ Source102: cargo_vendor.attr Source103: cargo_vendor.prov # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.85.0-disable-libssh2.patch +Patch100: rustc-1.86.0-disable-libssh2.patch # Get the Rust triple for any architecture and ABI. %{lua: function rust_triple(arch, abi) @@ -283,6 +281,7 @@ Provides: bundled(llvm) = %{bundled_llvm_version} BuildRequires: cmake >= 3.5.1 %if %defined llvm_compat_version %global llvm_root %{_libdir}/%{llvm} +%global llvm_path %{llvm_root}/bin %else %global llvm_root %{_prefix} %endif @@ -340,12 +339,6 @@ Requires: /usr/bin/cc %global __brp_strip_static_archive %{nil} %global __brp_strip_lto %{nil} -%if %{without bundled_llvm} -%if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} -%global llvm_has_filecheck 1 -%endif -%endif - # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. %global common_libdir %{_prefix}/lib @@ -364,11 +357,11 @@ BuildRequires: mingw64-winpthreads-static %if %defined wasm_targets %if %with bundled_wasi_libc -BuildRequires: clang +BuildRequires: clang%{?llvm_compat_version} %else BuildRequires: wasi-libc-static %endif -BuildRequires: lld +BuildRequires: lld%{?llvm_compat_version} %endif # For profiler_builtins @@ -378,6 +371,29 @@ BuildRequires: compiler-rt%{?llvm_compat_version} # https://github.com/rust-lang/rust/pull/101841 Obsoletes: %{name}-analysis < 1.69.0~ +# Experimenting with a fine-grained version of %%cargo_vendor_manifest, +# so we can have different bundled provides for each tool subpackage. +%define cargo_tree_manifest(n:m:f:t:) ( \ + %{!-n:%{error:must specify a tool name}} \ + set -euo pipefail \ + mkdir -p build/manifests/%{-n*} \ + %{shrink: \ + env RUSTC_BOOTSTRAP=1 \ + %{local_rust_root}/bin/cargo tree \ + --offline --edges normal,build \ + --prefix none --format "{p}" \ + %{-m:--manifest-path %{-m*}/Cargo.toml} \ + %{-f:--features %{-f*}} \ + %{-t:--target %{-t*}} \ + %* \ + | sed '/([*/]/d; s/ (proc-macro)$//' \ + | sort -u \ + >build/manifests/%{-n*}/cargo-vendor.txt \ + } \ +) +%{?fedora:BuildRequires: cargo-rpm-macros} +%{?rhel:BuildRequires: rust-toolset} + %description Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. @@ -532,8 +548,9 @@ Provides: bundled(sqlite) = %{bundled_sqlite3_version} %endif # For tests: BuildRequires: git-core -# Cargo is not much use without Rust -Requires: %{name} +# Cargo is not much use without Rust, and it's worth keeping the versions +# in sync since some feature development depends on them together. +Requires: %{name} = %{version}-%{release} # "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and # Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too @@ -665,7 +682,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/ %if %without bundled_sqlite3 %patch -P6 -p1 %endif -%patch -P7 -p1 -d vendor/cc-1.2.6 %if %with disabled_libssh2 %patch -P100 -p1 @@ -685,7 +701,7 @@ mkdir -p src/llvm-project/libunwind/ # Remove submodules we don't need. rm -rf src/gcc rm -rf src/tools/enzyme -rm -rf src/tools/rustc-perf +rm -rf src/tools/rustc-perf/collector/*-benchmarks/ # Remove other unused vendored libraries. This leaves the directory in place, # because some build scripts watch them, e.g. "cargo:rerun-if-changed=curl". @@ -763,6 +779,7 @@ end} %{!?with_bundled_oniguruma:RUSTONIG_SYSTEM_LIBONIG=1} %{!?with_bundled_sqlite3:LIBSQLITE3_SYS_USE_PKG_CONFIG=1} %{!?with_disabled_libssh2:LIBSSH2_SYS_USE_PKG_CONFIG=1} + %{?llvm_path:PATH="%{llvm_path}:$PATH"} } %global export_rust_env export %{rust_env} @@ -819,12 +836,8 @@ end} %endif # Find the compiler-rt library for the Rust profiler_builtins crate. -%if %defined llvm_compat_version -# clang_resource_dir is not defined for compat builds. -%define profiler /usr/lib/clang/%{llvm_compat_version}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a -%else -%define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a -%endif +%define clang_lib %{expand:%%clang%{?llvm_compat_version}_resource_dir}/lib +%define profiler %{clang_lib}/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a test -r "%{profiler}" %configure --disable-option-checking \ @@ -843,7 +856,6 @@ test -r "%{profiler}" --local-rust-root=%{local_rust_root} \ --set build.rustfmt=/bin/true \ %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ - %{!?llvm_has_filecheck: --disable-codegen-tests} \ %{!?with_llvm_static: --enable-llvm-link-shared } } \ --disable-llvm-static-stdcpp \ --disable-llvm-bitcode-linker \ @@ -880,7 +892,7 @@ mkdir -p "%{profraw}" env LLVM_PROFILE_FILE="%{profraw}/default_%%m_%%p.profraw" \ %{__x} --keep-stage=0 --keep-stage=1 build cargo # Finalize the profile data and clean up the raw files -%{llvm_root}/bin/llvm-profdata merge -o "%{profdata}" "%{profraw}" +llvm-profdata merge -o "%{profdata}" "%{profraw}" rm -r "%{profraw}" build/%{rust_triple}/stage2*/ # Redefine the macro to use that profile data from now on %global __x %{__x} --rust-profile-use="%{profdata}" @@ -898,6 +910,21 @@ for triple in %{?all_targets} ; do %{__x} build --target=$triple std done +# Collect cargo-vendor.txt for each tool and std +%{cargo_tree_manifest -n rustc -- -p rustc-main -p rustdoc} +%{cargo_tree_manifest -n cargo -m src/tools/cargo} +%{cargo_tree_manifest -n clippy -m src/tools/clippy} +%{cargo_tree_manifest -n rust-analyzer -m src/tools/rust-analyzer} +%{cargo_tree_manifest -n rustfmt -m src/tools/rustfmt} + +%{cargo_tree_manifest -n std -m library -f backtrace} +for triple in %{?all_targets} ; do + case $triple in + *-none*) %{cargo_tree_manifest -n std-$triple -m library/alloc -t $triple} ;; + *) %{cargo_tree_manifest -n std-$triple -m library -f backtrace -t $triple} ;; + esac +done + %install %if 0%{?rhel} && 0%{?rhel} <= 9 %{?set_build_flags} @@ -1043,6 +1070,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_libexecdir}/rust-analyzer-proc-macro-srv %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* +%license build/manifests/rustc/cargo-vendor.txt +%license %{_pkgdocdir}/COPYRIGHT.html +%license %{_pkgdocdir}/licenses/ %files std-static @@ -1051,13 +1081,16 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib %{rustlibdir}/%{rust_triple}/lib/*.so +%license build/manifests/std/cargo-vendor.txt +%license %{_pkgdocdir}/COPYRIGHT-library.html %global target_files() \ %files std-static-%1 \ %dir %{rustlibdir} \ %dir %{rustlibdir}/%1 \ %dir %{rustlibdir}/%1/lib \ -%{rustlibdir}/%1/lib/*.rlib +%{rustlibdir}/%1/lib/*.rlib \ +%license build/manifests/std-%1/cargo-vendor.txt %if %target_enabled i686-pc-windows-gnu %target_files i686-pc-windows-gnu @@ -1139,6 +1172,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_datadir}/zsh/site-functions/_cargo %dir %{_datadir}/cargo %dir %{_datadir}/cargo/registry +%license build/manifests/cargo/cargo-vendor.txt %files -n rustfmt @@ -1146,6 +1180,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_bindir}/cargo-fmt %doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md %license src/tools/rustfmt/LICENSE-{APACHE,MIT} +%license build/manifests/rustfmt/cargo-vendor.txt %files analyzer @@ -1153,6 +1188,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_bindir}/rust-analyzer %doc src/tools/rust-analyzer/README.md %license src/tools/rust-analyzer/LICENSE-{APACHE,MIT} +%license build/manifests/rust-analyzer/cargo-vendor.txt %files -n clippy @@ -1160,6 +1196,7 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %{_bindir}/clippy-driver %doc src/tools/clippy/{README.md,CHANGELOG.md} %license src/tools/clippy/LICENSE-{APACHE,MIT} +%license build/manifests/clippy/cargo-vendor.txt %files src diff --git a/rustc-1.85.0-disable-libssh2.patch b/rustc-1.85.0-disable-libssh2.patch deleted file mode 100644 index 09be945..0000000 --- a/rustc-1.85.0-disable-libssh2.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-01-17 14:26:49.845587361 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-01-17 14:26:49.848587324 -0800 -@@ -2296,7 +2296,6 @@ checksum = "10472326a8a6477c3c20a64547b0 - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -2337,20 +2336,6 @@ dependencies = [ - "pkg-config", - "vcpkg", - ] -- --[[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" -diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-01-17 14:26:49.848587324 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-01-17 14:27:49.035844397 -0800 -@@ -47,7 +47,7 @@ curl = "0.4.46" - curl-sys = "0.4.73" - filetime = "0.2.23" - flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] } --git2 = "0.19.0" -+git2 = { version = "0.19.0", default-features = false, features = ["https"] } - git2-curl = "0.20.0" - gix = { version = "0.69.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } - glob = "0.3.1" diff --git a/rustc-1.85.0-unbundle-sqlite.patch b/rustc-1.85.0-unbundle-sqlite.patch deleted file mode 100644 index 08c395f..0000000 --- a/rustc-1.85.0-unbundle-sqlite.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-01-11 07:18:58.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-01-17 14:14:33.072839703 -0800 -@@ -2334,7 +2334,6 @@ version = "0.30.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" - dependencies = [ -- "cc", - "pkg-config", - "vcpkg", - ] -diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-01-17 14:14:33.072839703 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-01-17 14:15:48.497891366 -0800 -@@ -80,7 +80,7 @@ proptest = "1.5.0" - pulldown-cmark = { version = "0.12.0", default-features = false, features = ["html"] } - rand = "0.8.5" - regex = "1.10.5" --rusqlite = { version = "0.32.0", features = ["bundled"] } -+rusqlite = { version = "0.32.0", features = [] } - rustc-hash = "2.0.0" - rustc-stable-hash = "0.1.1" - rustfix = { version = "0.9.0", path = "crates/rustfix" } diff --git a/rustc-1.86.0-disable-libssh2.patch b/rustc-1.86.0-disable-libssh2.patch new file mode 100644 index 0000000..8b07bde --- /dev/null +++ b/rustc-1.86.0-disable-libssh2.patch @@ -0,0 +1,44 @@ +diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-03-11 15:36:38.387335541 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-03-11 15:39:27.491711044 -0700 +@@ -2528,7 +2528,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -2574,20 +2573,6 @@ dependencies = [ + "pkg-config", + "vcpkg", + ] +- +-[[package]] +-name = "libssh2-sys" +-version = "0.3.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" +-dependencies = [ +- "cc", +- "libc", +- "libz-sys", +- "openssl-sys", +- "pkg-config", +- "vcpkg", +-] + + [[package]] + name = "libz-sys" +diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-03-11 15:36:38.389045348 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-03-11 15:38:36.948228456 -0700 +@@ -47,7 +47,7 @@ curl = "0.4.47" + curl-sys = "0.4.79" + filetime = "0.2.25" + flate2 = { version = "1.0.35", default-features = false, features = ["zlib"] } +-git2 = "0.20.0" ++git2 = { version = "0.20.0", default-features = false, features = ["https"] } + git2-curl = "0.21.0" + gix = { version = "0.70.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] } + glob = "0.3.2" diff --git a/rustc-1.86.0-unbundle-sqlite.patch b/rustc-1.86.0-unbundle-sqlite.patch new file mode 100644 index 0000000..19f5fce --- /dev/null +++ b/rustc-1.86.0-unbundle-sqlite.patch @@ -0,0 +1,23 @@ +diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-03-11 15:30:39.383119717 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-03-11 15:32:12.486164705 -0700 +@@ -2571,7 +2571,6 @@ version = "0.31.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "ad8935b44e7c13394a179a438e0cebba0fe08fe01b54f152e29a93b5cf993fd4" + dependencies = [ +- "cc", + "pkg-config", + "vcpkg", + ] +diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-03-11 15:30:39.384466481 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-03-11 15:32:05.989298381 -0700 +@@ -80,7 +80,7 @@ proptest = "1.6.0" + pulldown-cmark = { version = "0.12.2", default-features = false, features = ["html"] } + rand = "0.9.0" + regex = "1.11.1" +-rusqlite = { version = "0.33.0", features = ["bundled"] } ++rusqlite = { version = "0.33.0", features = [] } + rustc-hash = "2.1.1" + rustc-stable-hash = "0.1.1" + rustfix = { version = "0.9.0", path = "crates/rustfix" } diff --git a/sources b/sources index b0e42b4..583e27d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.85.0-src.tar.xz) = 3e9c933d1d9b6e5fb081837cf07eb1638b1a6b4fd1cb607dd860c5021ba7b521edbaf8ba0fa8f182f62178b72a3e1a3e6b26675e8fb6530871137852a074443c -SHA512 (wasi-libc-wasi-sdk-25.tar.gz) = 580716fbc152be19e2e9724f3483a0a580a168be0cd6d105d37b0ebd0d11bd36d7d9db63984eb2cc7b3aaff2fc9446d9558d1469b538a79b7de465a1113560ea +SHA512 (rustc-1.86.0-src.tar.xz) = 9ce195e24a03765f7163de16271e3d19d731d4b80fcc2bfd919106c9d42543eade018f712f6947ea3c6e57c6cb2e6841596aa668d608b8da15101a7da14f3097 +SHA512 (wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz) = 7626200112b6e55567855b950baf7c9eeaf47e7de34a30eb9e8b785e0e03063197102d2f39d0846055d6aab7c06232f947a6b8af3dda62c8f02ea39d8f765a5e