diff --git a/0001-Don-t-fail-early-if-try_run-returns-an-error.patch b/0001-Don-t-fail-early-if-try_run-returns-an-error.patch deleted file mode 100644 index d77ddc7..0000000 --- a/0001-Don-t-fail-early-if-try_run-returns-an-error.patch +++ /dev/null @@ -1,201 +0,0 @@ -From 98336f8f6e701ea99275f32d6e2127a621041994 Mon Sep 17 00:00:00 2001 -From: Guillaume Gomez -Date: Tue, 11 Jul 2023 17:01:35 +0200 -Subject: [PATCH] Don't fail early if `try_run` returns an error - ---- - src/bootstrap/download.rs | 2 +- - src/bootstrap/run.rs | 11 +++++------ - src/bootstrap/test.rs | 36 ++++++++++++++++-------------------- - 3 files changed, 22 insertions(+), 27 deletions(-) - -diff --git a/src/bootstrap/download.rs b/src/bootstrap/download.rs -index cb40521dda76..9478ac7d9cea 100644 ---- a/src/bootstrap/download.rs -+++ b/src/bootstrap/download.rs -@@ -188,7 +188,7 @@ fn fix_bin_or_dylib(&self, fname: &Path) { - patchelf.args(&["--set-interpreter", dynamic_linker.trim_end()]); - } - -- self.try_run(patchelf.arg(fname)).unwrap(); -+ let _ = self.try_run(patchelf.arg(fname)); - } - - fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str) { -diff --git a/src/bootstrap/run.rs b/src/bootstrap/run.rs -index c97b75927371..70b917000433 100644 ---- a/src/bootstrap/run.rs -+++ b/src/bootstrap/run.rs -@@ -27,8 +27,7 @@ fn run(self, builder: &Builder<'_>) { - try_run( - builder, - &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("generate").arg(&builder.src), -- ) -- .unwrap(); -+ ); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { -@@ -40,17 +39,17 @@ fn make_run(run: RunConfig<'_>) { - } - } - --fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { -+fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { - if !builder.fail_fast { -- if let Err(e) = builder.try_run(cmd) { -+ if builder.try_run(cmd).is_err() { - let mut failures = builder.delayed_failures.borrow_mut(); - failures.push(format!("{:?}", cmd)); -- return Err(e); -+ return false; - } - } else { - builder.run(cmd); - } -- Ok(()) -+ true - } - - #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] -diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index 0907291b54da..13576aa787b6 100644 ---- a/src/bootstrap/test.rs -+++ b/src/bootstrap/test.rs -@@ -48,17 +48,17 @@ - // build for, so there is no entry for "aarch64-apple-darwin" here. - ]; - --fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { -+fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { - if !builder.fail_fast { -- if let Err(e) = builder.try_run(cmd) { -+ if builder.try_run(cmd).is_err() { - let mut failures = builder.delayed_failures.borrow_mut(); - failures.push(format!("{:?}", cmd)); -- return Err(e); -+ return false; - } - } else { - builder.run(cmd); - } -- Ok(()) -+ true - } - - fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool { -@@ -187,8 +187,7 @@ fn run(self, builder: &Builder<'_>) { - try_run( - builder, - builder.tool_cmd(Tool::Linkchecker).arg(builder.out.join(host.triple).join("doc")), -- ) -- .unwrap(); -+ ); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { -@@ -241,8 +240,7 @@ fn run(self, builder: &Builder<'_>) { - builder.default_doc(&[]); - builder.ensure(crate::doc::Rustc::new(builder.top_stage, self.target, builder)); - -- try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))) -- .unwrap(); -+ try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))); - } - } - -@@ -288,8 +286,7 @@ fn run(self, builder: &Builder<'_>) { - .args(builder.config.test_args()) - .env("RUSTC", builder.rustc(compiler)) - .env("RUSTDOC", builder.rustdoc(compiler)), -- ) -- .unwrap(); -+ ); - } - } - -@@ -855,7 +852,7 @@ fn run(self, builder: &Builder<'_>) { - util::lld_flag_no_threads(self.compiler.host.contains("windows")), - ); - } -- try_run(builder, &mut cmd).unwrap(); -+ try_run(builder, &mut cmd); - } - } - -@@ -1106,7 +1103,7 @@ fn run(self, builder: &Builder<'_>) { - } - - builder.info("tidy check"); -- try_run(builder, &mut cmd).unwrap(); -+ try_run(builder, &mut cmd); - - builder.ensure(ExpandYamlAnchors); - -@@ -1154,8 +1151,7 @@ fn run(self, builder: &Builder<'_>) { - try_run( - builder, - &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), -- ) -- .unwrap(); -+ ); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { -@@ -1948,7 +1944,7 @@ fn run_ext_doc(self, builder: &Builder<'_>) { - compiler.host, - ); - let _time = util::timeit(&builder); -- let toolstate = if try_run(builder, &mut rustbook_cmd).is_ok() { -+ let toolstate = if try_run(builder, &mut rustbook_cmd) { - ToolState::TestPass - } else { - ToolState::TestFail -@@ -2106,7 +2102,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> - cmd.arg("--test-args").arg(test_args); - - if builder.config.verbose_tests { -- try_run(builder, &mut cmd).is_ok() -+ try_run(builder, &mut cmd) - } else { - try_run_quiet(builder, &mut cmd) - } -@@ -2134,7 +2130,7 @@ fn run(self, builder: &Builder<'_>) { - - let src = builder.src.join(relative_path); - let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); -- let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)).is_ok() { -+ let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)) { - ToolState::TestPass - } else { - ToolState::TestFail -@@ -2684,7 +2680,7 @@ fn run(self, builder: &Builder<'_>) { - .current_dir(builder.src.join("src/bootstrap/")); - // NOTE: we intentionally don't pass test_args here because the args for unittest and cargo test are mutually incompatible. - // Use `python -m unittest` manually if you want to pass arguments. -- try_run(builder, &mut check_bootstrap).unwrap(); -+ try_run(builder, &mut check_bootstrap); - - let host = builder.config.build; - let compiler = builder.compiler(0, host); -@@ -2756,7 +2752,7 @@ fn run(self, builder: &Builder<'_>) { - } - - builder.info("platform support check"); -- try_run(builder, &mut cargo.into()).unwrap(); -+ try_run(builder, &mut cargo.into()); - } - } - -@@ -2836,7 +2832,7 @@ fn run(self, builder: &Builder<'_>) { - cmd.env("CARGO", &builder.initial_cargo); - cmd.env("RUSTC", &builder.initial_rustc); - cmd.env("TMP_DIR", &tmpdir); -- try_run(builder, &mut cmd).unwrap(); -+ try_run(builder, &mut cmd); - } - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { --- -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 index 62b4c56..6806d2a 100644 --- a/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch +++ b/0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch @@ -1,21 +1,19 @@ -From ab9c5148956c2b7d177cc94533370d6a01a8d15f Mon Sep 17 00:00:00 2001 +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. - -(cherry picked from commit 35187c7e6474d346eea3113c4ae34d26d6b18756) --- src/bootstrap/test.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs -index eed7a584b603..d41850783c6d 100644 +index db3b7ffbea4e..d1018978f78c 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs -@@ -1150,6 +1150,11 @@ impl Step for ExpandYamlAnchors { +@@ -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<'_>) { @@ -25,8 +23,8 @@ index eed7a584b603..d41850783c6d 100644 + return; + } builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); - try_run( - builder, + builder.run_delaying_failure( + &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), -- 2.41.0 diff --git a/rust.spec b/rust.spec index d14af1b..855d402 100644 --- a/rust.spec +++ b/rust.spec @@ -1,20 +1,19 @@ -%global bootstrap_rust 1.71.0 -%global bootstrap_cargo 1.71.0 -%global bootstrap_channel 1.71.0 -%global bootstrap_date 2023-07-13 +%global bootstrap_rust 1.72.0 +%global bootstrap_cargo 1.72.0 +%global bootstrap_channel 1.72.0 +%global bootstrap_date 2023-08-24 %bcond_with llvm_static %bcond_with bundled_llvm %bcond_without bundled_libgit2 %bcond_with disabled_libssh2 -%bcond_without curl_http2 %bcond_without lldb %bcond_without analyzer Name: rust -Version: 1.72.0 +Version: 1.73.0 Release: 1 Summary: The Rust Programming Language -License: (ASL 2.0 or MIT) and (BSD and MIT) +License: Apache-2.0 OR MIT URL: https://www.rust-lang.org Source0: https://static.rust-lang.org/dist/rustc-%{version}-src.tar.xz # SOURCE1-3: use local mirror for speed up @@ -22,21 +21,17 @@ Source1: cargo-config Source2: cargo-config.sh Source3: cargo-config.csh -Patch0000: rustc-1.72.0-disable-libssh2.patch -Patch0001: rustc-1.72.0-disable-http2.patch -Patch0002: clippy-driver-usage-should-user-friendly.patch -Patch0003: cargo-help-clippy-should-have-description-to-user.patch -Patch0004: fix-a-println-wrong-format.patch -# Fix --no-fail-fast -# https://github.com/rust-lang/rust/pull/113214 -Patch0005: 0001-Don-t-fail-early-if-try_run-returns-an-error.patch +Patch0000: rustc-1.73.0-disable-libssh2.patch +Patch0001: clippy-driver-usage-should-user-friendly.patch +Patch0002: cargo-help-clippy-should-have-description-to-user.patch +Patch0003: fix-a-println-wrong-format.patch # The dist-src tarball doesn't include .github/ # https://github.com/rust-lang/rust/pull/115109 -Patch0006: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch +Patch0004: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch # By default, rust tries to use "rust-lld" as a linker for WebAssembly. -Patch0007: 0001-Use-lld-provided-by-system-for-wasm.patch +Patch0005: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. -Patch0008: rustc-1.70.0-rust-gdb-substitute-path.patch +Patch0006: rustc-1.70.0-rust-gdb-substitute-path.patch %{lua: function rust_triple(arch) local abi = "gnu" @@ -101,7 +96,7 @@ BuildRequires: pkgconfig(openssl) pkgconfig(zlib) pkgconfig(libssh2) >= 1. BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.13.4 -Provides: bundled(llvm) = 16.0.5 +Provides: bundled(llvm) = 17.0.2 %else BuildRequires: cmake >= 2.8.11 %if %defined llvm @@ -112,8 +107,8 @@ BuildRequires: cmake >= 2.8.11 %global llvm_root %{_prefix} %endif # rust currently requires llvm 14.0+ -BuildRequires: %{llvm} >= 14.0.0 -BuildRequires: %{llvm}-devel >= 14.0.0 +BuildRequires: %{llvm} >= 15.0.0 +BuildRequires: %{llvm}-devel >= 15.0.0 %if %with llvm_static BuildRequires: %{llvm}-static libffi-devel %endif @@ -193,6 +188,8 @@ and ensure that you'll always get a repeatable build. %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} Obsoletes: rustfmt-preview < 1.0.0 Provides: rustfmt-preview = %{version}-%{release} Conflicts: rustfmt-preview < 1.0.0 @@ -251,20 +248,15 @@ test -f '%{local_rust_root}/bin/rustc' %if %with disabled_libssh2 %patch -P 0000 -p1 %endif -%if %without curl_http2 -%patch -P 0001 -p1 -rm -rf vendor/libnghttp2-sys*/ -%endif %if "%{python}" != "python3" sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure %endif +%patch -P 0001 -p1 %patch -P 0002 -p1 %patch -P 0003 -p1 %patch -P 0004 -p1 %patch -P 0005 -p1 %patch -P 0006 -p1 -%patch -P 0007 -p1 -%patch -P 0008 -p1 rm -rf vendor/curl-sys*/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ rm -rf vendor/libffi-sys*/libffi/ @@ -451,7 +443,6 @@ export %{rust_env} %config(noreplace) %{_sysconfdir}/skel/.cargo/config.toml %{_sysconfdir}/profile.d/cargo-config.* %{_bindir}/cargo -%{_libexecdir}/cargo* %{_sysconfdir}/bash_completion.d/cargo %{_datadir}/zsh/site-functions/_cargo %dir %{_datadir}/cargo @@ -493,6 +484,9 @@ export %{rust_env} %{_mandir}/man1/cargo*.1* %changelog +* Mon Oct 09 2023 wangkai <13474090681@163.com> - 1.73.0-1 +- Update to 1.73.0 + * Mon Aug 28 2023 jchzhou - 1.72.0-1 - Update to 1.72.0 diff --git a/rustc-1.72.0-disable-http2.patch b/rustc-1.72.0-disable-http2.patch deleted file mode 100644 index db2213e..0000000 --- a/rustc-1.72.0-disable-http2.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-08-21 11:00:15.341608892 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-08-21 11:00:46.074984901 -0700 -@@ -743,7 +743,6 @@ - dependencies = [ - "cc", - "libc", -- "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -2011,16 +2010,6 @@ - checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - - [[package]] --name = "libnghttp2-sys" --version = "0.1.7+1.45.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" --dependencies = [ -- "cc", -- "libc", --] -- --[[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-08-21 11:00:15.341608892 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-08-21 11:00:15.342608871 -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-08-17 20:58:39.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-08-21 11:00:15.343608851 -0700 -@@ -408,16 +408,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 ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-08-17 20:58:39.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-08-21 11:00:15.343608851 -0700 -@@ -250,16 +250,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; - - if !self.quiet { - self.config ---- rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs.orig 2023-08-21 11:00:15.343608851 -0700 -+++ rustc-beta-src/src/tools/cargo/src/cargo/util/network/mod.rs 2023-08-21 11:02:01.969443986 -0700 -@@ -27,7 +27,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 { - ::log::warn!("ignoring libcurl {} error: {}", $msg, e); - } diff --git a/rustc-1.72.0-src.tar.xz b/rustc-1.72.0-src.tar.xz deleted file mode 100644 index 64ce530..0000000 --- a/rustc-1.72.0-src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d307441f8ee78a7e94f72cb5c81383822f13027f79e67a5551bfd2c2d2db3014 -size 151630408 diff --git a/rustc-1.72.0-disable-libssh2.patch b/rustc-1.73.0-disable-libssh2.patch similarity index 58% rename from rustc-1.72.0-disable-libssh2.patch rename to rustc-1.73.0-disable-libssh2.patch index 1198954..96b5f4f 100644 --- a/rustc-1.72.0-disable-libssh2.patch +++ b/rustc-1.73.0-disable-libssh2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-08-17 20:58:39.000000000 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-08-21 10:52:50.520622927 -0700 -@@ -1999,7 +1999,6 @@ +--- 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", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2022,20 +2021,6 @@ +@@ -2006,20 +2005,6 @@ ] [[package]] @@ -29,14 +29,14 @@ 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-08-21 10:49:34.852578202 -0700 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-08-21 10:52:11.858404449 -0700 -@@ -31,7 +31,7 @@ - filetime = "0.2.9" - flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] } +--- 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.1" -+git2 = { version = "0.17.1", default-features = false, features = ["https"] } +-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/rustc-1.73.0-src.tar.xz b/rustc-1.73.0-src.tar.xz new file mode 100644 index 0000000..311b4f8 --- /dev/null +++ b/rustc-1.73.0-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6eaf672dbea2e6596af8c999f5e6924b9af4bb8b02166bfe0b928e68aa75ae62 +size 154319536