aboutsummaryrefslogtreecommitdiffstats
path: root/community/rust
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-05-20 15:08:41 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-05-20 16:46:01 +0200
commit33def910d7e8168c0b5a6a13cfb5910f17a02440 (patch)
tree7f03646d34b13e55693cdc3442d6c4537cf21af8 /community/rust
parent42fb798cb5dd5bc2cea1278a7fc0e49bffbba8a3 (diff)
downloadaports-33def910d7e8168c0b5a6a13cfb5910f17a02440.tar.bz2
aports-33def910d7e8168c0b5a6a13cfb5910f17a02440.tar.xz
community/rust: build cargo and add cargo* subpackages
Cargo is now distributed together with rustc. Upstream has removed Cargo.lock from the cargo's repository in cargo 0.23.0, so we can't build it with locked and freezed dependencies separately anymore. alexcrichton replied on Feb 1: > cargo is packaged next to rustc, it's not intended to be a separate > package but rather built as one unit. See https://github.com/rust-lang/cargo/commit/5c9665f41c6b4d3b99d3b9f8b48a286f5f154692
Diffstat (limited to 'community/rust')
-rw-r--r--community/rust/APKBUILD112
-rw-r--r--community/rust/bootstrap-tool-respect-tool-config.patch26
-rw-r--r--community/rust/cargo-libressl27x.patch97
-rw-r--r--community/rust/cargo-tests-fix-build-auth-http_auth_offered.patch43
-rw-r--r--community/rust/cargo-tests-ignore-resolving_minimum_version_with_transitive_deps.patch32
-rw-r--r--community/rust/fix-configure-tools.patch35
6 files changed, 331 insertions, 14 deletions
diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD
index c6a2352bb4..4fdf7ff428 100644
--- a/community/rust/APKBUILD
+++ b/community/rust/APKBUILD
@@ -24,20 +24,37 @@ depends="$pkgname-stdlib=$pkgver-r$pkgrel gcc llvm-libunwind-dev musl-dev"
# * libffi-dev is needed just because we compile llvm with LLVM_ENABLE_FFI.
makedepends="
rust>=$_bootver
- cargo
+ cargo-bootstrap
cmake
+ curl-dev
file
libffi-dev
+ libgit2-dev
+ libressl-dev
+ libssh2-dev
llvm$_llvmver-dev
llvm$_llvmver-test-utils
python2
tar
zlib-dev
"
+# XXX: This is a hack to allow this abuild to depend on itself. Adding "rust"
+# to makedepends would not work, because abuild implicitly removes $pkgname
+# and $subpackages from the abuild's dependencies.
+provides="rust-bootstrap=$pkgver-r$pkgrel"
# This is needed for -src that contains some testing binaries.
options="!archcheck"
-subpackages="$pkgname-dbg $pkgname-stdlib
- $pkgname-gdb::noarch $pkgname-lldb::noarch $pkgname-doc"
+subpackages="
+ $pkgname-dbg
+ $pkgname-stdlib
+ $pkgname-gdb::noarch
+ $pkgname-lldb::noarch
+ $pkgname-doc
+ cargo
+ cargo-bash-completions:_cargo_bashcomp:noarch
+ cargo-zsh-completion:_cargo_zshcomp:noarch
+ cargo-doc:_cargo_doc:noarch
+ "
source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
musl-fix-static-linking.patch
musl-fix-linux_musl_base.patch
@@ -49,6 +66,11 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
alpine-change-rpath-to-rustlib.patch
alpine-target.patch
install-template-shebang.patch
+ fix-configure-tools.patch
+ bootstrap-tool-respect-tool-config.patch
+ cargo-libressl27x.patch
+ cargo-tests-fix-build-auth-http_auth_offered.patch
+ cargo-tests-ignore-resolving_minimum_version_with_transitive_deps.patch
check-rustc
"
builddir="$srcdir/rustc-$pkgver-src"
@@ -73,6 +95,9 @@ prepare() {
build() {
cd "$builddir"
+ # Convince libgit2-sys to use the distro libgit2.
+ export LIBGIT2_SYS_USE_PKG_CONFIG=1
+
# jemalloc is disabled, because it increases size of statically linked
# binaries produced by rustc (stripped hello_world 186 kiB vs. 358 kiB)
# for only tiny performance boost (even negative in some tests).
@@ -87,6 +112,8 @@ build() {
--llvm-root="/usr/lib/llvm$_llvmver" \
--musl-root="/usr" \
--disable-docs \
+ --enable-extended \
+ --tools="cargo" \
--enable-llvm-link-shared \
--enable-option-checking \
--enable-locked-deps \
@@ -95,19 +122,27 @@ build() {
RUST_BACKTRACE=1 \
RUSTC_CRT_STATIC="false" \
- ./x.py build -v
+ ./x.py build -v --jobs ${JOBS:-2}
}
check() {
- "$srcdir"/check-rustc "$builddir/build/$CTARGET/stage2/bin/rustc"
+ cd "$builddir"
+
+ "$srcdir"/check-rustc "$builddir"/build/$CTARGET/stage2/bin/rustc
# XXX: There's some problem with these tests, we will figure it out later.
# cd "$builddir"
# make check \
# LD_LIBRARY_PATH="$_stage0dir/lib" \
# RUST_BACKTRACE=1 \
-# RUST_CRT_STATIC="false" \
+# RUSTC_CRT_STATIC="false" \
# VERBOSE=1
+
+ msg "Running tests for cargo..."
+ RUST_BACKTRACE=full \
+ RUSTC_CRT_STATIC="false" \
+ CFG_DISABLE_CROSS_TESTS=1 \
+ ./x.py test --no-fail-fast src/tools/cargo
}
package() {
@@ -169,14 +204,58 @@ lldb() {
_mv "$pkgdir"/$_sharedir/etc/lldb_*.py $_sharedir/etc/
}
-#src() {
-# pkgdesc="$pkgdesc (source code)"
-# depends="$pkgname"
-# license="$license OFL-1.1 GPL-3.0-or-later GPL-3.0-with-GCC-exception CC-BY-SA-3.0 LGPL-3.0"
-#
-# mkdir -p "$subpkgdir"/usr/src
-# mv "$srcdir"/rust-src "$subpkgdir"/usr/src/rust
-#}
+cargo() {
+ pkgdesc="The Rust package manager"
+ license="Apache-2.0 MIT UNLICENSE"
+ depends="$pkgname"
+ # XXX: See comment on top-level provides=.
+ provides="cargo-bootstrap=$pkgver-r$pkgrel"
+
+ _mv "$pkgdir"/usr/bin/cargo "$subpkgdir"/usr/bin/
+}
+
+_cargo_bashcomp() {
+ pkgdesc="Bash completions for cargo"
+ license="Apache-2.0 MIT"
+ depends=""
+ install_if="cargo=$pkgver-r$pkgrel bash-completion"
+
+ cd "$pkgdir"
+ _mv etc/bash_completion.d/cargo \
+ "$subpkgdir"/usr/share/bash-completion/completions/
+ rmdir -p etc/bash_completion.d 2>/dev/null || true
+}
+
+_cargo_zshcomp() {
+ pkgdesc="ZSH completions for cargo"
+ license="Apache-2.0 MIT"
+ depends=""
+ install_if="cargo=$pkgver-r$pkgrel zsh"
+
+ cd "$pkgdir"
+ _mv usr/share/zsh/site-functions/_cargo \
+ "$subpkgdir"/usr/share/zsh/site-functions/_cargo
+ rmdir -p usr/share/zsh/site-functions 2>/dev/null || true
+}
+
+_cargo_doc() {
+ pkgdesc="The Rust package manager (documentation)"
+ license="Apache-2.0 MIT"
+ install_if="docs cargo=$pkgver-r$pkgrel"
+
+ # XXX: This is hackish!
+ cd "$pkgdir"/../$pkgname-doc
+ _mv usr/share/man/man1/cargo* "$subpkgdir"/usr/share/man/man1/
+}
+
+src() {
+ pkgdesc="$pkgdesc (source code)"
+ depends="$pkgname"
+ license="$license OFL-1.1 GPL-3.0-or-later GPL-3.0-with-GCC-exception CC-BY-SA-3.0 LGPL-3.0"
+
+ mkdir -p "$subpkgdir"/usr/src
+ cp -alr "$srcdir"/rust-src "$subpkgdir"/usr/src/rust
+}
_mv() {
local dest; for dest; do true; done # get last argument
@@ -195,4 +274,9 @@ d352614e7c774e181decae210140e789de7fc090327ff371981ad28a11ce51c8c01b27c1101a24bb
61aa415d754e9e01236481a1f3c9d5242f2d633e6f11b998e9ffcc07bf5c182d87c0c973dab6f10e4bb3ab4b4a4857bf9ed8dd664c49a65f6175d27db2774db1 alpine-change-rpath-to-rustlib.patch
b3be85bf54d03ba5a685c8e01246e047a169fedb1745182286fdb1ae8cb23e6723318276ef36ee0c54bf7e6d2bc86a46c479fb6c822b8b548d35fa094dde05d2 alpine-target.patch
7d59258d4462eba0207739a5c0c8baf1f19d9a396e5547bb4d59d700eb94d50ba6add2e523f3e94e29e993821018594625ea4ac86304fb58f7f8c82622a26ab0 install-template-shebang.patch
+775a7a28a79d4150813caef6b5b1ee0771cf3cb5945eae427371618ff1fb097da9a0001e13f0f426e3a9636f75683bfe4bdff634456137e057f965ee2899b95a fix-configure-tools.patch
+b0f117423f0a9f51c2fecfcc63acabcd7da692946113b6e0aa30f2cff529a06bc41a2b075b410badab6c11fd4e1147b4af796e3e9a93608d3b43ee65b0a4aa02 bootstrap-tool-respect-tool-config.patch
+869907b14be659cfc5b29a20680e9f53c3e8dd5346625ecb80a10b4dcf4e04c94263035653b66c1f7d7d7cbb27f0b29d17ca2d72f720186ca3284f8dd807afc9 cargo-libressl27x.patch
+332a6af59edc507baa73eda1de60591dd4202f540541769ac1bcbc731267f4523ea309d2c3b1f5a9dc3db32831942a5d3d40b81882dad0bf0b5ee7f74f1d6477 cargo-tests-fix-build-auth-http_auth_offered.patch
+3d6f027088e1ec189ce864bf5ed150ccad8be5d9fc0973f1b4d202eec6eab865834403335a9f0765bbfa54638aed7f5d5f2183ba9dfeab9f5bc4ef48111a8427 cargo-tests-ignore-resolving_minimum_version_with_transitive_deps.patch
79549055dea81379c890b495c82456ab497a9179ec6702c59e11d0748bc668f47fc3d6a69c27a0545bb87c01318631dffc69260bf2d4badc75f53cbf7fad7528 check-rustc"
diff --git a/community/rust/bootstrap-tool-respect-tool-config.patch b/community/rust/bootstrap-tool-respect-tool-config.patch
new file mode 100644
index 0000000000..2ff038ed69
--- /dev/null
+++ b/community/rust/bootstrap-tool-respect-tool-config.patch
@@ -0,0 +1,26 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Sun, 20 May 2018 14:58:00 +0200
+Subject: [PATCH] Fix tool builder to respect build.tools config
+
+--- a/src/bootstrap/tool.rs
++++ b/src/bootstrap/tool.rs
+@@ -464,7 +464,8 @@
+
+ fn should_run(run: ShouldRun) -> ShouldRun {
+ let builder = run.builder;
+- run.path("src/tools/cargo").default_condition(builder.build.config.extended)
++ run.path("src/tools/cargo").default_condition(builder.build.config.extended
++ && builder.build.config.tools.as_ref().map_or(true, |t| t.contains("cargo")))
+ }
+
+ fn make_run(run: RunConfig) {
+@@ -518,7 +519,8 @@
+
+ fn should_run(run: ShouldRun) -> ShouldRun {
+ let builder = run.builder;
+- run.path($path).default_condition(builder.build.config.extended)
++ run.path($path).default_condition(builder.build.config.extended
++ && builder.build.config.tools.as_ref().map_or(true, |t| t.contains($tool_name)))
+ }
+
+ fn make_run(run: RunConfig) {
diff --git a/community/rust/cargo-libressl27x.patch b/community/rust/cargo-libressl27x.patch
new file mode 100644
index 0000000000..77333fb6c8
--- /dev/null
+++ b/community/rust/cargo-libressl27x.patch
@@ -0,0 +1,97 @@
+Add support for LibreSSL 2.7.x. This patch was assembled from the following
+commits in rust-openssl's repository:
+
+* f0614f4acd6d24fbb100b8365bc54662d4f62df2
+* 23ca9d2832ff54bc2067f99473802a3fbead0f3f
+* 03c6bcc159c5b987779da4f01c6f76bd77a13ce3
+* 01855a4f6470db6d71bccece1db33bc4b89b4c9b
+
+--- a/src/vendor/openssl-sys/build.rs
++++ b/src/vendor/openssl-sys/build.rs
+@@ -323,8 +323,10 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version {
+ #include <openssl/opensslv.h>
+ #include <openssl/opensslconf.h>
+
+-#if LIBRESSL_VERSION_NUMBER >= 0x20700000
++#if LIBRESSL_VERSION_NUMBER >= 0x20800000
+ RUST_LIBRESSL_NEW
++#elif LIBRESSL_VERSION_NUMBER >= 0x20700000
++RUST_LIBRESSL_27X
+ #elif LIBRESSL_VERSION_NUMBER >= 0x20603000
+ RUST_LIBRESSL_26X
+ #elif LIBRESSL_VERSION_NUMBER >= 0x20602000
+@@ -473,6 +475,13 @@ See rust-openssl README for more information:
+ println!("cargo:libressl_version=26x");
+ println!("cargo:version=101");
+ Version::Libressl
++ } else if expanded.contains("RUST_LIBRESSL_27X") {
++ println!("cargo:rustc-cfg=libressl");
++ println!("cargo:rustc-cfg=libressl27");
++ println!("cargo:libressl=true");
++ println!("cargo:libressl_version=27x");
++ println!("cargo:version=101");
++ Version::Libressl
+ } else if expanded.contains("RUST_OPENSSL_111") {
+ println!("cargo:rustc-cfg=ossl111");
+ println!("cargo:rustc-cfg=ossl110");
+@@ -501,7 +510,7 @@ See rust-openssl README for more information:
+ "
+
+ This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5
+-and 2.6, but a different version of OpenSSL was found. The build is now aborting
++through 2.7, but a different version of OpenSSL was found. The build is now aborting
+ due to this version mismatch.
+
+ "
+--- a/src/vendor/openssl-sys/src/lib.rs
++++ b/src/vendor/openssl-sys/src/lib.rs
+@@ -1249,14 +1249,14 @@ pub const SSL_VERIFY_NONE: c_int = 0;
+ pub const SSL_VERIFY_PEER: c_int = 1;
+ pub const SSL_VERIFY_FAIL_IF_NO_PEER_CERT: c_int = 2;
+
+-#[cfg(not(any(libressl261, libressl262, libressl26x, ossl101)))]
++#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27, ossl101)))]
+ pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x00000010;
+-#[cfg(any(libressl261, libressl262, libressl26x))]
++#[cfg(any(libressl261, libressl262, libressl26x, libressl27))]
+ pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x0;
+ pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: c_ulong = 0x00000800;
+-#[cfg(not(any(libressl261, libressl262, libressl26x)))]
++#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))]
+ pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x80000000;
+-#[cfg(any(libressl261, libressl262, libressl26x))]
++#[cfg(any(libressl261, libressl262, libressl26x, libressl27))]
+ pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x0;
+ pub const SSL_OP_LEGACY_SERVER_CONNECT: c_ulong = 0x00000004;
+ #[cfg(not(libressl))]
+--- a/src/vendor/openssl-sys/src/libressl/mod.rs
++++ b/src/vendor/openssl-sys/src/libressl/mod.rs
+@@ -331,9 +331,9 @@ pub const SSL_CTRL_OPTIONS: c_int = 32;
+ pub const SSL_CTRL_CLEAR_OPTIONS: c_int = 77;
+ pub const SSL_CTRL_SET_ECDH_AUTO: c_int = 94;
+
+-#[cfg(any(libressl261, libressl262, libressl26x))]
++#[cfg(any(libressl261, libressl262, libressl26x, libressl27))]
+ pub const SSL_OP_ALL: c_ulong = 0x4;
+-#[cfg(not(any(libressl261, libressl262, libressl26x)))]
++#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))]
+ pub const SSL_OP_ALL: c_ulong = 0x80000014;
+ pub const SSL_OP_CISCO_ANYCONNECT: c_ulong = 0x0;
+ pub const SSL_OP_NO_COMPRESSION: c_ulong = 0x0;
+@@ -346,9 +346,9 @@ pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: c_ulong = 0x0;
+ pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: c_ulong = 0x0;
+ pub const SSL_OP_TLS_D5_BUG: c_ulong = 0x0;
+ pub const SSL_OP_TLS_BLOCK_PADDING_BUG: c_ulong = 0x0;
+-#[cfg(any(libressl261, libressl262, libressl26x))]
++#[cfg(any(libressl261, libressl262, libressl26x, libressl27))]
+ pub const SSL_OP_SINGLE_ECDH_USE: c_ulong = 0x0;
+-#[cfg(not(any(libressl261, libressl262, libressl26x)))]
++#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))]
+ pub const SSL_OP_SINGLE_ECDH_USE: c_ulong = 0x00080000;
+ pub const SSL_OP_SINGLE_DH_USE: c_ulong = 0x00100000;
+ pub const SSL_OP_NO_SSLv2: c_ulong = 0x0;
+--- a/src/vendor/openssl-sys/.cargo-checksum.json
++++ b/src/vendor/openssl-sys/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"84ca02d51869a94d631415447762ab0c12592d9a18934cdbdbe8974fdf77ffd5","Cargo.toml.orig":"0c05fcc731ca9be285c38a16086339cca2b7a57642ea969e43a1813fb032ae78","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"d95a3aa19289431dd60885a27f8b57860fd5906cf001780e14e93b18c9136a47","build.rs":"59dbe79ac18a2cd1aa01d4847d8dc8f3dcb2496dfd2a467308167498d58d2cf3","src/lib.rs":"9c53b3ba767f0924513009e52715bcc2b6b3bc9ded878dfe54fa16d080aff48c","src/libressl/mod.rs":"192fbed74cedac430dda84449409f9cd93f20da01db669912bcddfe4d5d1a51e","src/libressl/v250.rs":"8e64255d67e9e684b6d76184f96cfb8dca34c7f241fdbc08a982a221644257ea","src/libressl/v25x.rs":"08a71c8fac38851f9b9e58ae5f1ca39185a8057f93accc142da822c6bf3488f4","src/ossl10x.rs":"5df1084914e88eb9d73d57a4b78a2ea7fde9aeb58c5322a5a99b3ab19720cb8d","src/ossl110.rs":"54bda26bdf5488da9a904854b7171a4005e99d930605ed8279644104f16b3a85","src/ossl111.rs":"cb65c7ef481e50e1901c0b1f533703e4609858c8642b4569a66f037f23d515ee"},"package":"d6fdc5c4a02e69ce65046f1763a0181107038e02176233acb0b3351d7cc588f9"}
++{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"84ca02d51869a94d631415447762ab0c12592d9a18934cdbdbe8974fdf77ffd5","Cargo.toml.orig":"0c05fcc731ca9be285c38a16086339cca2b7a57642ea969e43a1813fb032ae78","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"d95a3aa19289431dd60885a27f8b57860fd5906cf001780e14e93b18c9136a47","build.rs":"0f3e7e9a56d842afb30e5aecaaac3a2b82ccc48be785dcf1514380bc03a2bf24","src/lib.rs":"99135b825f8481f7f7f1861fd8447daad79add9576bd449ad52636014c5e4c0c","src/libressl/mod.rs":"803488d553de18dfefb6d5e8def39630ec45144ee1a8dd936a4e0e5e7fe50c38","src/libressl/v250.rs":"8e64255d67e9e684b6d76184f96cfb8dca34c7f241fdbc08a982a221644257ea","src/libressl/v25x.rs":"08a71c8fac38851f9b9e58ae5f1ca39185a8057f93accc142da822c6bf3488f4","src/ossl10x.rs":"5df1084914e88eb9d73d57a4b78a2ea7fde9aeb58c5322a5a99b3ab19720cb8d","src/ossl110.rs":"54bda26bdf5488da9a904854b7171a4005e99d930605ed8279644104f16b3a85","src/ossl111.rs":"cb65c7ef481e50e1901c0b1f533703e4609858c8642b4569a66f037f23d515ee"},"package":"d6fdc5c4a02e69ce65046f1763a0181107038e02176233acb0b3351d7cc588f9"}
diff --git a/community/rust/cargo-tests-fix-build-auth-http_auth_offered.patch b/community/rust/cargo-tests-fix-build-auth-http_auth_offered.patch
new file mode 100644
index 0000000000..d141082856
--- /dev/null
+++ b/community/rust/cargo-tests-fix-build-auth-http_auth_offered.patch
@@ -0,0 +1,43 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Thu, 13 Aug 2016 14:47:00 +0200
+Last-Updated: Sun, 20 May 2018 16:28:00 +0200
+Subject: [PATCH] Fix test build-auth:http_auth_offered
+
+The test fails because of hard-coded libgit2 version, that may not be
+the same as actually used libgit2...
+
+--- a/src/tools/cargo/tests/testsuite/build_auth.rs
++++ b/src/tools/cargo/tests/testsuite/build_auth.rs
+@@ -17,7 +17,7 @@
+ let addr = server.local_addr().unwrap();
+
+ fn headers(rdr: &mut BufRead) -> HashSet<String> {
+- let valid = ["GET", "Authorization", "Accept", "User-Agent"];
++ let valid = ["GET", "Authorization", "Accept"];
+ rdr.lines()
+ .map(|s| s.unwrap())
+ .take_while(|s| s.len() > 2)
+@@ -29,7 +29,6 @@
+ let t = thread::spawn(move || {
+ let mut conn = BufStream::new(server.accept().unwrap().0);
+ let req = headers(&mut conn);
+- let user_agent = "User-Agent: git/2.0 (libgit2 0.27.0)";
+ conn.write_all(
+ b"\
+ HTTP/1.1 401 Unauthorized\r\n\
+@@ -42,7 +41,6 @@
+ vec![
+ "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
+ "Accept: */*",
+- user_agent,
+ ].into_iter()
+ .map(|s| s.to_string())
+ .collect()
+@@ -64,7 +62,6 @@
+ "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
+ "Authorization: Basic Zm9vOmJhcg==",
+ "Accept: */*",
+- user_agent,
+ ].into_iter()
+ .map(|s| s.to_string())
+ .collect()
diff --git a/community/rust/cargo-tests-ignore-resolving_minimum_version_with_transitive_deps.patch b/community/rust/cargo-tests-ignore-resolving_minimum_version_with_transitive_deps.patch
new file mode 100644
index 0000000000..d8d6a10b22
--- /dev/null
+++ b/community/rust/cargo-tests-ignore-resolving_minimum_version_with_transitive_deps.patch
@@ -0,0 +1,32 @@
+This test is probably broken, ignore it for now.
+
+ thread 'resolve::test_resolving_minimum_version_with_transitive_deps'
+ panicked at 'called `Result::unwrap()` on an `Err` value:
+ ErrorMessage { msg: "the `-Z` flag is only accepted on the nightly channel of Cargo" }
+
+ stack backtrace:
+ 0: 0x562c29c6f9ec - backtrace::backtrace::trace::h6219b4e271e2bbe6
+ 1: 0x562c29c6e302 - backtrace::capture::Backtrace::new_unresolved::h8d9c4862e2ea3928
+ 2: 0x562c29c6df25 - failure::backtrace::internal::InternalBacktrace::new::h749290dead787373
+ 3: 0x562c29c6d9e1 - failure::backtrace::Backtrace::new::hc2e5a373190e1710
+ 4: 0x562c29ba26eb - cargo::core::features::CliUnstable::parse::h30f39ff567c7869c
+ 5: 0x562c29be560b - cargo::util::config::Config::configure::hae0b13d11622f31e
+ 6: 0x562c299a0461 - testsuite::resolve::test_resolving_minimum_version_with_transitive_deps::hec5b2ebc1f7900a2
+ 7: 0x562c29a653d8 - core::ops::function::FnOnce::call_once::hbe08dbf200c0490c
+ 8: 0x562c29b63be1 - test::run_test::{{closure}}::h3bfbae1658ea152d
+ at libtest/lib.rs:1453
+ - core::ops::function::FnOnce::call_once::h3e2023796b061538
+ at src/libcore/ops/function.rs:223
+ - <F as alloc::boxed::FnBox<A>>::call_box::h746d3bbd114f184c
+ at src/liballoc/boxed.rs:784
+
+--- a/src/tools/cargo/tests/testsuite/resolve.rs
++++ b/src/tools/cargo/tests/testsuite/resolve.rs
+@@ -341,6 +341,7 @@
+ }
+
+ #[test]
++#[ignore]
+ fn test_resolving_minimum_version_with_transitive_deps() {
+ // When the minimal-versions config option is specified then the lowest
+ // possible version of a package should be selected. "util 1.0.0" can't be
diff --git a/community/rust/fix-configure-tools.patch b/community/rust/fix-configure-tools.patch
new file mode 100644
index 0000000000..226ce76a65
--- /dev/null
+++ b/community/rust/fix-configure-tools.patch
@@ -0,0 +1,35 @@
+From 51b17db7707d745af25558eaa32aaf10080a9a03 Mon Sep 17 00:00:00 2001
+From: Dan Callaghan <djc@djc.id.au>
+Date: Sun, 8 Apr 2018 14:59:15 +1000
+Subject: [PATCH] configure.py --tools should set a list instead of a string
+
+Currently the --tools option does not work because it is setting a string value
+for 'build.tools'. It should be a list of strings instead.
+
+Patch-Source: https://github.com/rust-lang/rust/commit/51b17db7707d745af25558eaa32aaf10080a9a03
+---
+ src/bootstrap/configure.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
+index a5c373d5d5e7..b06968d313ba 100755
+--- a/src/bootstrap/configure.py
++++ b/src/bootstrap/configure.py
+@@ -145,7 +145,7 @@ def v(*args):
+ o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two")
+ o("extended", "build.extended", "build an extended rust tool set")
+
+-v("tools", "build.tools", "List of extended tools will be installed")
++v("tools", None, "List of extended tools will be installed")
+ v("build", "build.build", "GNUs ./configure syntax LLVM build triple")
+ v("host", None, "GNUs ./configure syntax LLVM host triples")
+ v("target", None, "GNUs ./configure syntax LLVM target triples")
+@@ -321,6 +321,8 @@ def set(key, value):
+ set('target.{}.llvm-config'.format(build()), value + '/bin/llvm-config')
+ elif option.name == 'jemalloc-root':
+ set('target.{}.jemalloc'.format(build()), value + '/libjemalloc_pic.a')
++ elif option.name == 'tools':
++ set('build.tools', value.split(','))
+ elif option.name == 'host':
+ set('build.host', value.split(','))
+ elif option.name == 'target':