rust: update to 1.82.0
This commit is contained in:
committed by
GitHub
parent
07c342d832
commit
ff688e52c8
1
mingw-w64-rust/.gitignore
vendored
Normal file
1
mingw-w64-rust/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/130034.patch
|
||||
@@ -9,7 +9,7 @@ if [[ $MINGW_PACKAGE_PREFIX == *-clang-* ]]; then
|
||||
fi
|
||||
|
||||
rust_dist_server=https://static.rust-lang.org/dist
|
||||
#rust_dist_server=https://dev-static.rust-lang.org/dist/2024-09-03
|
||||
#rust_dist_server=https://dev-static.rust-lang.org/dist/2024-10-14
|
||||
|
||||
embed_manifest_version=1.3.1
|
||||
embed_manifest_url=https://gitlab.com/careyevans/embed-manifest/-/archive/v${embed_manifest_version}/embed-manifest-v${embed_manifest_version}.tar.gz
|
||||
@@ -19,11 +19,11 @@ pkgbase=mingw-w64-${_realname}
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
$([[ ${CARCH} == i686 ]] || echo "${MINGW_PACKAGE_PREFIX}-rust-wasm")
|
||||
"${MINGW_PACKAGE_PREFIX}-rust-src")
|
||||
pkgver=1.81.0
|
||||
pkgrel=5
|
||||
pkgver=1.82.0
|
||||
pkgrel=1
|
||||
pkgdesc="Systems programming language focused on safety, speed and concurrency (mingw-w64)"
|
||||
arch=('any')
|
||||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
|
||||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
||||
url="https://www.rust-lang.org/"
|
||||
msys2_repository_url="https://github.com/rust-lang/rust"
|
||||
msys2_references=(
|
||||
@@ -55,13 +55,12 @@ source=("${rust_dist_server}/${_realname}c-${pkgver}-src.tar.gz"{,.asc}
|
||||
"0012-vendor-embed-manifest.patch"
|
||||
# remove after 1.83.0 release
|
||||
"0013-generate-import-libraries-on-gnullvm.patch"
|
||||
# remove after 1.82.0 release
|
||||
"fix-bootstrap-on-windows.patch")
|
||||
"https://github.com/rust-lang/rust/pull/130034.patch")
|
||||
noextract=(${_realname}c-${pkgver}-src.tar.gz)
|
||||
sha256sums=('872448febdff32e50c3c90a7e15f9bb2db131d13c588fe9071b0ed88837ccfa7'
|
||||
sha256sums=('7c53f4509eda184e174efa6ba7d5eeb586585686ce8edefc781a2b11a7cf512a'
|
||||
'SKIP'
|
||||
'24ef6d949c0b5b1940c1d6a7aad78d86012152fb8845a1644bc939350d7b75e2'
|
||||
'3529c569217d5c18dd7b675e0ff1477b4f0386c73b6d8314fe709341bb561d74'
|
||||
'21ca19cc4247376adf9a5a68ca43fe90baf9774e8c79a06f6df94bf807014613'
|
||||
'7cb1773c288ffb1c1e751edc49b1890c84bf9c362742bc5225d19d474edb73a0'
|
||||
'56882f1a0f1404c10c7726d6cc37444f2b343e72b969badfcb43760f80db0f32'
|
||||
'7d1c4e49524b835a8eadc961b39f5594b12a522a1e24368999be2c7e85399e4e'
|
||||
@@ -69,7 +68,7 @@ sha256sums=('872448febdff32e50c3c90a7e15f9bb2db131d13c588fe9071b0ed88837ccfa7'
|
||||
'761d73328d9695a7a2bd2a10be8225f4a56801fee54cbb51c0841b7f16e2bde6'
|
||||
'23fc45f4e718770375be1c5196f035075de16d25e8f895100a3d1d2492995f86'
|
||||
'7ebec5945f9fd38729da513fba8679efbad19bdde8a5d0d8ea097e5b9a7a99db'
|
||||
'0a9800a4f5e833fc435e86457a1b7a41f32d4bd2c1185d1eada90b28bdf6230c')
|
||||
'6558ca2ef70f2dafce3fc2ffcfe0db0ad6a7728f31a13ddddd63a9eee9e57b72')
|
||||
validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE' # Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
|
||||
'474E22316ABF4785A88C6E8EA2C794A986419D8A' # Tom Stellard <tstellar@redhat.com>
|
||||
'B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans@chromium.org>
|
||||
@@ -99,14 +98,13 @@ apply_patch_with_msg() {
|
||||
|
||||
prepare() {
|
||||
plain "Extracting ${_realname}c-${pkgver}-src.tar.gz"
|
||||
[[ -d ${srcdir}/${_realname}c-${pkgver}-src ]] && rm -rf ${srcdir}/${_realname}c-${pkgver}-src
|
||||
tar -xzf ${srcdir}/${_realname}c-${pkgver}-src.tar.gz -C ${srcdir} || true
|
||||
tar -xzf ${_realname}c-${pkgver}-src.tar.gz || true
|
||||
|
||||
# move embed-manifest crate into rust source vendor directory
|
||||
mv ${srcdir}/embed-manifest-v${embed_manifest_version} ${srcdir}/${_realname}c-${pkgver}-src/vendor/embed-manifest
|
||||
mv embed-manifest-v${embed_manifest_version} ${_realname}c-${pkgver}-src/vendor/embed-manifest
|
||||
|
||||
# 0008-disable-self-contained-for-gnu-targets.patch allows self-contained for non-windows-gnu targets
|
||||
cd ${srcdir}/${_realname}c-${pkgver}-src
|
||||
cd ${_realname}c-${pkgver}-src
|
||||
apply_patch_with_msg \
|
||||
0001-rustc-llvm-fix-libs.patch \
|
||||
0005-win32-config.patch \
|
||||
@@ -125,19 +123,13 @@ prepare() {
|
||||
0004-compiler-Use-wasm-ld-for-wasm-targets.patch
|
||||
fi
|
||||
|
||||
# https://github.com/rust-lang/rust/pull/128977
|
||||
# fix `wasm-component-ld` being built even when it's not enabled. remove after 1.83.0 release
|
||||
apply_patch_with_msg \
|
||||
fix-bootstrap-on-windows.patch
|
||||
|
||||
# update windows-targets to support i686-pc-windows-gnullvm. remove after 1.82.0 release
|
||||
if [[ ${MSYSTEM} == CLANG32 ]]; then
|
||||
cd src/bootstrap
|
||||
cargo update -p windows-targets@0.52.0 --precise 0.52.6
|
||||
fi
|
||||
130034.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
mkdir -p "${srcdir}/${MSYSTEM}" && cd "${srcdir}/${MSYSTEM}"
|
||||
mkdir -p "${MSYSTEM}" && cd "${MSYSTEM}"
|
||||
|
||||
# hack to inject the bootstrap compiler
|
||||
if [[ $_bootstrapping != "no" && $MINGW_PACKAGE_PREFIX == *-clang-aarch64 ]]; then
|
||||
@@ -157,15 +149,9 @@ build() {
|
||||
else
|
||||
# We have to do the following because rust doesn't count x86_64-w64-mingw32 as a target triple
|
||||
export OSTYPE="$CARCH-pc-windows-gnu"
|
||||
|
||||
# Otherwise it uses gcc during bootstrap, even when we build for clang
|
||||
export CARGO_TARGET_${CARCH^^}_PC_WINDOWS_GNU_LINKER="${CC}"
|
||||
fi
|
||||
|
||||
# avoid OOMing in some cases
|
||||
if [[ ${CARCH} == i686 ]]; then
|
||||
LDFLAGS+=" -Wl,--large-address-aware"
|
||||
elif [[ $MINGW_PACKAGE_PREFIX != *-clang-aarch64 ]]; then
|
||||
if [[ $MINGW_PACKAGE_PREFIX != *-clang-aarch64 ]]; then
|
||||
local _unsupported_options="-march=nocona -msahf"
|
||||
# Remove unsupported options for target wasm32-*
|
||||
export CFLAGS="${CFLAGS#$_unsupported_options}"
|
||||
@@ -190,19 +176,19 @@ build() {
|
||||
export MSYS2_ENV_CONV_EXCL='INSTALL_PREFIX'
|
||||
export INSTALL_PREFIX="${MINGW_PREFIX}"
|
||||
export PKGREL="${pkgrel}"
|
||||
envsubst < "${srcdir}/config.toml" > "${srcdir}/${_realname}c-${pkgver}-src/config.toml"
|
||||
envsubst < ../config.toml > "../${_realname}c-${pkgver}-src/config.toml"
|
||||
|
||||
if [ "${_bootstrapping}" = "no" ]; then
|
||||
sed -i '/^\[build\]/,/^$/ s|^#||g' "${srcdir}/${_realname}c-${pkgver}-src/config.toml"
|
||||
sed -i '/^\[build\]/,/^$/ s|^#||g' "../${_realname}c-${pkgver}-src/config.toml"
|
||||
fi
|
||||
# generate debuginfo only for non-i686 targets
|
||||
if check_option "debug" "y" && [ "${CARCH}" != i686 ]; then
|
||||
sed -i 's/^#debug/debug/g' "${srcdir}/${_realname}c-${pkgver}-src/config.toml"
|
||||
sed -i 's/^#debug/debug/g' "../${_realname}c-${pkgver}-src/config.toml"
|
||||
fi
|
||||
|
||||
# Add target wasm32-*
|
||||
if [[ ${CARCH} != i686 ]]; then
|
||||
sed -i '/target = \[/a\ "wasm32-unknown-unknown", "wasm32-wasip1", "wasm32-wasip1-threads", "wasm32-wasip2",' "${srcdir}/${_realname}c-${pkgver}-src/config.toml"
|
||||
sed -i '/target = \[/a\ "wasm32-unknown-unknown", "wasm32-wasip1", "wasm32-wasip1-threads", "wasm32-wasip2",' "../${_realname}c-${pkgver}-src/config.toml"
|
||||
fi
|
||||
|
||||
# Building out of tree is not officially supported so we have to workaround some things like vendored deps
|
||||
@@ -217,26 +203,26 @@ build() {
|
||||
DEP_NGHTTP_ROOT=${MINGW_PREFIX} \
|
||||
DEP_OPENSSL_ROOT=${MINGW_PREFIX} \
|
||||
DEP_Z_ROOT=${MINGW_PREFIX} \
|
||||
DESTDIR="$PWD"/dest-rust ${MINGW_PREFIX}/bin/python ../${_realname}c-${pkgver}-src/x.py install "${_rust_build[@]}"
|
||||
DESTDIR="$PWD"/dest-rust python ../${_realname}c-${pkgver}-src/x.py install "${_rust_build[@]}"
|
||||
|
||||
if [[ ${CARCH} != i686 ]]; then
|
||||
# move wasm32-* targets out of the way for splitting
|
||||
mkdir -p dest-wasm/${MINGW_PREFIX}/lib/rustlib
|
||||
mv dest-rust/${MINGW_PREFIX}/lib/rustlib/wasm32-* dest-wasm/${MINGW_PREFIX}/lib/rustlib
|
||||
mkdir -p dest-wasm${MINGW_PREFIX}/lib/rustlib
|
||||
mv dest-rust${MINGW_PREFIX}/lib/rustlib/wasm32-* dest-wasm${MINGW_PREFIX}/lib/rustlib
|
||||
fi
|
||||
|
||||
# move src out of the way for splitting
|
||||
mv dest-rust/${MINGW_PREFIX}/lib/rustlib/src dest-src
|
||||
mv dest-rust${MINGW_PREFIX}/lib/rustlib/src dest-src
|
||||
|
||||
rm -f dest-rust/${MINGW_PREFIX}/lib/rustlib/$OSTYPE/lib/self-contained/*
|
||||
rm -f dest-rust${MINGW_PREFIX}/lib/rustlib/$OSTYPE/lib/self-contained/*
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "${srcdir}/${MSYSTEM}"
|
||||
cd "${MSYSTEM}"
|
||||
DEP_NGHTTP_ROOT=${MINGW_PREFIX} \
|
||||
DEP_OPENSSL_ROOT=${MINGW_PREFIX} \
|
||||
DEP_Z_ROOT=${MINGW_PREFIX} \
|
||||
${MINGW_PREFIX}/bin/python ../${_realname}c-${pkgver}-src/x.py test --stage 2 --exclude src/test/debuginfo
|
||||
python ../${_realname}c-${pkgver}-src/x.py test --stage 2 --exclude src/test/debuginfo
|
||||
}
|
||||
|
||||
package_rust() {
|
||||
@@ -247,41 +233,42 @@ package_rust() {
|
||||
conflicts=("${MINGW_PACKAGE_PREFIX}-rust-docs")
|
||||
replaces=("${MINGW_PACKAGE_PREFIX}-rust-docs")
|
||||
|
||||
cd "${srcdir}/${MSYSTEM}"
|
||||
cd "${MSYSTEM}"
|
||||
|
||||
cp -a dest-rust/* "$pkgdir"
|
||||
cp -a dest-rust/* "${pkgdir}"
|
||||
|
||||
# delete unnecessary files, e.g. components and manifest files only used for the uninstall script
|
||||
cd "$pkgdir"/${MINGW_PREFIX}/lib/rustlib
|
||||
cd "${pkgdir}${MINGW_PREFIX}/lib/rustlib"
|
||||
rm components install.log manifest-* rust-installer-version uninstall.sh
|
||||
|
||||
install -d "$pkgdir/${MINGW_PREFIX}/share/bash-completion/completions"
|
||||
install -d "${pkgdir}${MINGW_PREFIX}/share/bash-completion/completions"
|
||||
mv "${pkgdir}${MINGW_PREFIX}/etc/bash_completion.d/cargo" \
|
||||
"${pkgdir}${MINGW_PREFIX}/share/bash-completion/completions/cargo"
|
||||
}
|
||||
|
||||
package_rust-wasm() {
|
||||
pkgdesc="WebAssembly targets for Rust"
|
||||
pkgdesc="WebAssembly targets for Rust (mingw-w64)"
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-lld"
|
||||
"${MINGW_PACKAGE_PREFIX}-rust"
|
||||
"${MINGW_PACKAGE_PREFIX}-wasm-component-ld")
|
||||
# object files provided for wasm32-* targets can't be stripped with MSYS2 toolchain
|
||||
options=('!strip')
|
||||
|
||||
cd "${srcdir}/${MSYSTEM}"
|
||||
cd "${MSYSTEM}"
|
||||
|
||||
cp -a dest-wasm/* "$pkgdir"
|
||||
install -Dm644 "${srcdir}"/${_realname}c-${pkgver}-src/LICENSE-APACHE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}-wasm/LICENSE-APACHE"
|
||||
install -Dm644 "${srcdir}"/${_realname}c-${pkgver}-src/LICENSE-MIT "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}-wasm/LICENSE-MIT"
|
||||
cp -a dest-wasm/* "${pkgdir}"
|
||||
install -Dm644 ../${_realname}c-${pkgver}-src/LICENSE-{APACHE,MIT} -t \
|
||||
"${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}-wasm/"
|
||||
}
|
||||
|
||||
package_rust-src() {
|
||||
pkgdesc='Source code for the Rust standard library (mingw-w64)'
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-rust")
|
||||
|
||||
cd "${srcdir}/${MSYSTEM}"
|
||||
install -Dm644 "${srcdir}"/${_realname}c-${pkgver}-src/LICENSE-APACHE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}-src/LICENSE-APACHE"
|
||||
install -Dm644 "${srcdir}"/${_realname}c-${pkgver}-src/LICENSE-MIT "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}-src/LICENSE-MIT"
|
||||
cd "${MSYSTEM}"
|
||||
|
||||
install -Dm644 ../${_realname}c-${pkgver}-src/LICENSE-{APACHE,MIT} -t \
|
||||
"${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}-src/"
|
||||
|
||||
install -d "${pkgdir}${MINGW_PREFIX}/lib/rustlib/"
|
||||
cp -a dest-src "${pkgdir}${MINGW_PREFIX}/lib/rustlib/src"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
profile = "dist"
|
||||
|
||||
# see src/bootstrap/src/utils/change_tracker.rs
|
||||
change-id = 127866
|
||||
change-id = 129295
|
||||
|
||||
[build]
|
||||
#cargo = "$MINGW_PREFIX/bin/cargo.exe"
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs
|
||||
index 56a8528d0a1..b8e862da149 100644
|
||||
--- a/src/bootstrap/src/core/download.rs
|
||||
+++ b/src/bootstrap/src/core/download.rs
|
||||
@@ -706,9 +706,7 @@ pub(crate) fn maybe_download_ci_llvm(&self) {
|
||||
let file_times = fs::FileTimes::new().set_accessed(now).set_modified(now);
|
||||
|
||||
let llvm_config = llvm_root.join("bin").join(exe("llvm-config", self.build));
|
||||
- let llvm_config_file = t!(File::options().write(true).open(llvm_config));
|
||||
-
|
||||
- t!(llvm_config_file.set_times(file_times));
|
||||
+ t!(crate::utils::helpers::set_file_times(llvm_config, file_times));
|
||||
|
||||
if self.should_fix_bins_and_dylibs() {
|
||||
let llvm_lib = llvm_root.join("lib");
|
||||
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
|
||||
index a8555b2c367..da18cc3b3a1 100644
|
||||
--- a/src/bootstrap/src/lib.rs
|
||||
+++ b/src/bootstrap/src/lib.rs
|
||||
@@ -41,7 +41,9 @@
|
||||
use crate::core::config::{DryRun, Target};
|
||||
use crate::core::config::{LlvmLibunwind, TargetSelection};
|
||||
use crate::utils::exec::{command, BehaviorOnFailure, BootstrapCommand, CommandOutput};
|
||||
-use crate::utils::helpers::{self, dir_is_empty, exe, libdir, mtime, output, symlink_dir};
|
||||
+use crate::utils::helpers::{
|
||||
+ self, dir_is_empty, exe, libdir, mtime, output, set_file_times, symlink_dir,
|
||||
+};
|
||||
|
||||
mod core;
|
||||
mod utils;
|
||||
@@ -1737,9 +1739,7 @@ fn copy_link_internal(&self, src: &Path, dst: &Path, dereference_symlinks: bool)
|
||||
let file_times = fs::FileTimes::new()
|
||||
.set_accessed(t!(metadata.accessed()))
|
||||
.set_modified(t!(metadata.modified()));
|
||||
-
|
||||
- let dst_file = t!(fs::File::open(dst));
|
||||
- t!(dst_file.set_times(file_times));
|
||||
+ t!(set_file_times(dst, file_times));
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/bootstrap/src/utils/helpers.rs b/src/bootstrap/src/utils/helpers.rs
|
||||
index 773a873e47c..a0df1ff364e 100644
|
||||
--- a/src/bootstrap/src/utils/helpers.rs
|
||||
+++ b/src/bootstrap/src/utils/helpers.rs
|
||||
@@ -545,3 +545,12 @@ pub fn get_closest_merge_base_commit(
|
||||
|
||||
Ok(output_result(git.as_command_mut())?.trim().to_owned())
|
||||
}
|
||||
+
|
||||
+pub fn set_file_times<P: AsRef<Path>>(path: P, times: fs::FileTimes) -> io::Result<()> {
|
||||
+ let f = if cfg!(windows) {
|
||||
+ fs::File::options().write(true).open(path)?
|
||||
+ } else {
|
||||
+ fs::File::open(path)?
|
||||
+ };
|
||||
+ f.set_times(times)
|
||||
+}
|
||||
Reference in New Issue
Block a user