diff --git a/mingw-w64-rust/0001-add-missing-libs.patch b/mingw-w64-rust/0001-add-missing-libs.patch deleted file mode 100644 index d1becdcdc9667..0000000000000 --- a/mingw-w64-rust/0001-add-missing-libs.patch +++ /dev/null @@ -1,61 +0,0 @@ -From b982d34e1e835a98d2ebacaaa48e6acc75390c0a Mon Sep 17 00:00:00 2001 -From: Mateusz Mikula -Date: Sat, 18 Mar 2017 11:34:24 +0100 -Subject: [PATCH] add missing libs - ---- - src/liballoc_jemalloc/build.rs | 2 +- - src/libpanic_unwind/gcc.rs | 1 + - src/librustc_llvm/ffi.rs | 1 + - src/libunwind/build.rs | 1 + - 4 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs -index 1143df0c63..356265876a 100644 ---- a/src/liballoc_jemalloc/build.rs -+++ b/src/liballoc_jemalloc/build.rs -@@ -178,7 +178,7 @@ fn main() { - println!("cargo:rustc-link-search=native={}/lib", build_dir.display()); - if target.contains("android") { - println!("cargo:rustc-link-lib=gcc"); -- } else if !target.contains("windows") && !target.contains("musl") { -+ } else if !target.contains("musl") { - println!("cargo:rustc-link-lib=pthread"); - } - -diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs -index e8b3a9a42c..916d64d87b 100644 ---- a/src/libpanic_unwind/gcc.rs -+++ b/src/libpanic_unwind/gcc.rs -@@ -302,6 +302,7 @@ unsafe extern "C" fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! { - #[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))] - pub mod eh_frame_registry { - #[link(name = "gcc_eh")] -+ #[link(name = "pthread")] - #[cfg(not(cargobuild))] - extern "C" {} - -diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs -index caa2740408..52738a47f7 100644 ---- a/src/librustc_llvm/ffi.rs -+++ b/src/librustc_llvm/ffi.rs -@@ -1658,4 +1658,5 @@ extern "C" { - // during llvm-config? - #[cfg(windows)] - #[link(name = "ole32")] -+#[link(name = "ffi")] - extern "C" {} -diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs -index db41a368a1..83bbae2f84 100644 ---- a/src/libunwind/build.rs -+++ b/src/libunwind/build.rs -@@ -35,6 +35,7 @@ fn main() { - println!("cargo:rustc-link-lib=gcc_pic"); - } else if target.contains("windows-gnu") { - println!("cargo:rustc-link-lib=gcc_eh"); -+ println!("cargo:rustc-link-lib=pthread"); - } else if target.contains("fuchsia") { - println!("cargo:rustc-link-lib=unwind"); - } --- -2.12.0 diff --git a/mingw-w64-rust/PKGBUILD b/mingw-w64-rust/PKGBUILD index c1fcaed607a90..8a76e4d33c91e 100644 --- a/mingw-w64-rust/PKGBUILD +++ b/mingw-w64-rust/PKGBUILD @@ -1,11 +1,13 @@ # Maintainer: Alexey Pavlov +# Contributor: Martell Malone # Contributor: Zion Nimchuk # Contributor: Mateusz MikuĊ‚a =3.4.3" "${MINGW_PACKAGE_PREFIX}-curl" "${MINGW_PACKAGE_PREFIX}-jemalloc" @@ -26,21 +29,18 @@ makedepends=("bison" options=('!makeflags' 'staticlibs') #install=rust.install source=("https://static.rust-lang.org/dist/${_realname}c-${pkgver}-src.tar.gz" - "git+https://github.com/rust-lang/cargo.git#tag=0.17.0" + "git+https://github.com/rust-lang/cargo.git#tag=0.18.0" "force-curl-rust.patch" - "fix-jemalloc.patch" - "0001-add-missing-libs.patch") -sha256sums=('f966b31eb1cd9bd2df817c391a338eeb5b9253ae0a19bf8a11960c560f96e8b4' + "fix-jemalloc.patch") +sha256sums=('4baba3895b75f2492df6ce5a28a916307ecd1c088dc1fd02dbfa8a8e86174f87' 'SKIP' - '83dee26bafd634eea2a1e630f757a3a38a419157560b4889437ec08d3e5fb9bb' - '7fabd72d1611ef1e46191c245d356d88909ea19062ea6999e1e1a049ebe8784d' - '919976d50c0538e5f240ed85063c3d91cf5720c97c20734ebc14caa74ee554d3') + '24a156ca440a5724a645e428e853d3f1fa09b7ab9dd44a2f9502bf80edb63216' + '7fabd72d1611ef1e46191c245d356d88909ea19062ea6999e1e1a049ebe8784d') prepare() { cd ${srcdir}/${_realname}c-${pkgver}-src patch -p1 -i "${srcdir}/force-curl-rust.patch" patch -p1 -i "${srcdir}/fix-jemalloc.patch" - patch -p1 -i "${srcdir}/0001-add-missing-libs.patch" cd ${srcdir}/cargo @@ -64,7 +64,6 @@ build() { --target=$OSTYPE \ --release-channel=stable \ --enable-ninja \ - --enable-local-rust \ --disable-codegen-tests \ --jemalloc-root=${MINGW_PREFIX}/lib \ --local-rust-root=$(cygpath -m ${MINGW_PREFIX}) diff --git a/mingw-w64-rust/force-curl-cargo.patch b/mingw-w64-rust/force-curl-cargo.patch deleted file mode 100644 index 413e714aead1d..0000000000000 --- a/mingw-w64-rust/force-curl-cargo.patch +++ /dev/null @@ -1,24 +0,0 @@ -commit 7be5e15a12b89168e4d096348848eaa9a9534858 -Author: Zion Nimchuk -Date: Fri Oct 14 22:45:53 2016 -0700 - - Force download to use curl, not powershell - -diff --git a/src/etc/download.py b/src/etc/download.py -index 5ef0df3..9374262 100644 ---- a/src/etc/download.py -+++ b/src/etc/download.py -@@ -7,12 +7,7 @@ import tarfile - - def get(url, path, quiet=False): - # see http://serverfault.com/questions/301128/how-to-download -- if sys.platform == 'win32': -- run(["PowerShell.exe", "/nologo", "-Command", -- "(New-Object System.Net.WebClient).DownloadFile('" + url + -- "', '" + path + "')"], quiet=quiet) -- else: -- run(["curl", "-o", path, url], quiet=quiet) -+ run(["curl", "-o", path, url], quiet=quiet) - - - def unpack(tarball, dst, quiet=False, strip=0): diff --git a/mingw-w64-rust/force-curl-rust.patch b/mingw-w64-rust/force-curl-rust.patch index c091a731ee464..1d83c167f0b22 100644 --- a/mingw-w64-rust/force-curl-rust.patch +++ b/mingw-w64-rust/force-curl-rust.patch @@ -1,9 +1,9 @@ diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py -index 17a7c9c..4e3ca0d 100644 +index 3233a73b00..b506f84f19 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py -@@ -61,13 +61,6 @@ - def download(path, url, probably_big, verbose): +@@ -72,14 +72,21 @@ def download(path, url, probably_big, verbose): + def _download(path, url, probably_big, verbose, exception): if probably_big or verbose: print("downloading {}".format(url)) - # see http://serverfault.com/questions/301128/how-to-download @@ -11,8 +11,24 @@ index 17a7c9c..4e3ca0d 100644 - run(["PowerShell.exe", "/nologo", "-Command", - "(New-Object System.Net.WebClient)" - ".DownloadFile('{}', '{}')".format(url, path)], -- verbose=verbose) +- verbose=verbose, +- exception=exception) - else: ++ try: ++ default_encoding = sys.getdefaultencoding() ++ subprocess.check_output(['uname', '-s']).strip().decode(default_encoding) ++ except (subprocess.CalledProcessError, OSError): ++ # see http://serverfault.com/questions/301128/how-to-download ++ if sys.platform == 'win32': ++ run(["PowerShell.exe", "/nologo", "-Command", ++ "(New-Object System.Net.WebClient)" ++ ".DownloadFile('{}', '{}')".format(url, path)], ++ verbose=verbose, ++ exception=exception) ++ return ++ else: ++ raise Exception(err) ++ sys.exit(err) if probably_big or verbose: option = "-#" else: