Update to 1.68.0.

This commit is contained in:
Josh Stone 2023-03-09 08:52:34 -08:00
parent b85b429e00
commit a07799699f
5 changed files with 46 additions and 93 deletions

2
.gitignore vendored
View File

@ -412,3 +412,5 @@
/rustc-1.66.1-src.tar.xz
/rustc-1.67.0-src.tar.xz
/rustc-1.67.1-src.tar.xz
/rustc-1.68.0-src.tar.xz
/wasi-libc-wasi-sdk-19.tar.gz

View File

@ -1,55 +0,0 @@
From ecf812777a260e35ec9cd0c7d9dbd17a3f5cf5f9 Mon Sep 17 00:00:00 2001
From: Arpad Borsos <swatinem@swatinem.de>
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<Output>`.
---
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

View File

@ -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 armv7hl 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
@ -35,7 +35,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}
@ -83,8 +83,8 @@
%endif
Name: rust
Version: 1.67.1
Release: 3%{?dist}
Version: 1.68.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)
@ -106,10 +106,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
### RHEL-specific patches below ###
# Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@ -120,7 +116,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)
@ -332,7 +328,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
@ -586,7 +582,6 @@ test -f '%{local_rust_root}/bin/rustc'
%patch1 -p1
%patch2 -p1
%patch3 -p1
%if %with disabled_libssh2
%patch100 -p1
@ -656,6 +651,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}
@ -1042,6 +1043,9 @@ end}
%changelog
* Thu Mar 09 2023 Josh Stone <jistone@redhat.com> - 1.68.0-1
- Update to 1.68.0.
* Tue Mar 07 2023 David Michael <fedora.dm0@gmail.com> - 1.67.1-3
- Add a virtual Provides to rust-std-static containing the target triple.

View File

@ -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<PackageSet<'cfg>> {
@ -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);
}

View File

@ -1,2 +1,2 @@
SHA512 (rustc-1.67.1-src.tar.xz) = 42d77ee93b168ae139b026138fb48d925624ff436a836aa97ee235f870e61ea11643b0cf7ad20bcafda774c6cd3855a4bc10a2e2ed1c4d82c6f15158963b304d
SHA512 (wasi-libc-wasi-sdk-17.tar.gz) = 5870f86d4a8431edefaef41163d1fa7eddeabcfa6bc5794c7bf18b4fd320b6ea43c261a7e41966d0da1490a2d96b9742c82cbcca7c56bb404830722664cab376
SHA512 (rustc-1.68.0-src.tar.xz) = f6cc5c06488080f2d7ce8c4f5adf7ca8ae8b10caea627b57876b051593af1201a48823d0abf5fcbcd344b46606b53957569db9844d647a5fdc4abca06e260f3a
SHA512 (wasi-libc-wasi-sdk-19.tar.gz) = 312f4d01d1b1108c24a1e9b233648ec44408ec1b7c17e8a65288038a94f117be9ed8181c60f99f9593ff80ca380f53c51756357bad466cd65027cb23a3646d23