lang/rust: Update to 1.29.0

Release notes:
* https://blog.rust-lang.org/2018/07/20/Rust-1.27.2.html
* https://blog.rust-lang.org/2018/08/02/Rust-1.28.html
* https://blog.rust-lang.org/2018/09/13/Rust-1.29.html

Up to and including Rust 1.27.x, the Rust build system shelled out to
a configure script to detect the presence and usability of libunwind.
Since Rust 1.28.0, it's using a static result in a `build.rs` file and
expects libunwind to be used. It was not the case on FreeBSD so far, so
we need a patch to this `build.rs` to disable that. We still need to
study if the FreeBSD port should use libunwind and what to do with this
patch. But this problem prevented the update to Rust 1.28.0 already, so
enough delay.

The update also comes with a patch to a few `USE_GECKO`-based ports such
as Firefox [1]. Their configure script has some asumptions on the output
of `rustc --print target-list` which are not true anymore. The patch was
already committed upstream.

The aarch64 version is still marked as BROKEN because I didn't find the
time to work on it. As a consequence, there is also no aarch64 bootstrap
for Rust 1.29.0.

PR:		229826
Approved by:	jbeich [1]
Obtained from:	https://bugzilla.mozilla.org/show_bug.cgi?id=1479540 [1]
Differential Revision:	https://reviews.freebsd.org/D17178
This commit is contained in:
Jean-Sébastien Pédron
2018-09-16 07:57:08 +00:00
parent 6a457e5a10
commit aa8061d1c1
8 changed files with 181 additions and 49 deletions

View File

