forked from kiss-community/repo
rust [testing]: 1.56.0
This commit is contained in:
parent
5d24e809f0
commit
d191f889b5
46
testing/rust/README
Normal file
46
testing/rust/README
Normal file
|
@ -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)
|
||||
|
107
testing/rust/build
Executable file
107
testing/rust/build
Executable file
|
@ -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 <<EOF
|
||||
[llvm]
|
||||
link-shared = true
|
||||
skip-rebuild = true
|
||||
|
||||
[build]
|
||||
build = "x86_64-unknown-linux-musl"
|
||||
host = [ "x86_64-unknown-linux-musl" ]
|
||||
target = [ "x86_64-unknown-linux-musl" ]
|
||||
|
||||
docs = false
|
||||
compiler-docs = false
|
||||
extended = true
|
||||
submodules = false
|
||||
python = "python3"
|
||||
locked-deps = true
|
||||
vendor = true
|
||||
tools = [ "cargo", "rustfmt" ]
|
||||
sanitizers = false
|
||||
profiler = false
|
||||
full-bootstrap = false
|
||||
|
||||
[install]
|
||||
prefix = "/usr"
|
||||
|
||||
[target.x86_64-unknown-linux-musl]
|
||||
llvm-config = "/usr/bin/llvm-config"
|
||||
crt-static = false
|
||||
sanitizers = false
|
||||
|
||||
[dist]
|
||||
src-tarball = false
|
||||
|
||||
[rust]
|
||||
backtrace = false
|
||||
channel = "stable"
|
||||
codegen-tests = false
|
||||
codegen-units-std = 1
|
||||
codegen-units = 0
|
||||
debug = false
|
||||
debug-assertions = false
|
||||
debuginfo-level = 0
|
||||
incremental = false
|
||||
jemalloc = false
|
||||
rpath = false
|
||||
dist-src = false
|
||||
EOF
|
||||
|
||||
# Workaround to get Rust to build in llvm-only environments.
|
||||
# libgcc_s.so is needed for Rust's bootstrap binaries, on llvm-only systems
|
||||
# this library does not exist. This hack creates it as alias to libunwind.
|
||||
case $("$CC" -print-file-name=libunwind.so) in */*)
|
||||
printf 'llvm-libunwind = "system"\n' >> 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"
|
||||
|
5
testing/rust/checksums
Normal file
5
testing/rust/checksums
Normal file
|
@ -0,0 +1,5 @@
|
|||
f13468889833c88e744ad579c5d8fbb7ecb53216159b54481a90e5dcdaa9e320
|
||||
a7f02bd5b4fd2b1f55edaddfa869d2ce210ce4951cb752ce7b380129bc2d1882
|
||||
0ddf6eccc6d005d39aaad3246ff157811a5a81c801f6e935c671299d24036c50
|
||||
9faa4514576c4beafcc7b640a17b57e8103f2f9c88f646c216ccce90b1a0cdf2
|
||||
f68fbed74118bff6df74dbdd1507e646e6627c95444fde90a6bb66b51b677cff
|
8
testing/rust/depends
Normal file
8
testing/rust/depends
Normal file
|
@ -0,0 +1,8 @@
|
|||
cmake make
|
||||
curl make
|
||||
llvm
|
||||
openssl
|
||||
pkgconf make
|
||||
python make
|
||||
xz
|
||||
zlib
|
4
testing/rust/sources
Normal file
4
testing/rust/sources
Normal file
|
@ -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
|
1
testing/rust/version
Normal file
1
testing/rust/version
Normal file
|
@ -0,0 +1 @@
|
|||
1.56.0 0
|
Loading…
Reference in New Issue
Block a user