From 706daae6b5b880201d00dae7d84909264d2f6cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 15 Jul 2023 22:47:37 +0200 Subject: [PATCH] Rust: disable mingw packaging via configuration option --- mingw-w64-rust/0004-unbundle-gcc.patch | 46 ------------------- .../0008-disable-self-contained.patch | 13 ------ mingw-w64-rust/PKGBUILD | 22 +++------ 3 files changed, 7 insertions(+), 74 deletions(-) delete mode 100644 mingw-w64-rust/0004-unbundle-gcc.patch delete mode 100644 mingw-w64-rust/0008-disable-self-contained.patch diff --git a/mingw-w64-rust/0004-unbundle-gcc.patch b/mingw-w64-rust/0004-unbundle-gcc.patch deleted file mode 100644 index d2185135e9969..0000000000000 --- a/mingw-w64-rust/0004-unbundle-gcc.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- rustc-1.62.0-src/src/bootstrap/dist.rs.orig 2022-06-27 15:37:07.000000000 +0200 -+++ rustc-1.62.0-src/src/bootstrap/dist.rs 2022-06-30 20:37:45.959726200 +0200 -@@ -113,6 +113,7 @@ - } - } - -+#[allow(dead_code)] - fn find_files(files: &[&str], path: &[PathBuf]) -> Vec { - let mut found = Vec::with_capacity(files.len()); - -@@ -129,6 +130,7 @@ - found - } - -+#[allow(dead_code)] - fn make_win_dist( - rust_root: &Path, - plat_root: &Path, -@@ -296,7 +298,7 @@ - // thrown away (this contains the runtime DLLs included in the rustc package - // above) and the second argument is where to place all the MinGW components - // (which is what we want). -- make_win_dist(&tmpdir(builder), tarball.image_dir(), host, &builder); -+ // make_win_dist(&tmpdir(builder), tarball.image_dir(), host, &builder); - - Some(tarball.generate()) - } -@@ -342,7 +344,7 @@ - // install will *also* include the rust-mingw package, which also needs - // licenses, so to be safe we just include it here in all MinGW packages. - if host.ends_with("pc-windows-gnu") && builder.config.dist_include_mingw_linker { -- make_win_dist(tarball.image_dir(), &tmpdir(builder), host, builder); -+ // make_win_dist(tarball.image_dir(), &tmpdir(builder), host, builder); - tarball.add_dir(builder.src.join("src/etc/third-party"), "share/doc"); - } - ---- rustc-1.29.2-src/src/bootstrap/lib.rs.orig 2018-10-29 07:40:35.561580700 +0300 -+++ rustc-1.29.2-src/src/bootstrap/lib.rs 2018-10-29 07:45:54.426140700 +0300 -@@ -1278,6 +1278,7 @@ - } - } - -+ #[allow(dead_code)] - fn copy_to_folder(&self, src: &Path, dest_folder: &Path) { - let file_name = src.file_name().unwrap(); - let dest = dest_folder.join(file_name); diff --git a/mingw-w64-rust/0008-disable-self-contained.patch b/mingw-w64-rust/0008-disable-self-contained.patch deleted file mode 100644 index ce8f3ff9848a8..0000000000000 --- a/mingw-w64-rust/0008-disable-self-contained.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- rustc-1.65.0-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2022-11-02 15:36:24.000000000 +0100 -+++ rustc-1.65.0-src/compiler/rustc_codegen_ssa/src/back/link.rs 2022-11-04 16:02:23.846112700 +0100 -@@ -1573,7 +1573,10 @@ - /// Various toolchain components used during linking are used from rustc distribution - /// instead of being found somewhere on the host system. - /// We only provide such support for a very limited number of targets. -+#[allow(warnings)] - fn self_contained(sess: &Session, crate_type: CrateType) -> bool { -+ return false; -+ - if let Some(self_contained) = sess.opts.cg.link_self_contained { - return self_contained; - } diff --git a/mingw-w64-rust/PKGBUILD b/mingw-w64-rust/PKGBUILD index 4069095e42570..b397b7b1f94bf 100644 --- a/mingw-w64-rust/PKGBUILD +++ b/mingw-w64-rust/PKGBUILD @@ -12,7 +12,7 @@ pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-rust-docs") pkgver=1.71.0 -pkgrel=1 +pkgrel=2 pkgdesc="Systems programming language focused on safety, speed and concurrency (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32') @@ -35,19 +35,17 @@ options=('staticlibs' 'strip') noextract=(${_realname}c-${pkgver}-src.tar.gz) source=("https://static.rust-lang.org/dist/${_realname}c-${pkgver}-src.tar.gz"{,.asc} "0001-rustc-llvm-fix-libs.patch" - "0004-unbundle-gcc.patch" "0005-win32-config.patch" "0007-clang-subsystem.patch" - "0008-disable-self-contained.patch" - "0011-disable-uac-for-installer.patch") + "0011-disable-uac-for-installer.patch" + "https://github.com/rust-lang/rust/commit/cf4fcf82e17987949f422b8a26ae8425f87f4022.patch") sha256sums=('a667e4abdc5588ebfea35c381e319d840ffbf8d2dbfb79771730573642034c96' 'SKIP' '7cb1773c288ffb1c1e751edc49b1890c84bf9c362742bc5225d19d474edb73a0' - '15d897850d474afd004b071926a81f1f72b13330d0b56d565090b10f868cc766' '7d1c4e49524b835a8eadc961b39f5594b12a522a1e24368999be2c7e85399e4e' '3388c413fffeeaa84f775a176b1653b360ffba7b0c0a6f5baa0c3a95aec8827a' - 'a214cd8394ab7416fd170c7fa05daf701a5357d38e4e54149370e6efff208e50' - '951f6278ce661136912be343ef50047ef46c409313050c711978651b301e80dd') + '951f6278ce661136912be343ef50047ef46c409313050c711978651b301e80dd' + 'b93c75580caadee58ff28601d8ed4aa83e9ba37f3aa2dd7215e09f71cdee3fe6') validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE' # Rust Language (Tag and Release Signing Key) '474E22316ABF4785A88C6E8EA2C794A986419D8A' # Tom Stellard 'B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg @@ -59,9 +57,6 @@ if [[ $_bootstrapping != "no" && $MINGW_PACKAGE_PREFIX == *-clang-aarch64 ]]; th source+=("https://github.com/mati865/rust-gnullvm-builds/releases/download/${_stage0version}-v2/cargo-${_stage0version}-dev-aarch64-pc-windows-gnullvm.tar.xz" "https://github.com/mati865/rust-gnullvm-builds/releases/download/${_stage0version}-v2/rust-std-${_stage0version}-dev-aarch64-pc-windows-gnullvm.tar.xz" "https://github.com/mati865/rust-gnullvm-builds/releases/download/${_stage0version}-v2/rustc-${_stage0version}-dev-aarch64-pc-windows-gnullvm.tar.xz") - sha256sums+=('5a72ff6d89277c96f72cb7de7f35c4a3b4686b3dc6ea0d4966883e83179db0a8' - '0a5087acf06faa2a02ff7f41afb7be42b22575a2ff0b3f790b6bb64418f3ea5d' - '96c7877b4821fe7bb4aaa35aa8f2056d19d622902d6583d0aef8a35f3fef8dbb') noextract+=("cargo-${_stage0version}-dev-aarch64-pc-windows-gnullvm.tar.xz" "rust-std-${_stage0version}-dev-aarch64-pc-windows-gnullvm.tar.xz" "rustc-${_stage0version}-dev-aarch64-pc-windows-gnullvm.tar.xz") @@ -85,9 +80,8 @@ prepare() { cd ${srcdir}/${_realname}c-${pkgver}-src apply_patch_with_msg \ 0001-rustc-llvm-fix-libs.patch \ - 0004-unbundle-gcc.patch \ 0005-win32-config.patch \ - 0008-disable-self-contained.patch + cf4fcf82e17987949f422b8a26ae8425f87f4022.patch if [[ $MINGW_PACKAGE_PREFIX == *-clang-i686 || $MINGW_PACKAGE_PREFIX == *-clang-x86_64 ]]; then apply_patch_with_msg \ @@ -171,6 +165,7 @@ build() { --enable-extended \ --disable-llvm-static-stdcpp \ --disable-codegen-tests \ + --set='dist.include-mingw-linker=false' \ --llvm-root=${MINGW_PREFIX} \ --python=${MINGW_PREFIX}/bin/python \ "${_rust_conf[@]}" @@ -190,9 +185,6 @@ build() { # move docs out of the way for splitting mv dest-rust/${MINGW_PREFIX}/share/doc dest-doc - rm -f dest-rust/${MINGW_PREFIX}/bin/libgcc*.dll - rm -f dest-rust/${MINGW_PREFIX}/bin/libstd*.dll - rm -f dest-rust/${MINGW_PREFIX}/bin/libwinpthread*.dll rm -f dest-rust/${MINGW_PREFIX}/lib/rustlib/$OSTYPE/lib/self-contained/* }