diff --git a/0001-Fix-Async-Generator-ABI.patch b/0001-Fix-Async-Generator-ABI.patch deleted file mode 100644 index 34dd1bcedd865eedd9cdddd07d4615bce53162f4..0000000000000000000000000000000000000000 --- 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/rust.spec b/rust.spec index 7a205e539d83eaa364b9790203f91b0bbc6b49d6..3af1440b4c2c3dd294d2b830c131b763b3981880 100644 --- a/rust.spec +++ b/rust.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 1 # Only x86_64 and i686 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html @@ -10,9 +10,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 @@ -25,7 +25,6 @@ # cross-compilation. The packages are noarch, but they're not fully # reproducible between hosts, so only x86_64 actually builds it. %ifarch x86_64 -%global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu %global wasm_targets wasm32-unknown-unknown wasm32-wasi %endif @@ -33,7 +32,7 @@ # src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh # (updated per https://github.com/rust-lang/rust/pull/96907) %global wasi_libc_url https://github.com/WebAssembly/wasi-libc -%global wasi_libc_ref wasi-sdk-17 +%global wasi_libc_ref wasi-sdk-19 %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} @@ -63,7 +62,7 @@ %bcond_without lldb Name: rust -Version: 1.67.1 +Version: 1.68.0 Release: %{anolis_release}%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -86,20 +85,16 @@ 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 - -### RHEL-specific patches below ### +### Distro-specific patches below ### # Simple rpm macros for rust-toolset (as opposed to full rust-packaging) Source100: macros.rust-toolset # Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949) Patch100: rustc-1.65.0-disable-libssh2.patch -# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys +# libcurl on old distro 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 # Get the Rust triple for any arch. @@ -262,8 +257,9 @@ This package includes the Rust compiler and documentation generator. %package std-static Summary: Standard library for Rust +Provides: %{name}-std-static-%{rust_triple} = %{version}-%{release} Requires: %{name} = %{version}-%{release} -Requires: glibc-devel >= 2.11 +Requires: glibc-devel >= 2.17 %description std-static This package includes the standard libraries for building applications @@ -500,7 +496,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 -%patch3 -p1 %if %with disabled_libssh2 %patch100 -p1 @@ -560,6 +555,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} @@ -925,6 +926,10 @@ end} %{rpmmacrodir}/macros.rust-toolset %changelog +* Fri Mar 10 2023 Funda Wang - 1.68.0-1 +- New version 1.68.0 +- Drop mingw support (cross compilation) + * Fri Feb 24 2023 Funda Wang - 1.67.1-2 - Merge rust-toolset into main package 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 7b346e95d342e343db9a212bd69fb064c34895c9..09c433930cef8da13808eacdc40e3aee0acc59dc 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/rustc-1.67.1-src.tar.xz b/rustc-1.68.0-src.tar.xz similarity index 86% rename from rustc-1.67.1-src.tar.xz rename to rustc-1.68.0-src.tar.xz index 945e8d84705ab273396190f25febe65773dc9b27..5fa9dc2bfb27df5b0245649f1ab22267938232d4 100644 Binary files a/rustc-1.67.1-src.tar.xz and b/rustc-1.68.0-src.tar.xz differ diff --git a/wasi-libc-wasi-sdk-17.tar.gz b/wasi-libc-wasi-sdk-17.tar.gz deleted file mode 100644 index c74348bab3a286257c261202cbf618544b1b3361..0000000000000000000000000000000000000000 Binary files a/wasi-libc-wasi-sdk-17.tar.gz and /dev/null differ diff --git a/wasi-libc-wasi-sdk-19.tar.gz b/wasi-libc-wasi-sdk-19.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c419d8259ce1697a402e91c9bb4700b0981ee2c1 Binary files /dev/null and b/wasi-libc-wasi-sdk-19.tar.gz differ