@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= rust
PORTVERSION?= 1.27.1
PORTVERSION?= 1.29.0
PORTREVISION?=
CATEGORIES= lang
MASTER_SITES= http://static.rust-lang.org/dist/:src \
@@ -46,13 +46,13 @@ BROKEN_aarch64= fails to build: bootstrap compiler crashes
CONFLICTS_INSTALL?= rust-nightly
# See WRKSRC/src/stage0.txt for this date and version values.
BOOTSTRAPS_DATE?= 2018-05-10
BOOTSTRAPS_DATE?= 2018-08-02
RUST_BOOTSTRAP_VERSION?= 1.26.0
RUST_BOOTSTRAP_VERSION?= 1.28.0
RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
CARGO_BOOTSTRAP_VERSION?= 0.27.0
CARGO_BOOTSTRAP_VERSION?= 0.29.0
CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
RUST_CHANNEL= ${PKGNAMESUFFIX:Ustable:S/^-//}
@@ -80,6 +80,7 @@ LLNEXTGEN_BUILD_DEPENDS= LLnextgen:devel/llnextgen
# - pre-install to cleanup the ${STAGEDIR}
# - post-install to populate the ${TMPPLIST}
RUST_MANIFESTS= lib/rustlib/manifest-cargo \
lib/rustlib/manifest-clippy-preview \
lib/rustlib/manifest-rls-preview \
lib/rustlib/manifest-rustc \
lib/rustlib/manifest-rustfmt-preview \
@@ -191,6 +192,13 @@ CCACHE_VALUE= "${CCACHE_WRAPPER_PATH:C,/libexec/ccache$,,}/bin/ccache"
CCACHE_VALUE= false
.endif
pre-configure:
@for file in \
${WRKSRC}/src/vendor/backtrace-sys/src/libbacktrace/configure \
${WRKSRC}/src/vendor/backtrace-sys/src/libbacktrace/config/libtool.m4; do \
mv "$$file" "$$file.dont-fix"; \
done
do-configure:
${SED} -E \
-e 's,%PREFIX%,${PREFIX},' \
@@ -220,6 +228,13 @@ do-configure:
fi; \
done
post-configure:
@for file in \
${WRKSRC}/src/vendor/backtrace-sys/src/libbacktrace/configure \
${WRKSRC}/src/vendor/backtrace-sys/src/libbacktrace/config/libtool.m4; do \
mv "$$file.dont-fix" "$$file"; \
done
post-configure-DOCS-on:
${REINPLACE_CMD} -e 's,%DOCS%,true,' ${WRKSRC}/config.toml
@@ -305,7 +320,9 @@ post-install:
# but they contain non-object files which make strip(1) unhappy.
@${STRIP_CMD} \
${STAGEDIR}${PREFIX}/bin/cargo \
${STAGEDIR}${PREFIX}/bin/cargo-clippy \
${STAGEDIR}${PREFIX}/bin/cargo-fmt \
${STAGEDIR}${PREFIX}/bin/clippy-driver \
${STAGEDIR}${PREFIX}/bin/rls \
${STAGEDIR}${PREFIX}/bin/rustc \
${STAGEDIR}${PREFIX}/bin/rustdoc \

View File

@@ -1,21 +1,15 @@
TIMESTAMP = 1531989867
SHA256 (rust/rustc-1.27.1-src.tar.xz) = 948e2645057960ee1c03d9f0e8f78133a5f73d9ca9a24bc56126e395a212d25c
SIZE (rust/rustc-1.27.1-src.tar.xz) = 55458892
SHA256 (rust/2018-05-10/rustc-1.26.0-aarch64-unknown-freebsd.tar.gz) = 74e87fe6b29fe56a353f045f8b0c1069c55e2fea8bd9e2d5da44606fdbcee362
SIZE (rust/2018-05-10/rustc-1.26.0-aarch64-unknown-freebsd.tar.gz) = 62636938
SHA256 (rust/2018-05-10/rust-std-1.26.0-aarch64-unknown-freebsd.tar.gz) = 73180f8ddde7e56622f596d9167beae0a1ab548bd5bf258cee276fdc87f30dca
SIZE (rust/2018-05-10/rust-std-1.26.0-aarch64-unknown-freebsd.tar.gz) = 62613320
SHA256 (rust/2018-05-10/cargo-0.27.0-aarch64-unknown-freebsd.tar.gz) = 6cc48fd7a2d04ff151d7399c536d2e6a4cd37a7cd51ced67bb6978121b4bc3cb
SIZE (rust/2018-05-10/cargo-0.27.0-aarch64-unknown-freebsd.tar.gz) = 4349432
SHA256 (rust/2018-05-10/rustc-1.26.0-x86_64-unknown-freebsd.tar.gz) = 9499ce5b68d631f8345c387e1f59b21892d97e0acb5650deb61a34719310bd38
SIZE (rust/2018-05-10/rustc-1.26.0-x86_64-unknown-freebsd.tar.gz) = 64672199
SHA256 (rust/2018-05-10/rust-std-1.26.0-x86_64-unknown-freebsd.tar.gz) = 38cd138eba2ccaff59513d154fec580b6663ca6ef38cd620c348364aa1e11a40
SIZE (rust/2018-05-10/rust-std-1.26.0-x86_64-unknown-freebsd.tar.gz) = 64727651
SHA256 (rust/2018-05-10/cargo-0.27.0-x86_64-unknown-freebsd.tar.gz) = ee0e709f26f14be1cf88a8fdff50063b78d33bb73d8e343aad7b2562a5730249
SIZE (rust/2018-05-10/cargo-0.27.0-x86_64-unknown-freebsd.tar.gz) = 5905896
SHA256 (rust/2018-05-10/rustc-1.26.0-i686-unknown-freebsd.tar.gz) = 11111cb60c00bc6e5ea27a0748068d3f2430809d2a3a7f8554750c24d1a728a9
SIZE (rust/2018-05-10/rustc-1.26.0-i686-unknown-freebsd.tar.gz) = 65599090
SHA256 (rust/2018-05-10/rust-std-1.26.0-i686-unknown-freebsd.tar.gz) = 549129f86701a8968b411b0c39e296312b2a3a0b3a8c221865d876b72f265972
SIZE (rust/2018-05-10/rust-std-1.26.0-i686-unknown-freebsd.tar.gz) = 65229010
SHA256 (rust/2018-05-10/cargo-0.27.0-i686-unknown-freebsd.tar.gz) = 438288ab5e28ffff96d2a4aeaaf656f7388cbc4b6706ad9e7423301089d615da
SIZE (rust/2018-05-10/cargo-0.27.0-i686-unknown-freebsd.tar.gz) = 5671969
TIMESTAMP = 1536871544
SHA256 (rust/rustc-1.29.0-src.tar.xz) = 3943da98fb478a336ede7404e42ff76ef6ba4fc2b82012cfccd6b9fc4bd2c191
SIZE (rust/rustc-1.29.0-src.tar.xz) = 61938668
SHA256 (rust/2018-08-02/rustc-1.28.0-x86_64-unknown-freebsd.tar.gz) = 5eeaa17844f87e59aab821dc98dd15a920df0d1d7da3ef5808d2c586331c92a7
SIZE (rust/2018-08-02/rustc-1.28.0-x86_64-unknown-freebsd.tar.gz) = 65434056
SHA256 (rust/2018-08-02/rust-std-1.28.0-x86_64-unknown-freebsd.tar.gz) = 1fabaf71d21c1cdcddfb564950152ef862b519a175f7ee88d7e22bab31c4733e
SIZE (rust/2018-08-02/rust-std-1.28.0-x86_64-unknown-freebsd.tar.gz) = 66920885
SHA256 (rust/2018-08-02/cargo-0.29.0-x86_64-unknown-freebsd.tar.gz) = b61f65929d40a0bf08ae37274192e32e14dd455667881c09b680234c6b684a89
SIZE (rust/2018-08-02/cargo-0.29.0-x86_64-unknown-freebsd.tar.gz) = 6836676
SHA256 (rust/2018-08-02/rustc-1.28.0-i686-unknown-freebsd.tar.gz) = 9de3c2e0e4ff054628597183bbf25629aa68c0e411069048d7e9be4514487315
SIZE (rust/2018-08-02/rustc-1.28.0-i686-unknown-freebsd.tar.gz) = 66458301
SHA256 (rust/2018-08-02/rust-std-1.28.0-i686-unknown-freebsd.tar.gz) = 6765ff30ef047d03b6b8107c8aa1b8388f1877d991a0a5c315764808cce03bf1
SIZE (rust/2018-08-02/rust-std-1.28.0-i686-unknown-freebsd.tar.gz) = 67392915
SHA256 (rust/2018-08-02/cargo-0.29.0-i686-unknown-freebsd.tar.gz) = e553f1ee3867017fd53efe2f0e5b10fbb8ff43ce801ee70fd38bdfabfb8b6799
SIZE (rust/2018-08-02/cargo-0.29.0-i686-unknown-freebsd.tar.gz) = 6654215

View File

@@ -0,0 +1,22 @@
--- src/libstd/build.rs.orig 2018-09-03 18:29:12 UTC
+++ src/libstd/build.rs
@@ -94,13 +94,18 @@ fn build_libbacktrace(target: &str) -> Result<(), ()>
.out_dir(&native.out_dir)
.warnings(false)
.file("../libbacktrace/alloc.c")
- .file("../libbacktrace/backtrace.c")
.file("../libbacktrace/dwarf.c")
.file("../libbacktrace/fileline.c")
.file("../libbacktrace/posix.c")
.file("../libbacktrace/read.c")
.file("../libbacktrace/sort.c")
.file("../libbacktrace/state.c");
+
+ if target.contains("freebsd") {
+ build.file("../libbacktrace/nounwind.c");
+ } else {
+ build.file("../libbacktrace/backtrace.c");
+ }
if target.contains("darwin") {
build.file("../libbacktrace/macho.c");

View File

@@ -1,12 +0,0 @@
--- src/vendor/libgit2-sys/libgit2/src/streams/openssl.c.orig 2018-05-07 18:50:07 UTC
+++ src/vendor/libgit2-sys/libgit2/src/streams/openssl.c
@@ -104,7 +104,8 @@ int git_openssl_stream_global_init(void)
ssl_opts |= SSL_OP_NO_COMPRESSION;
#endif
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
SSL_load_error_strings();
OpenSSL_add_ssl_algorithms();
#else

View File

@@ -1,12 +0,0 @@
--- src/vendor/libgit2-sys/libgit2/src/streams/openssl.h.orig 2018-05-07 18:50:07 UTC
+++ src/vendor/libgit2-sys/libgit2/src/streams/openssl.h
@@ -31,7 +31,8 @@ extern int git_openssl__set_cert_location(const char *
-# if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+# if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
GIT_INLINE(BIO_METHOD*) BIO_meth_new(int type, const char *name)
{

View File

@@ -0,0 +1,41 @@
# HG changeset patch
# User Chris Manchester <cmanchester@mozilla.com>
# Date 1533063488 25200
# Node ID 36f4ba2fb6f5139b7942e81554190354da1f369a
# Parent ff18e94c90460faa9cca8ff39a0ea4876b0c2039
Bug 1479540 - Accept "triplet" strings with only two parts in moz.configure. r=froydnj
MozReview-Commit-ID: 7pFhoJgBMhQ
--- build/moz.configure/init.configure
+++ build/moz.configure/init.configure
@@ -587,17 +587,26 @@ option('--target', nargs=1,
@imports(_from='__builtin__', _import='KeyError')
@imports(_from='__builtin__', _import='ValueError')
def split_triplet(triplet, allow_unknown=False):
# The standard triplet is defined as
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# There is also a quartet form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# But we can consider the "KERNEL-OPERATING_SYSTEM" as one.
- cpu, manufacturer, os = triplet.split('-', 2)
+ # Additionally, some may omit "unknown" when the manufacturer
+ # is not specified and emit
+ # CPU_TYPE-OPERATING_SYSTEM
+ parts = triplet.split('-', 2)
+ if len(parts) == 3:
+ cpu, _, os = parts
+ elif len(parts) == 2:
+ cpu, os = parts
+ else:
+ die("Unexpected triplet string: %s" % triplet)
# Autoconf uses config.sub to validate and canonicalize those triplets,
# but the granularity of its results has never been satisfying to our
# use, so we've had our own, different, canonicalization. We've also
# historically not been very consistent with how we use the canonicalized
# values. Hopefully, this will help us make things better.
# The tests are inherited from our decades-old autoconf-based configure,
# which can probably be improved/cleaned up because they are based on a

View File

@@ -0,0 +1,41 @@
# HG changeset patch
# User Chris Manchester <cmanchester@mozilla.com>
# Date 1533063488 25200
# Node ID 36f4ba2fb6f5139b7942e81554190354da1f369a
# Parent ff18e94c90460faa9cca8ff39a0ea4876b0c2039
Bug 1479540 - Accept "triplet" strings with only two parts in moz.configure. r=froydnj
MozReview-Commit-ID: 7pFhoJgBMhQ
--- build/moz.configure/init.configure
+++ build/moz.configure/init.configure
@@ -587,17 +587,26 @@ option('--target', nargs=1,
@imports(_from='__builtin__', _import='KeyError')
@imports(_from='__builtin__', _import='ValueError')
def split_triplet(triplet, allow_unknown=False):
# The standard triplet is defined as
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# There is also a quartet form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# But we can consider the "KERNEL-OPERATING_SYSTEM" as one.
- cpu, manufacturer, os = triplet.split('-', 2)
+ # Additionally, some may omit "unknown" when the manufacturer
+ # is not specified and emit
+ # CPU_TYPE-OPERATING_SYSTEM
+ parts = triplet.split('-', 2)
+ if len(parts) == 3:
+ cpu, _, os = parts
+ elif len(parts) == 2:
+ cpu, os = parts
+ else:
+ die("Unexpected triplet string: %s" % triplet)
# Autoconf uses config.sub to validate and canonicalize those triplets,
# but the granularity of its results has never been satisfying to our
# use, so we've had our own, different, canonicalization. We've also
# historically not been very consistent with how we use the canonicalized
# values. Hopefully, this will help us make things better.
# The tests are inherited from our decades-old autoconf-based configure,
# which can probably be improved/cleaned up because they are based on a

View File

@@ -0,0 +1,41 @@
# HG changeset patch
# User Chris Manchester <cmanchester@mozilla.com>
# Date 1533063488 25200
# Node ID 36f4ba2fb6f5139b7942e81554190354da1f369a
# Parent ff18e94c90460faa9cca8ff39a0ea4876b0c2039
Bug 1479540 - Accept "triplet" strings with only two parts in moz.configure. r=froydnj
MozReview-Commit-ID: 7pFhoJgBMhQ
--- build/moz.configure/init.configure
+++ build/moz.configure/init.configure
@@ -587,17 +587,26 @@ option('--target', nargs=1,
@imports(_from='__builtin__', _import='KeyError')
@imports(_from='__builtin__', _import='ValueError')
def split_triplet(triplet, allow_unknown=False):
# The standard triplet is defined as
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# There is also a quartet form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# But we can consider the "KERNEL-OPERATING_SYSTEM" as one.
- cpu, manufacturer, os = triplet.split('-', 2)
+ # Additionally, some may omit "unknown" when the manufacturer
+ # is not specified and emit
+ # CPU_TYPE-OPERATING_SYSTEM
+ parts = triplet.split('-', 2)
+ if len(parts) == 3:
+ cpu, _, os = parts
+ elif len(parts) == 2:
+ cpu, os = parts
+ else:
+ die("Unexpected triplet string: %s" % triplet)
# Autoconf uses config.sub to validate and canonicalize those triplets,
# but the granularity of its results has never been satisfying to our
# use, so we've had our own, different, canonicalization. We've also
# historically not been very consistent with how we use the canonicalized
# values. Hopefully, this will help us make things better.
# The tests are inherited from our decades-old autoconf-based configure,
# which can probably be improved/cleaned up because they are based on a