From 356401c7f1a8be2c8e32da80739a3cd4e0452ae8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 23 Jun 2023 15:31:28 -0700 Subject: [PATCH 1/2] Override default target CPUs to match distro settings --- ...e-LLVM-coverage-of-print-target-cpus.patch | 98 +++++++++++++++++ ...variables-override-some-default-CPUs.patch | 53 +++++++++ ...110876-mj10021-issue-110647-fix-r-b-.patch | 102 ++++++++++++++++++ rust.spec | 48 ++++++--- 4 files changed, 284 insertions(+), 17 deletions(-) create mode 100644 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch create mode 100644 0001-Let-environment-variables-override-some-default-CPUs.patch create mode 100644 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch diff --git a/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch b/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch new file mode 100644 index 0000000..8dd209d --- /dev/null +++ b/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch @@ -0,0 +1,98 @@ +From 23b3553ca0332dee4bdd79251b881d552e6bbafa Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 5 May 2023 17:27:59 -0700 +Subject: [PATCH] Expand the LLVM coverage of `--print target-cpus` + +We've been relying on a custom patch to add `MCSubtargetInfo::getCPUTable` +for `rustc --print target-cpus`, and just printing that it's not supported +on external LLVM builds. LLVM `main` now has `getAllProcessorDescriptions` +that can replace ours, so now we try to use that. In addition, the fallback +path can at least print the native and default cpu options. + +There were also some mismatches in the function signatures here between +`LLVM_RUSTLLVM` and otherwise; this is now mitigated by sharing these +functions and only using cpp to adjust the function bodies. + +(cherry picked from commit 67ae38a336599a7e0d2898a5ea3416b947458f5d) +--- + .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 30 ++++++++++--------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +index b1503e6e4b87..a4827a57f5cf 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +@@ -297,7 +297,6 @@ static Reloc::Model fromRust(LLVMRustRelocModel RustReloc) { + report_fatal_error("Bad RelocModel."); + } + +-#ifdef LLVM_RUSTLLVM + /// getLongestEntryLength - Return the length of the longest entry in the table. + template + static size_t getLongestEntryLength(ArrayRef Table) { +@@ -312,11 +311,21 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); + const Triple::ArchType TargetArch = Target->getTargetTriple().getArch(); ++ ++#if LLVM_VERSION_GE(17, 0) ++ const ArrayRef CPUTable = MCInfo->getAllProcessorDescriptions(); ++#elif defined(LLVM_RUSTLLVM) + const ArrayRef CPUTable = MCInfo->getCPUTable(); ++#else ++ printf("Full target CPU help is not supported by this LLVM version.\n\n"); ++ SubtargetSubTypeKV TargetCPUKV = { TargetCPU, {{}}, {{}} }; ++ const ArrayRef CPUTable = TargetCPUKV; ++#endif + unsigned MaxCPULen = getLongestEntryLength(CPUTable); + + printf("Available CPUs for this target:\n"); + if (HostArch == TargetArch) { ++ MaxCPULen = std::max(MaxCPULen, (unsigned) std::strlen("native")); + const StringRef HostCPU = sys::getHostCPUName(); + printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", + MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); +@@ -336,34 +345,27 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar + } + + extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { ++#ifdef LLVM_RUSTLLVM + const TargetMachine *Target = unwrap(TM); + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const ArrayRef FeatTable = MCInfo->getFeatureTable(); + return FeatTable.size(); ++#else ++ return 0; ++#endif + } + + extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index, + const char** Feature, const char** Desc) { ++#ifdef LLVM_RUSTLLVM + const TargetMachine *Target = unwrap(TM); + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const ArrayRef FeatTable = MCInfo->getFeatureTable(); + const SubtargetFeatureKV Feat = FeatTable[Index]; + *Feature = Feat.Key; + *Desc = Feat.Desc; +-} +- +-#else +- +-extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef) { +- printf("Target CPU help is not supported by this LLVM version.\n\n"); +-} +- +-extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef) { +- return 0; +-} +- +-extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef, const char**, const char**) {} + #endif ++} + + extern "C" const char* LLVMRustGetHostCPUName(size_t *len) { + StringRef Name = sys::getHostCPUName(); +-- +2.40.1 + 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..c394f78 --- /dev/null +++ b/0001-Let-environment-variables-override-some-default-CPUs.patch @@ -0,0 +1,53 @@ +From 6e2adb05860b72610291d3b0e8bd525c44cb0cc9 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 9af1049b8702..68f876dd18c3 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.max_atomic_width = Some(64); + base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); + base.stack_probes = StackProbeType::X86; +-- +2.40.1 + diff --git a/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch b/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch new file mode 100644 index 0000000..1eab090 --- /dev/null +++ b/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch @@ -0,0 +1,102 @@ +From 6edbc665ea37ba3bf852b4eb42898b7d6e7b919c Mon Sep 17 00:00:00 2001 +From: Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> +Date: Fri, 5 May 2023 18:40:35 +0530 +Subject: [PATCH] Rollup merge of #110876 - mj10021:issue-110647-fix, r=b-naber + +Added default target cpu to `--print target-cpus` output and updated docs + +Added default target cpu info as requested in issue #110647 and noted the new output in the documentation + +(cherry picked from commit 65702bfd6bfb8616e182ddd19d0520ce7e35314a) +--- + compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 2 +- + compiler/rustc_codegen_llvm/src/llvm_util.rs | 9 ++++++++- + .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 17 +++++++++++++---- + src/doc/rustc/src/codegen-options/index.md | 3 ++- + 4 files changed, 24 insertions(+), 7 deletions(-) + +diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +index 05bbdbb7415c..383a9d2e5ddb 100644 +--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs ++++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +@@ -2263,7 +2263,7 @@ pub fn LLVMRustDIBuilderCreateDebugLocation<'a>( + + pub fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool; + +- pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine); ++ pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine, cpu: *const c_char); + pub fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t; + pub fn LLVMRustGetTargetFeature( + T: &TargetMachine, +diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs +index 46692fd5e8bc..2fbdab9f8ce0 100644 +--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs ++++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs +@@ -329,7 +329,14 @@ pub(crate) fn print(req: PrintRequest, sess: &Session) { + require_inited(); + let tm = create_informational_target_machine(sess); + match req { +- PrintRequest::TargetCPUs => unsafe { llvm::LLVMRustPrintTargetCPUs(tm) }, ++ PrintRequest::TargetCPUs => { ++ // SAFETY generate a C compatible string from a byte slice to pass ++ // the target CPU name into LLVM, the lifetime of the reference is ++ // at least as long as the C function ++ let cpu_cstring = CString::new(handle_native(sess.target.cpu.as_ref())) ++ .unwrap_or_else(|e| bug!("failed to convert to cstring: {}", e)); ++ unsafe { llvm::LLVMRustPrintTargetCPUs(tm, cpu_cstring.as_ptr()) }; ++ } + PrintRequest::TargetFeatures => print_target_features(sess, tm), + _ => bug!("rustc_codegen_llvm can't handle print request: {:?}", req), + } +diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +index 08e38b0c9d59..b1503e6e4b87 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +@@ -307,7 +307,7 @@ static size_t getLongestEntryLength(ArrayRef Table) { + return MaxLen; + } + +-extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { ++extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* TargetCPU) { + const TargetMachine *Target = unwrap(TM); + const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); + const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); +@@ -321,9 +321,18 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { + printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", + MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); + } +- for (auto &CPU : CPUTable) +- printf(" %-*s\n", MaxCPULen, CPU.Key); +- printf("\n"); ++ for (auto &CPU : CPUTable) { ++ // Compare cpu against current target to label the default ++ if (strcmp(CPU.Key, TargetCPU) == 0) { ++ printf(" %-*s - This is the default target CPU" ++ " for the current build target (currently %s).", ++ MaxCPULen, CPU.Key, Target->getTargetTriple().str().c_str()); ++ } ++ else { ++ printf(" %-*s", MaxCPULen, CPU.Key); ++ } ++ printf("\n"); ++ } + } + + extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { +diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md +index 62347f169a5e..3a14f582d600 100644 +--- a/src/doc/rustc/src/codegen-options/index.md ++++ b/src/doc/rustc/src/codegen-options/index.md +@@ -574,7 +574,8 @@ change in the future. + This instructs `rustc` to generate code specifically for a particular processor. + + You can run `rustc --print target-cpus` to see the valid options to pass +-here. Each target has a default base CPU. Special values include: ++and the default target CPU for the current buid target. ++Each target has a default base CPU. Special values include: + + * `native` can be passed to use the processor of the host machine. + * `generic` refers to an LLVM target with minimal features but modern tuning. +-- +2.40.1 + diff --git a/rust.spec b/rust.spec index f029807..95ea45c 100644 --- a/rust.spec +++ b/rust.spec @@ -84,7 +84,7 @@ Name: rust Version: 1.70.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -106,6 +106,18 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. 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 + +# Added default target cpu to `--print target-cpus` output +# https://github.com/rust-lang/rust/pull/110876 +Patch4: 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch + +# Improve `--print target-cpus` for non-bundled LLVM +# https://github.com/rust-lang/rust/pull/111274 +Patch5: 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch + ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -574,6 +586,9 @@ test -f '%{local_rust_root}/bin/rustc' %patch -P1 -p1 %patch -P2 -p1 +%patch -P3 -p1 +%patch -P4 -p1 +%patch -P5 -p1 %if %with disabled_libssh2 %patch -P100 -p1 @@ -646,24 +661,20 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %endif # These are similar to __cflags_arch_* in /usr/lib/rpm/redhat/macros -%if 0%{?fedora} || 0%{?rhel} >= 9 -%ifarch x86_64 -%global rust_target_cpu %[0%{?rhel} >= 10 ? "x86-64-v3" : ""] -%global rust_target_cpu %[0%{?rhel} == 9 ? "x86-64-v2" : "%{rust_target_cpu}"] -%endif -%ifarch s390x -%global rust_target_cpu %[0%{?rhel} >= 9 ? "z14" : "zEC12"] -%endif -%ifarch ppc64le -%global rust_target_cpu %[0%{?rhel} >= 9 ? "pwr9" : "pwr8"] -%endif -%endif +%{lua: function rustc_target_cpus() + 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") + return env +end} # Set up shared environment variables for build/install/check -%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} -%if "%{?rust_target_cpu}" != "" -%global rust_env %{?rust_env} CARGO_TARGET_%{rust_triple_env}_RUSTFLAGS=-Ctarget-cpu=%{rust_target_cpu} -%endif +%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{lua: print(rustc_target_cpus())} %if %defined cmake_path %global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH" %endif @@ -1049,6 +1060,9 @@ end} %changelog +* 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. From 386b9914c97fa484377fdf3e27deec741d1d02a5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 17 Jul 2023 09:24:25 -0700 Subject: [PATCH 2/2] Update to 1.71.0. --- .gitignore | 1 + ...e-LLVM-coverage-of-print-target-cpus.patch | 98 ----------------- ...t-lint-docs-when-download-rustc-is-e.patch | 60 +++++++++++ ...tc-bash_complettion-src-etc-.-to-avo.patch | 31 ++++++ ...110876-mj10021-issue-110647-fix-r-b-.patch | 102 ------------------ rust.spec | 38 ++++--- rustc-1.70.0-disable-libssh2.patch | 43 -------- ....patch => rustc-1.71.0-disable-http2.patch | 56 +++++----- rustc-1.71.0-disable-libssh2.patch | 42 ++++++++ sources | 2 +- 10 files changed, 185 insertions(+), 288 deletions(-) delete mode 100644 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch create mode 100644 0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch create mode 100644 0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch delete mode 100644 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch delete mode 100644 rustc-1.70.0-disable-libssh2.patch rename rustc-1.70.0-disable-http2.patch => rustc-1.71.0-disable-http2.patch (64%) create mode 100644 rustc-1.71.0-disable-libssh2.patch diff --git a/.gitignore b/.gitignore index 51331ef..d7f7e39 100644 --- a/.gitignore +++ b/.gitignore @@ -420,3 +420,4 @@ /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 diff --git a/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch b/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch deleted file mode 100644 index 8dd209d..0000000 --- a/0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 23b3553ca0332dee4bdd79251b881d552e6bbafa Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 5 May 2023 17:27:59 -0700 -Subject: [PATCH] Expand the LLVM coverage of `--print target-cpus` - -We've been relying on a custom patch to add `MCSubtargetInfo::getCPUTable` -for `rustc --print target-cpus`, and just printing that it's not supported -on external LLVM builds. LLVM `main` now has `getAllProcessorDescriptions` -that can replace ours, so now we try to use that. In addition, the fallback -path can at least print the native and default cpu options. - -There were also some mismatches in the function signatures here between -`LLVM_RUSTLLVM` and otherwise; this is now mitigated by sharing these -functions and only using cpp to adjust the function bodies. - -(cherry picked from commit 67ae38a336599a7e0d2898a5ea3416b947458f5d) ---- - .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 30 ++++++++++--------- - 1 file changed, 16 insertions(+), 14 deletions(-) - -diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -index b1503e6e4b87..a4827a57f5cf 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -@@ -297,7 +297,6 @@ static Reloc::Model fromRust(LLVMRustRelocModel RustReloc) { - report_fatal_error("Bad RelocModel."); - } - --#ifdef LLVM_RUSTLLVM - /// getLongestEntryLength - Return the length of the longest entry in the table. - template - static size_t getLongestEntryLength(ArrayRef Table) { -@@ -312,11 +311,21 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); - const Triple::ArchType TargetArch = Target->getTargetTriple().getArch(); -+ -+#if LLVM_VERSION_GE(17, 0) -+ const ArrayRef CPUTable = MCInfo->getAllProcessorDescriptions(); -+#elif defined(LLVM_RUSTLLVM) - const ArrayRef CPUTable = MCInfo->getCPUTable(); -+#else -+ printf("Full target CPU help is not supported by this LLVM version.\n\n"); -+ SubtargetSubTypeKV TargetCPUKV = { TargetCPU, {{}}, {{}} }; -+ const ArrayRef CPUTable = TargetCPUKV; -+#endif - unsigned MaxCPULen = getLongestEntryLength(CPUTable); - - printf("Available CPUs for this target:\n"); - if (HostArch == TargetArch) { -+ MaxCPULen = std::max(MaxCPULen, (unsigned) std::strlen("native")); - const StringRef HostCPU = sys::getHostCPUName(); - printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", - MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); -@@ -336,34 +345,27 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* Tar - } - - extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { -+#ifdef LLVM_RUSTLLVM - const TargetMachine *Target = unwrap(TM); - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const ArrayRef FeatTable = MCInfo->getFeatureTable(); - return FeatTable.size(); -+#else -+ return 0; -+#endif - } - - extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index, - const char** Feature, const char** Desc) { -+#ifdef LLVM_RUSTLLVM - const TargetMachine *Target = unwrap(TM); - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const ArrayRef FeatTable = MCInfo->getFeatureTable(); - const SubtargetFeatureKV Feat = FeatTable[Index]; - *Feature = Feat.Key; - *Desc = Feat.Desc; --} -- --#else -- --extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef) { -- printf("Target CPU help is not supported by this LLVM version.\n\n"); --} -- --extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef) { -- return 0; --} -- --extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef, const char**, const char**) {} - #endif -+} - - extern "C" const char* LLVMRustGetHostCPUName(size_t *len) { - StringRef Name = sys::getHostCPUName(); --- -2.40.1 - diff --git a/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch b/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch new file mode 100644 index 0000000..50518c6 --- /dev/null +++ b/0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch @@ -0,0 +1,60 @@ +From 9204a8359201271fd7b1c625d6f29ddd095a419d Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 10 Jul 2023 13:48:49 -0700 +Subject: [PATCH] Revert "Fix `x test lint-docs` when download-rustc is + enabled" + +This reverts commit abf9cbcb69e485b56776112bc587f6166e7ac5c9. +--- + src/tools/lint-docs/src/groups.rs | 3 +-- + src/tools/lint-docs/src/lib.rs | 9 --------- + 2 files changed, 1 insertion(+), 11 deletions(-) + +diff --git a/src/tools/lint-docs/src/groups.rs b/src/tools/lint-docs/src/groups.rs +index b11fb287cf4d..2a923a61b0a7 100644 +--- a/src/tools/lint-docs/src/groups.rs ++++ b/src/tools/lint-docs/src/groups.rs +@@ -39,12 +39,11 @@ pub(crate) fn generate_group_docs(&self, lints: &[Lint]) -> Result<(), Box Result> { + let mut result = BTreeMap::new(); + let mut cmd = Command::new(self.rustc_path); +- cmd.env_remove("LD_LIBRARY_PATH"); + cmd.arg("-Whelp"); + let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?; + if !output.status.success() { + return Err(format!( +- "failed to collect lint info: failed to run {cmd:?}: {:?}\n--- stderr\n{}--- stdout\n{}\n", ++ "failed to collect lint info: {:?}\n--- stderr\n{}--- stdout\n{}\n", + output.status, + std::str::from_utf8(&output.stderr).unwrap(), + std::str::from_utf8(&output.stdout).unwrap(), +diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs +index fe29b9abda39..034c6aa0708e 100644 +--- a/src/tools/lint-docs/src/lib.rs ++++ b/src/tools/lint-docs/src/lib.rs +@@ -403,12 +403,6 @@ fn generate_lint_output( + fs::write(&tempfile, source) + .map_err(|e| format!("failed to write {}: {}", tempfile.display(), e))?; + let mut cmd = Command::new(self.rustc_path); +- // NOTE: bootstrap sets `LD_LIBRARY_PATH` for building lint-docs itself. +- // Unfortunately, lint-docs is a bootstrap tool while rustc is built from source, +- // and sometimes the paths conflict. In particular, when using `download-rustc`, +- // the LLVM versions can differ between `ci-llvm` and `ci-rustc-sysroot`. +- // Unset LD_LIBRARY_PATH here so it doesn't interfere with running the compiler. +- cmd.env_remove("LD_LIBRARY_PATH"); + if options.contains(&"edition2015") { + cmd.arg("--edition=2015"); + } else { +@@ -421,9 +415,6 @@ fn generate_lint_output( + } + cmd.arg("lint_example.rs"); + cmd.current_dir(tempdir.path()); +- if self.verbose { +- eprintln!("running: {cmd:?}"); +- } + let output = cmd.output().map_err(|e| format!("failed to run command {:?}\n{}", cmd, e))?; + let stderr = std::str::from_utf8(&output.stderr).unwrap(); + let msgs = stderr +-- +2.41.0 + diff --git a/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch b/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch new file mode 100644 index 0000000..a326207 --- /dev/null +++ b/0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch @@ -0,0 +1,31 @@ +From cea2e61a03773ce28fd57b7338c4ae4d947650ca Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 10 Jul 2023 15:52:55 -0700 +Subject: [PATCH] Revert "fix: :bug: etc/bash_complettion -> src/etc/... to + avoid copy error" + +This reverts commit 08ce68b6a6bad360e9c3611ad60cf6598401f878. +--- + src/bootstrap/dist.rs | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index b49845386da1..9cead7adc8c3 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -1071,11 +1071,7 @@ fn run(self, builder: &Builder<'_>) -> Option { + + tarball.add_file(&cargo, "bin", 0o755); + tarball.add_file(etc.join("_cargo"), "share/zsh/site-functions", 0o644); +- tarball.add_renamed_file( +- etc.join("cargo.bashcomp.sh"), +- "src/etc/bash_completion.d", +- "cargo", +- ); ++ tarball.add_renamed_file(etc.join("cargo.bashcomp.sh"), "etc/bash_completion.d", "cargo"); + tarball.add_dir(etc.join("man"), "share/man/man1"); + tarball.add_legal_and_readme_to("share/doc/cargo"); + +-- +2.41.0 + diff --git a/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch b/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch deleted file mode 100644 index 1eab090..0000000 --- a/0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 6edbc665ea37ba3bf852b4eb42898b7d6e7b919c Mon Sep 17 00:00:00 2001 -From: Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> -Date: Fri, 5 May 2023 18:40:35 +0530 -Subject: [PATCH] Rollup merge of #110876 - mj10021:issue-110647-fix, r=b-naber - -Added default target cpu to `--print target-cpus` output and updated docs - -Added default target cpu info as requested in issue #110647 and noted the new output in the documentation - -(cherry picked from commit 65702bfd6bfb8616e182ddd19d0520ce7e35314a) ---- - compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 2 +- - compiler/rustc_codegen_llvm/src/llvm_util.rs | 9 ++++++++- - .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 17 +++++++++++++---- - src/doc/rustc/src/codegen-options/index.md | 3 ++- - 4 files changed, 24 insertions(+), 7 deletions(-) - -diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -index 05bbdbb7415c..383a9d2e5ddb 100644 ---- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs -@@ -2263,7 +2263,7 @@ pub fn LLVMRustDIBuilderCreateDebugLocation<'a>( - - pub fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool; - -- pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine); -+ pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine, cpu: *const c_char); - pub fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t; - pub fn LLVMRustGetTargetFeature( - T: &TargetMachine, -diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs -index 46692fd5e8bc..2fbdab9f8ce0 100644 ---- a/compiler/rustc_codegen_llvm/src/llvm_util.rs -+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs -@@ -329,7 +329,14 @@ pub(crate) fn print(req: PrintRequest, sess: &Session) { - require_inited(); - let tm = create_informational_target_machine(sess); - match req { -- PrintRequest::TargetCPUs => unsafe { llvm::LLVMRustPrintTargetCPUs(tm) }, -+ PrintRequest::TargetCPUs => { -+ // SAFETY generate a C compatible string from a byte slice to pass -+ // the target CPU name into LLVM, the lifetime of the reference is -+ // at least as long as the C function -+ let cpu_cstring = CString::new(handle_native(sess.target.cpu.as_ref())) -+ .unwrap_or_else(|e| bug!("failed to convert to cstring: {}", e)); -+ unsafe { llvm::LLVMRustPrintTargetCPUs(tm, cpu_cstring.as_ptr()) }; -+ } - PrintRequest::TargetFeatures => print_target_features(sess, tm), - _ => bug!("rustc_codegen_llvm can't handle print request: {:?}", req), - } -diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -index 08e38b0c9d59..b1503e6e4b87 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -@@ -307,7 +307,7 @@ static size_t getLongestEntryLength(ArrayRef Table) { - return MaxLen; - } - --extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { -+extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, const char* TargetCPU) { - const TargetMachine *Target = unwrap(TM); - const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); -@@ -321,9 +321,18 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { - printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", - MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); - } -- for (auto &CPU : CPUTable) -- printf(" %-*s\n", MaxCPULen, CPU.Key); -- printf("\n"); -+ for (auto &CPU : CPUTable) { -+ // Compare cpu against current target to label the default -+ if (strcmp(CPU.Key, TargetCPU) == 0) { -+ printf(" %-*s - This is the default target CPU" -+ " for the current build target (currently %s).", -+ MaxCPULen, CPU.Key, Target->getTargetTriple().str().c_str()); -+ } -+ else { -+ printf(" %-*s", MaxCPULen, CPU.Key); -+ } -+ printf("\n"); -+ } - } - - extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) { -diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md -index 62347f169a5e..3a14f582d600 100644 ---- a/src/doc/rustc/src/codegen-options/index.md -+++ b/src/doc/rustc/src/codegen-options/index.md -@@ -574,7 +574,8 @@ change in the future. - This instructs `rustc` to generate code specifically for a particular processor. - - You can run `rustc --print target-cpus` to see the valid options to pass --here. Each target has a default base CPU. Special values include: -+and the default target CPU for the current buid target. -+Each target has a default base CPU. Special values include: - - * `native` can be passed to use the processor of the host machine. - * `generic` refers to an LLVM target with minimal features but modern tuning. --- -2.40.1 - diff --git a/rust.spec b/rust.spec index 95ea45c..4fbbcf9 100644 --- a/rust.spec +++ b/rust.spec @@ -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.69.0 -%global bootstrap_channel 1.69.0 -%global bootstrap_date 2023-04-20 +%global bootstrap_version 1.70.0 +%global bootstrap_channel 1.70.0 +%global bootstrap_date 2023-06-01 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -46,14 +46,14 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 14.0+. %global min_llvm_version 14.0.0 -%global bundled_llvm_version 16.0.2 +%global bundled_llvm_version 16.0.5 %bcond_with bundled_llvm # 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.6.0 +%global min_libgit2_version 1.6.4 %global next_libgit2_version 1.7.0~ -%global bundled_libgit2_version 1.6.3 +%global bundled_libgit2_version 1.6.4 %if 0%{?fedora} >= 38 %bcond_with bundled_libgit2 %else @@ -83,8 +83,8 @@ %endif Name: rust -Version: 1.70.0 -Release: 2%{?dist} +Version: 1.71.0 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -110,13 +110,13 @@ Patch2: rustc-1.70.0-rust-gdb-substitute-path.patch # TODO: upstream this ability into the actual build configuration Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch -# Added default target cpu to `--print target-cpus` output -# https://github.com/rust-lang/rust/pull/110876 -Patch4: 0001-Rollup-merge-of-110876-mj10021-issue-110647-fix-r-b-.patch +# Restore LD_LIBRARY_PATH when running lint-docs +# https://github.com/rust-lang/rust/pull/110521#issuecomment-1629705099 +Patch4: 0001-Revert-Fix-x-test-lint-docs-when-download-rustc-is-e.patch -# Improve `--print target-cpus` for non-bundled LLVM -# https://github.com/rust-lang/rust/pull/111274 -Patch5: 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch +# Restore the bash completion path +# https://github.com/rust-lang/rust/pull/110906#issuecomment-1629832675 +Patch5: 0001-Revert-fix-bug-etc-bash_complettion-src-etc-.-to-avo.patch ### RHEL-specific patches below ### @@ -124,11 +124,11 @@ Patch5: 0001-Expand-the-LLVM-coverage-of-print-target-cpus.patch Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) -Patch100: rustc-1.70.0-disable-libssh2.patch +Patch100: rustc-1.71.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.70.0-disable-http2.patch +Patch101: rustc-1.71.0-disable-http2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -801,6 +801,9 @@ done # 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} @@ -1060,6 +1063,9 @@ end} %changelog +* 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 diff --git a/rustc-1.70.0-disable-libssh2.patch b/rustc-1.70.0-disable-libssh2.patch deleted file mode 100644 index f9202b4..0000000 --- a/rustc-1.70.0-disable-libssh2.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-05-19 19:02:31.000000000 -0700 -+++ rustc-beta-src/Cargo.lock 2023-05-24 16:36:33.312232441 -0700 -@@ -2967,7 +2967,6 @@ - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -3000,20 +2999,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.3" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/vendor/git2/Cargo.toml.orig 2023-05-19 21:16:57.000000000 -0700 -+++ rustc-beta-src/vendor/git2/Cargo.toml 2023-05-24 16:33:42.043813439 -0700 -@@ -55,9 +55,7 @@ - - [features] - default = [ -- "ssh", - "https", -- "ssh_key_from_memory", - ] - https = [ - "libgit2-sys/https", diff --git a/rustc-1.70.0-disable-http2.patch b/rustc-1.71.0-disable-http2.patch similarity index 64% rename from rustc-1.70.0-disable-http2.patch rename to rustc-1.71.0-disable-http2.patch index 0e779b3..34fdab3 100644 --- a/rustc-1.70.0-disable-http2.patch +++ b/rustc-1.71.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-05-24 16:49:05.242510531 -0700 -+++ rustc-beta-src/Cargo.lock 2023-05-24 16:51:11.741865603 -0700 -@@ -1197,7 +1197,6 @@ checksum = "14d05c10f541ae6f3bc5b3d923c2 +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-07-07 17:30:04.817452621 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-07-07 17:30:27.777988139 -0700 +@@ -734,7 +734,6 @@ dependencies = [ "cc", "libc", @@ -8,14 +8,14 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2989,16 +2988,6 @@ source = "registry+https://github.com/ru - checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" +@@ -1954,16 +1953,6 @@ + checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] -name = "libnghttp2-sys" --version = "0.1.4+1.41.0" +-version = "0.1.7+1.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" +-checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" -dependencies = [ - "cc", - "libc", @@ -23,22 +23,22 @@ - -[[package]] name = "libz-sys" - version = "1.1.3" + version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-05-24 16:49:05.244510489 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-05-24 16:51:04.683013189 -0700 -@@ -23,7 +23,7 @@ cargo-platform = { path = "crates/cargo- - cargo-util = { path = "crates/cargo-util", version = "0.2.4" } - clap = "4.2.0" - crates-io = { path = "crates/crates-io", version = "0.36.0" } --curl = { version = "0.4.44", features = ["http2"] } -+curl = { version = "0.4.44", features = [] } - curl-sys = "0.4.61" - env_logger = "0.10.0" - filetime = "0.2.9" ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-05-19 19:05:42.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-05-24 16:49:05.244510489 -0700 -@@ -407,16 +407,9 @@ impl<'cfg> PackageSet<'cfg> { +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-07-07 17:30:04.819452581 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-07-07 17:30:24.133061874 -0700 +@@ -118,7 +118,7 @@ + cargo-util.workspace = true + clap = { workspace = true, features = ["wrap_help"] } + crates-io.workspace = true +-curl = { workspace = true, features = ["http2"] } ++curl = { workspace = true, features = [] } + curl-sys.workspace = true + env_logger.workspace = true + filetime.workspace = true +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-07-07 17:30:04.819452581 -0700 +@@ -407,16 +407,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, ) -> CargoResult> { @@ -58,9 +58,9 @@ Ok(PackageSet { packages: package_ids ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-05-24 16:49:05.245510468 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-05-24 16:51:57.916900146 -0700 -@@ -229,16 +229,8 @@ impl<'cfg> HttpRegistry<'cfg> { +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-07-07 17:30:04.819452581 -0700 +@@ -229,16 +229,8 @@ } self.fetch_started = true; @@ -79,9 +79,9 @@ if !self.quiet { self.config ---- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-05-19 19:05:42.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-05-24 16:49:05.245510468 -0700 -@@ -25,7 +25,7 @@ impl PollExt for Poll { +--- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-07-07 17:30:04.819452581 -0700 +@@ -26,7 +26,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.71.0-disable-libssh2.patch b/rustc-1.71.0-disable-libssh2.patch new file mode 100644 index 0000000..ba61454 --- /dev/null +++ b/rustc-1.71.0-disable-libssh2.patch @@ -0,0 +1,42 @@ +--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-07-07 17:12:23.406932870 -0700 +@@ -1942,7 +1942,6 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1965,20 +1964,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.8" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-06-24 10:27:37.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-07-07 17:12:00.688392750 -0700 +@@ -31,7 +31,7 @@ + filetime = "0.2.9" + flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] } + fwdansi = "1.1.0" +-git2 = "0.17.1" ++git2 = { version = "0.17.1", default-features = false, features = ["https"] } + git2-curl = "0.18.0" + gix = { version = "0.44.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] } + gix-features-for-configuration-only = { version = "0.29.0", package = "gix-features", features = [ "parallel" ] } diff --git a/sources b/sources index eac2d5d..622ee4f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.70.0-src.tar.xz) = 21b35185fdcc35a059ee5ef6dca2b68f5f1d199e97f425a571cfc318a852c36a57bccf68e7673b4cb7cd83128f30d0b3eb93009a978f3ba3909b7eee50d40631 +SHA512 (rustc-1.71.0-src.tar.xz) = 2c93bafdd248563765a285add48ca77c1e4bad4d5431675ae6a5cdee4cfe7a41e6bcc880a489ca1069a307fd9a005f2d5f8e230dfc95b4a69152b4f9ca49ac44 SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05