diff --git a/testing/rust/README b/testing/rust/README new file mode 100644 index 00000000..4c3d616f --- /dev/null +++ b/testing/rust/README @@ -0,0 +1,46 @@ +rust +________________________________________________________________________________ + +Rust is a multi-paradigm, high-level, general-purpose programming language +designed for performance and safety, especially safe concurrency. Rust is +syntactically similar to C++, but can guarantee memory safety by using a borrow +checker to validate references. Rust achieves memory safety without garbage +collection, and reference counting is optional. + +Rust was originally designed by Graydon Hoare at Mozilla Research, with +contributions from Dave Herman, Brendan Eich, and others. The designers refined +the language while writing the Servo experimental browser engine, and the Rust +compiler. [0] + +Upstream: https://www.rust-lang.org/ + + +[000] Index +________________________________________________________________________________ + +* Installation ........................................................... [001] +* Usage .................................................................. [002] +* References ............................................................. [003] + + +[001] Installation +________________________________________________________________________________ + ++------------------------------------------------------------------------------+ +| | +| $ kiss b rust | +| | ++------------------------------------------------------------------------------+ + + +[002] Usage +________________________________________________________________________________ + +Refer to the manual pages and command help output. + + +[003] References +________________________________________________________________________________ + +[0] https://en.wikipedia.org/wiki/Rust_(programming_language) + diff --git a/testing/rust/build b/testing/rust/build new file mode 100755 index 00000000..c6f8c737 --- /dev/null +++ b/testing/rust/build @@ -0,0 +1,107 @@ +#!/bin/sh -e + +# Instruct the compiler to trim absolute paths in resulting binaries and instead +# change them to relative paths ($PWD/... ./...). +export RUSTFLAGS="$RUSTFLAGS --remap-path-prefix=$PWD=." + +# 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. +{ + mkdir -p "${cache_dir:=build/cache/2021-09-09}" + + for tarball in *.tar.xz\?no-extract; do + mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}" + done +} + +# Set shared linking as the default. +for f in \ + compiler/rustc_target/src/spec/linux_musl_base.rs \ + vendor/rustc-ap-rustc_target/src/spec/linux_musl_base.rs +do + sed 's/\(crt_static_default = \)true/\1false/' "$f" > _ + mv -f _ "$f" +done + +# Ignore checksums of files modified above. +sed 's/\("files":{\)[^}]*/\1/' \ + vendor/rustc-ap-rustc_target/.cargo-checksum.json > _ +mv -f _ vendor/rustc-ap-rustc_target/.cargo-checksum.json + +cat > config.toml <> config.toml + + mkdir -p libgcc + + printf 'INPUT(-lunwind)\n' > \ + libgcc/libgcc_s.so + + ln -sf "$KISS_ROOT/usr/lib/libunwind.so.1" \ + libgcc/libgcc_s.so.1 + + export \ + LD_LIBRARY_PATH="$PWD/libgcc:$LD_LIBRARY_PATH" \ + LIBRARY_PATH="$PWD/libgcc:$LIBRARY_PATH" +esac + +./x.py build -j "$(grep -scF 'core id' /proc/cpuinfo)" +./x.py install + +rm -rf \ + "$1/usr/lib/rustlib/src/" \ + "$1/usr/share/doc" \ + "$1/usr/share/zsh" \ + "$1/usr/lib/rustlib/uninstall.sh" + diff --git a/testing/rust/checksums b/testing/rust/checksums new file mode 100644 index 00000000..8f698d07 --- /dev/null +++ b/testing/rust/checksums @@ -0,0 +1,5 @@ +f13468889833c88e744ad579c5d8fbb7ecb53216159b54481a90e5dcdaa9e320 +a7f02bd5b4fd2b1f55edaddfa869d2ce210ce4951cb752ce7b380129bc2d1882 +0ddf6eccc6d005d39aaad3246ff157811a5a81c801f6e935c671299d24036c50 +9faa4514576c4beafcc7b640a17b57e8103f2f9c88f646c216ccce90b1a0cdf2 +f68fbed74118bff6df74dbdd1507e646e6627c95444fde90a6bb66b51b677cff diff --git a/testing/rust/depends b/testing/rust/depends new file mode 100644 index 00000000..f70e18ce --- /dev/null +++ b/testing/rust/depends @@ -0,0 +1,8 @@ +cmake make +curl make +llvm +openssl +pkgconf make +python make +xz +zlib diff --git a/testing/rust/sources b/testing/rust/sources new file mode 100644 index 00000000..a1b23850 --- /dev/null +++ b/testing/rust/sources @@ -0,0 +1,4 @@ +https://static.rust-lang.org/dist/rustc-VERSION-src.tar.xz +https://static.rust-lang.org/dist/2021-09-09/rust-std-1.55.0-x86_64-unknown-linux-musl.tar.xz?no-extract +https://static.rust-lang.org/dist/2021-09-09/rustc-1.55.0-x86_64-unknown-linux-musl.tar.xz?no-extract +https://static.rust-lang.org/dist/2021-09-09/cargo-1.55.0-x86_64-unknown-linux-musl.tar.xz?no-extract diff --git a/testing/rust/version b/testing/rust/version new file mode 100644 index 00000000..89bac5a7 --- /dev/null +++ b/testing/rust/version @@ -0,0 +1 @@ +1.56.0 0