Skip to content

rust: Update to 1.18.0 #2448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions mingw-w64-rust/0001-add-missing-libs.patch

This file was deleted.

32 changes: 32 additions & 0 deletions mingw-w64-rust/0001-bootstrap-use-stable-release-for-stage0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From f3b4afc073e0f96ee80297bbeb18396433dbcf34 Mon Sep 17 00:00:00 2001
From: Martell Malone <[email protected]>
Date: Wed, 14 Jun 2017 01:36:09 +0100
Subject: [PATCH] bootstrap: use stable release for stage0


diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 6cd9496b7a..644eb6f0f4 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -201,7 +201,7 @@ class RustBuild(object):
if self.cargo().startswith(self.bin_root()) and \
(not os.path.exists(self.cargo()) or self.cargo_out_of_date()):
self.print_what_it_means_to_bootstrap()
- filename = "cargo-{}-{}.tar.gz".format('0.18.0', self.build)
+ filename = "cargo-{}-{}.tar.gz".format('0.19.0', self.build)
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
tarball = os.path.join(rustc_cache, filename)
if not os.path.exists(tarball):
diff --git a/src/stage0.txt b/src/stage0.txt
index 38cbfa0dec..75b3cb86e0 100644
--- a/src/stage0.txt
+++ b/src/stage0.txt
@@ -12,4 +12,4 @@
# tarball for a stable release you'll likely see `1.x.0-$date` where `1.x.0` was
# released on `$date`

-rustc: 1.17.0-2017-04-27
+rustc: 1.18.0-2017-06-08
--
2.13.0

34 changes: 21 additions & 13 deletions mingw-w64-rust/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Maintainer: Alexey Pavlov <[email protected]>
# Contributor: Martell Malone <[email protected]>
# Contributor: Zion Nimchuk <[email protected]>
# Contributor: Mateusz Mikuła <[email protected]


_realname=rust
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.16.0
pkgver=1.18.0
pkgrel=1
pkgdesc="Systems programming language focused on safety, speed and concurrency (mingw-w64)"
arch=('any')
Expand All @@ -15,8 +17,11 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
makedepends=("bison"
"flex"
"git"
"diffutils"
"${MINGW_PACKAGE_PREFIX}-cmake>=3.4.3"
"${MINGW_PACKAGE_PREFIX}-curl"
"${MINGW_PACKAGE_PREFIX}-libgit2"
"${MINGW_PACKAGE_PREFIX}-llvm>=4.0.0"
"${MINGW_PACKAGE_PREFIX}-jemalloc"
"${MINGW_PACKAGE_PREFIX}-libffi"
"${MINGW_PACKAGE_PREFIX}-libssh2"
Expand All @@ -26,21 +31,21 @@ 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.19.0"
"force-curl-rust.patch"
"fix-jemalloc.patch"
"0001-add-missing-libs.patch")
sha256sums=('f966b31eb1cd9bd2df817c391a338eeb5b9253ae0a19bf8a11960c560f96e8b4'
"0001-bootstrap-use-stable-release-for-stage0.patch")
sha256sums=('d2dc36e99b9e2269488b2bcddde43c234e6bde03edf70cba82a027ff49c36111'
'SKIP'
'83dee26bafd634eea2a1e630f757a3a38a419157560b4889437ec08d3e5fb9bb'
'24a156ca440a5724a645e428e853d3f1fa09b7ab9dd44a2f9502bf80edb63216'
'7fabd72d1611ef1e46191c245d356d88909ea19062ea6999e1e1a049ebe8784d'
'919976d50c0538e5f240ed85063c3d91cf5720c97c20734ebc14caa74ee554d3')
'3c56719f4fec822277d37f0c56aef230e4b8033e005d538037da4632cdc064ba')

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"
patch -p1 -i "${srcdir}/0001-bootstrap-use-stable-release-for-stage0.patch"

cd ${srcdir}/cargo

Expand All @@ -64,13 +69,14 @@ 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})
# LLVM 4.0 is unsupported
#--llvm-root=${MINGW_PREFIX} \
--local-rust-root=$(cygpath -m ${MINGW_PREFIX}) \
--enable-local-rust \
--llvm-root=${MINGW_PREFIX}

# This export is hacky and should only be used with --enable-local-rust and --llvm-root
# When bootstrapping please comment out the last 2 lines above and the export
export RUSTFLAGS="-lffi -lgcc_eh -lpthread"
python2 ../${_realname}c-${pkgver}-src/x.py build
}
Expand All @@ -88,6 +94,7 @@ package() {

rm -f ${pkgdir}${MINGW_PREFIX}/bin/libgcc*.dll
rm -f ${pkgdir}${MINGW_PREFIX}/bin/libstd*.dll
rm -f ${pkgdir}${MINGW_PREFIX}/bin/libwinpthread*.dll

install -Dm644 ${srcdir}/${_realname}c-${pkgver}-src/LICENSE-APACHE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE-APACHE"
install -Dm644 ${srcdir}/${_realname}c-${pkgver}-src/LICENSE-MIT "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE-MIT"
Expand All @@ -99,13 +106,14 @@ package() {

OSTYPE="$CARCH-pc-windows-gnu"

export LIBGIT2_SYS_USE_PKG_CONFIG=1
../cargo/configure --local-rust-root=${pkgdir}${MINGW_PREFIX} --prefix=${MINGW_PREFIX} --build=$OSTYPE --host=$OSTYPE --target=$OSTYPE --enable-optimize
make
make LIBGIT2_SYS_USE_PKG_CONFIG=1

# Install cargo
cd "${srcdir}/build-cargo-${MINGW_CHOST}"

make DESTDIR="${pkgdir}" install
make LIBGIT2_SYS_USE_PKG_CONFIG=1 DESTDIR="${pkgdir}" install

install -d "$pkgdir${MINGW_PREFIX}/share/bash-completion/completions"
mv "${pkgdir}${MINGW_PREFIX}/etc/bash_completion.d/cargo" \
Expand Down
24 changes: 0 additions & 24 deletions mingw-w64-rust/force-curl-cargo.patch

This file was deleted.

24 changes: 20 additions & 4 deletions mingw-w64-rust/force-curl-rust.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
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
- if sys.platform == 'win32':
- 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: