rust [testing]: Added rust 1.41.0

This commit is contained in:
Dylan Araps 2020-01-30 20:02:23 +02:00
parent 0e275d5792
commit 5593f35d75
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
6 changed files with 152 additions and 0 deletions

56
testing/rust/build Executable file
View File

@ -0,0 +1,56 @@
#!/bin/sh -e
# This package mimics the download process of rust's 'x.py'
# bootstrap library to allow for the removal of the internet
# connection requirement per build further enabling checksums
# and signature verification by KISS.
{
cache_dir=build/cache/2019-12-19
mkdir -p "$cache_dir"
for tarball in *.tar.xz\?no-extract; do
mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}"
done
}
patch -p1 < musl.patch
# 'rust' checksums files in 'vendor/', but we patch a few files.
for vendor in libc openssl-sys; do
sed -i 's/\("files":{\)[^}]*/\1/' "vendor/$vendor/.cargo-checksum.json"
done
cat > config.toml <<EOF
[llvm]
link-shared = true
[build]
build = "x86_64-unknown-linux-musl"
host = [ "x86_64-unknown-linux-musl" ]
target = [ "x86_64-unknown-linux-musl" ]
docs = false
extended = true
submodules = false
python = "python3"
locked-deps = true
vendor = true
[install]
prefix = "/usr"
[rust]
channel = "stable"
rpath = false
codegen-units = 1
debuginfo-level = 0
backtrace = false
jemalloc = false
codegen-tests = false
[target.x86_64-unknown-linux-musl]
llvm-config = "/usr/bin/llvm-config"
crt-static = false
EOF
python3 ./x.py build -j "$(nproc)"
DESTDIR="$1" python3 ./x.py install

5
testing/rust/checksums Normal file
View File

@ -0,0 +1,5 @@
5546822c09944c4d847968e9b7b3d0e299f143f307c00fa40e84a99fabf8d74b rustc-1.41.0-src.tar.gz
c647bb7f399b3d18e345b2dab1fb073470582a9298e83d8648f6661544df7279 rust-std-1.40.0-x86_64-unknown-linux-musl.tar.xz?no-extract
769b9e31557fcc0ea2a661f88b679d3dbd62b537807c7b3c75ac6816a1be4fa3 rustc-1.40.0-x86_64-unknown-linux-musl.tar.xz?no-extract
848646326474392bdac70a5bfa06efda4c36e2bbbf088f07456f98c7575844e1 cargo-0.41.0-x86_64-unknown-linux-musl.tar.xz?no-extract
bb6f561f1a6ddd15b32126a024f3b0a4f66555797c1ebd6d1d17b7d604a083ae musl.patch

7
testing/rust/depends Normal file
View File

@ -0,0 +1,7 @@
cmake make
curl make
libressl
llvm
python make
xz
zlib

View File

@ -0,0 +1,78 @@
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 8e5fe25..0d3e27e 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -136,7 +136,7 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target:
// with a glibc-targeting toolchain, given we have the appropriate startup
// files. As those shipped with glibc won't work, copy the ones provided by
// musl so we have them on linux-gnu hosts.
- if target.contains("musl") {
+ if target.contains("noop") {
let srcdir = builder.musl_root(target).unwrap().join("lib");
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
copy_and_stamp(&srcdir, obj);
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index bffe748f3..40f9f597f 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -188,7 +188,7 @@ pub fn check(build: &mut Build) {
}
// Make sure musl-root is valid
- if target.contains("musl") {
+ if target.contains("noop") {
// If this is a native target (host is also musl) and no musl-root is given,
// fall back to the system toolchain in /usr before giving up
if build.musl_root(*target).is_none() && build.config.build == *target {
diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
index e294e6398..17fecb3b2 100644
--- a/src/librustc_target/spec/linux_musl_base.rs
+++ b/src/librustc_target/spec/linux_musl_base.rs
@@ -26,7 +26,7 @@ pub fn opts() -> TargetOptions {
base.post_link_objects_crt.push("crtn.o".to_string());
// These targets statically link libc by default
- base.crt_static_default = true;
+ base.crt_static_default = false;
// These targets allow the user to choose between static and dynamic linking.
base.crt_static_respected = true;
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
index f24d957d6..4632212fd 100644
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -10,7 +10,7 @@ fn main() {
// Build the unwinding from libunwind C/C++ source code.
llvm_libunwind::compile();
} else if target.contains("linux") {
- if target.contains("musl") {
+ if target.contains("noop") {
// linking for musl is handled in lib.rs
llvm_libunwind::compile();
} else if !target.contains("android") {
diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
index 8d9164471..3adaaf43d 100644
--- a/src/libunwind/lib.rs
+++ b/src/libunwind/lib.rs
@@ -20,7 +20,7 @@ cfg_if::cfg_if! {
}
}
-#[cfg(target_env = "musl")]
+#[cfg(target_env = "noop")]
#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
extern {}
diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
index 721d24116..26bf271cd 100644
--- a/vendor/libc/src/unix/mod.rs
+++ b/vendor/libc/src/unix/mod.rs
@@ -296,7 +296,7 @@ cfg_if! {
} else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
- } else if #[cfg(target_env = "musl")] {
+ } else if #[cfg(target_env = "noop")] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static",
cfg(target_feature = "crt-static")))]

5
testing/rust/sources Normal file
View File

@ -0,0 +1,5 @@
https://static.rust-lang.org/dist/rustc-1.41.0-src.tar.gz
https://static.rust-lang.org/dist/2019-12-19/rust-std-1.40.0-x86_64-unknown-linux-musl.tar.xz?no-extract
https://static.rust-lang.org/dist/2019-12-19/rustc-1.40.0-x86_64-unknown-linux-musl.tar.xz?no-extract
https://static.rust-lang.org/dist/2019-12-19/cargo-0.41.0-x86_64-unknown-linux-musl.tar.xz?no-extract
patches/musl.patch

1
testing/rust/version Normal file
View File

@ -0,0 +1 @@
1.41.0 1