From 86684455568976c553aaae81a124f2e79ac7cad9 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 9 May 2023 12:47:28 -0700 Subject: [PATCH] Update to 1.68.2. Related: rhbz#2191744 --- .gitignore | 1 + 0001-Fix-Async-Generator-ABI.patch | 55 --------------- ...m-wrapper-adapt-for-LLVM-API-changes.patch | 69 ------------------- rust.spec | 32 ++++----- ....patch => rustc-1.68.0-disable-http2.patch | 46 +++++++------ sources | 2 +- 6 files changed, 42 insertions(+), 163 deletions(-) delete mode 100644 0001-Fix-Async-Generator-ABI.patch delete mode 100644 0001-llvm-wrapper-adapt-for-LLVM-API-changes.patch rename rustc-1.67.0-disable-http2.patch => rustc-1.68.0-disable-http2.patch (75%) diff --git a/.gitignore b/.gitignore index 02c79ec..88719f6 100644 --- a/.gitignore +++ b/.gitignore @@ -397,3 +397,4 @@ /wasi-libc-wasi-sdk-17.tar.gz /rustc-1.67.1-src.tar.xz /wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz +/rustc-1.68.2-src.tar.xz diff --git a/0001-Fix-Async-Generator-ABI.patch b/0001-Fix-Async-Generator-ABI.patch deleted file mode 100644 index 34dd1bc..0000000 --- a/0001-Fix-Async-Generator-ABI.patch +++ /dev/null @@ -1,55 +0,0 @@ -From ecf812777a260e35ec9cd0c7d9dbd17a3f5cf5f9 Mon Sep 17 00:00:00 2001 -From: Arpad Borsos -Date: Tue, 29 Nov 2022 23:17:08 +0100 -Subject: [PATCH] Fix Async Generator ABI - -This change was missed when making async generators implement `Future` directly. -It did not cause any problems in codegen so far, as `GeneratorState<(), Output>` -happens to have the same ABI as `Poll`. ---- - compiler/rustc_ty_utils/src/abi.rs | 22 +++++++++++++++++----- - 1 file changed, 17 insertions(+), 5 deletions(-) - -diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs -index 73c7eb6992f0..d644cbccea11 100644 ---- a/compiler/rustc_ty_utils/src/abi.rs -+++ b/compiler/rustc_ty_utils/src/abi.rs -@@ -85,7 +85,7 @@ fn fn_sig_for_fn_abi<'tcx>( - bound_vars, - ) - } -- ty::Generator(_, substs, _) => { -+ ty::Generator(did, substs, _) => { - let sig = substs.as_generator().poly_sig(); - - let bound_vars = tcx.mk_bound_variable_kinds( -@@ -104,10 +104,22 @@ fn fn_sig_for_fn_abi<'tcx>( - let env_ty = tcx.mk_adt(pin_adt_ref, pin_substs); - - let sig = sig.skip_binder(); -- let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); -- let state_adt_ref = tcx.adt_def(state_did); -- let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); -- let ret_ty = tcx.mk_adt(state_adt_ref, state_substs); -+ // The `FnSig` and the `ret_ty` here is for a generators main -+ // `Generator::resume(...) -> GeneratorState` function in case we -+ // have an ordinary generator, or the `Future::poll(...) -> Poll` -+ // function in case this is a special generator backing an async construct. -+ let ret_ty = if tcx.generator_is_async(did) { -+ let state_did = tcx.require_lang_item(LangItem::Poll, None); -+ let state_adt_ref = tcx.adt_def(state_did); -+ let state_substs = tcx.intern_substs(&[sig.return_ty.into()]); -+ tcx.mk_adt(state_adt_ref, state_substs) -+ } else { -+ let state_did = tcx.require_lang_item(LangItem::GeneratorState, None); -+ let state_adt_ref = tcx.adt_def(state_did); -+ let state_substs = tcx.intern_substs(&[sig.yield_ty.into(), sig.return_ty.into()]); -+ tcx.mk_adt(state_adt_ref, state_substs) -+ }; -+ - ty::Binder::bind_with_vars( - tcx.mk_fn_sig( - [env_ty, sig.resume_ty].iter(), --- -2.39.1 - diff --git a/0001-llvm-wrapper-adapt-for-LLVM-API-changes.patch b/0001-llvm-wrapper-adapt-for-LLVM-API-changes.patch deleted file mode 100644 index 0a46567..0000000 --- a/0001-llvm-wrapper-adapt-for-LLVM-API-changes.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 1b512e5ece0a56733d298db227f7c6a933cb5123 Mon Sep 17 00:00:00 2001 -From: Krasimir Georgiev -Date: Sun, 11 Dec 2022 09:14:50 +0000 -Subject: [PATCH] llvm-wrapper: adapt for LLVM API changes - -This is a follow-up of -https://github.com/rust-lang/rust/commit/75aec4703dea7ef8e13924ccfa3a3d2e8c5c7cff. -There, I updated the wrapper to only include llvm/ADT/Optional.h for -LLVM version below 16. But I missed updating some of the None references. - -Found by our experimental rust + llvm at HEAD bot: -https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15587#0185006b-e0af-49e5-8b06-280ed125ff0d/200-539 - -(cherry picked from commit cbdc00f6e61132cbb74397cbb91171756e5d5834) ---- - compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 4 ++++ - compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 12 +++++++++++- - 2 files changed, 15 insertions(+), 1 deletion(-) - -diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -index 1a3d458c3006..2865ea892733 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -@@ -223,7 +223,11 @@ fromRust(LLVMRustCodeModel Model) { - case LLVMRustCodeModel::Large: - return CodeModel::Large; - case LLVMRustCodeModel::None: -+#if LLVM_VERSION_LT(16, 0) - return None; -+#else -+ return std::nullopt; -+#endif - default: - report_fatal_error("Bad CodeModel."); - } -diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -index 3a748f38995b..6e63a7e01b5f 100644 ---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp -@@ -322,7 +322,13 @@ extern "C" LLVMAttributeRef LLVMRustCreateUWTableAttr(LLVMContextRef C, bool Asy - } - - extern "C" LLVMAttributeRef LLVMRustCreateAllocSizeAttr(LLVMContextRef C, uint32_t ElementSizeArg) { -- return wrap(Attribute::getWithAllocSizeArgs(*unwrap(C), ElementSizeArg, None)); -+ return wrap(Attribute::getWithAllocSizeArgs(*unwrap(C), ElementSizeArg, -+#if LLVM_VERSION_LT(16, 0) -+ None -+#else -+ std::nullopt -+#endif -+ )); - } - - #if LLVM_VERSION_GE(15, 0) -@@ -717,7 +723,11 @@ static std::optional fromRust(LLVMRustChecksumKind Kind) { - #endif - switch (Kind) { - case LLVMRustChecksumKind::None: -+#if LLVM_VERSION_LT(16, 0) - return None; -+#else -+ return std::nullopt; -+#endif - case LLVMRustChecksumKind::MD5: - return DIFile::ChecksumKind::CSK_MD5; - case LLVMRustChecksumKind::SHA1: --- -2.40.0 - diff --git a/rust.spec b/rust.spec index c42bea7..179da3a 100644 --- a/rust.spec +++ b/rust.spec @@ -1,4 +1,4 @@ -# Only x86_64 and i686 are Tier 1 platforms at this time. +# Only x86_64, i686, and aarch64 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html %global rust_arches x86_64 i686 aarch64 ppc64le s390x @@ -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.66.0 -%global bootstrap_channel 1.66.0 -%global bootstrap_date 2022-12-15 +%global bootstrap_version 1.67.1 +%global bootstrap_channel 1.67.1 +%global bootstrap_date 2023-02-09 # Only the specified arches will use bootstrap binaries. # NOTE: Those binaries used to be uploaded with every new release, but that was @@ -84,7 +84,7 @@ %endif Name: rust -Version: 1.67.1 +Version: 1.68.2 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -107,13 +107,6 @@ Patch1: 0001-Use-lld-provided-by-system-for-wasm.patch # Set a substitute-path in rust-gdb for standard library sources. Patch2: rustc-1.61.0-rust-gdb-substitute-path.patch -# Fix Async Generator ABI (rhbz2168622) -# https://github.com/rust-lang/rust/pull/105082 -Patch3: 0001-Fix-Async-Generator-ABI.patch - -# https://github.com/rust-lang/rust/pull/105555 -Patch4: 0001-llvm-wrapper-adapt-for-LLVM-API-changes.patch - ### RHEL-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) @@ -124,7 +117,7 @@ Patch100: rustc-1.65.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.67.0-disable-http2.patch +Patch101: rustc-1.68.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -336,7 +329,7 @@ This package includes the Rust compiler and documentation generator. Summary: Standard library for Rust Provides: %{name}-std-static-%{rust_triple} = %{version}-%{release} Requires: %{name} = %{version}-%{release} -Requires: glibc-devel%{?_isa} >= 2.11 +Requires: glibc-devel%{?_isa} >= 2.17 %description std-static This package includes the standard libraries for building applications @@ -590,8 +583,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -661,6 +652,12 @@ find vendor -name .cargo-checksum.json \ # it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' +# The distro flags are only appropriate for the host, not our cross-targets, +# and they're not as fine-grained as the settings we choose for std vs rustc. +%if %defined build_rustflags +%global build_rustflags %{nil} +%endif + # Set up shared environment variables for build/install/check %global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %if 0%{?cmake_path:1} @@ -1047,6 +1044,9 @@ end} %changelog +* Tue May 09 2023 Josh Stone - 1.68.2-1 +- Update to 1.68.2. + * Mon May 08 2023 Josh Stone - 1.67.1-1 - Update to 1.67.1. diff --git a/rustc-1.67.0-disable-http2.patch b/rustc-1.68.0-disable-http2.patch similarity index 75% rename from rustc-1.67.0-disable-http2.patch rename to rustc-1.68.0-disable-http2.patch index 7b346e9..09c4339 100644 --- a/rustc-1.67.0-disable-http2.patch +++ b/rustc-1.68.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2023-01-24 13:25:47.822917185 -0800 -+++ rustc-beta-src/Cargo.lock 2023-01-24 13:25:47.824917142 -0800 -@@ -1062,7 +1062,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2023-03-03 17:26:41.309081970 -0800 ++++ rustc-beta-src/Cargo.lock 2023-03-03 17:26:41.311081929 -0800 +@@ -1152,7 +1152,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -2181,16 +2180,6 @@ +@@ -2399,16 +2398,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-01-24 13:25:47.824917142 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-01-24 13:26:29.209044200 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-03-03 17:26:41.311081929 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-03-03 17:27:32.999013773 -0800 @@ -21,7 +21,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } cargo-util = { path = "crates/cargo-util", version = "0.2.3" } - crates-io = { path = "crates/crates-io", version = "0.35.0" } + crates-io = { path = "crates/crates-io", version = "0.35.1" } -curl = { version = "0.4.44", features = ["http2"] } +curl = { version = "0.4.44", features = [] } curl-sys = "0.4.59" env_logger = "0.10.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-01-21 17:17:19.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-01-24 13:25:47.824917142 -0800 -@@ -403,16 +403,9 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2023-02-26 19:02:38.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2023-03-03 17:26:41.311081929 -0800 +@@ -402,16 +402,9 @@ sources: SourceMap<'cfg>, config: &'cfg Config, ) -> CargoResult> { @@ -58,18 +58,9 @@ Ok(PackageSet { packages: package_ids -@@ -658,7 +651,7 @@ - macro_rules! try_old_curl { - ($e:expr, $msg:expr) => { - let result = $e; -- if cfg!(target_os = "macos") { -+ if cfg!(any(target_os = "linux", target_os = "macos")) { - if let Err(e) = result { - warn!("ignoring libcurl {} error: {}", $msg, e); - } ---- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-01-21 17:17:19.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-01-24 13:25:47.824917142 -0800 -@@ -223,16 +223,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2023-02-26 19:02:38.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2023-03-03 17:26:41.311081929 -0800 +@@ -220,16 +220,8 @@ } self.fetch_started = true; @@ -88,3 +79,14 @@ self.config .shell() +--- rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs.orig 2023-02-26 19:02:38.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/util/network.rs 2023-03-03 17:29:54.808076261 -0800 +@@ -116,7 +116,7 @@ + macro_rules! try_old_curl { + ($e:expr, $msg:expr) => { + let result = $e; +- if cfg!(target_os = "macos") { ++ if cfg!(any(target_os = "linux", target_os = "macos")) { + if let Err(e) = result { + warn!("ignoring libcurl {} error: {}", $msg, e); + } diff --git a/sources b/sources index 8fa0e6e..314c739 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rustc-1.67.1-src.tar.xz) = 42d77ee93b168ae139b026138fb48d925624ff436a836aa97ee235f870e61ea11643b0cf7ad20bcafda774c6cd3855a4bc10a2e2ed1c4d82c6f15158963b304d +SHA512 (rustc-1.68.2-src.tar.xz) = 8b085d0351e19100e9abc24b10c44a0939a1d35ba23421da4ece345d7373f7dbad1dc6a2ae153c1259404dd96b41e2682e711cf2b0b63fd03a196760cddbcdd3 SHA512 (wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz) = 6f813bc7822746c161932de6b84fb965111400a1a38c25dd0981209d588b9ccafe1a5923349110c536f1b7cda707dfa2d0be42c92b2fa6fd89c957eda27bda27