swap install.sh and script.sh

master
Jorge Aparicio 2016-08-07 17:03:44 -05:00
parent 4a0e2305ad
commit a1334edbcd
2 changed files with 49 additions and 49 deletions

View File

@ -2,30 +2,47 @@ set -ex
. $(dirname $0)/env.sh . $(dirname $0)/env.sh
build() { install_c_toolchain() {
cargo build --target $TARGET case $TARGET in
cargo build --target $TARGET --release aarch64-unknown-linux-gnu)
sudo apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
;;
*)
;;
esac
} }
run_tests() { install_rust() {
if [[ $QEMU_LD_PREFIX ]]; then curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=nightly
export RUST_TEST_THREADS=1
rustc -V
cargo -V
}
add_rustup_target() {
if [[ $TARGET != $HOST ]]; then
rustup target add $TARGET
fi fi
cargo test --target $TARGET
cargo test --target $TARGET --release
} }
inspect() { configure_cargo() {
${PREFIX}nm -g --defined-only target/**/debug/*.rlib if [[ $PREFIX ]]; then
${PREFIX}objdump target/**/debug/*.rlib ${PREFIX}gcc -v
${PREFIX}objdump target/**/release/*.rlib
mkdir -p .cargo
cat >>.cargo/config <<EOF
[target.$TARGET]
linker = "${PREFIX}gcc"
EOF
fi
} }
main() { main() {
build install_c_toolchain
run_tests install_rust
inspect add_rustup_target
configure_cargo
} }
main main

View File

@ -2,47 +2,30 @@ set -ex
. $(dirname $0)/env.sh . $(dirname $0)/env.sh
install_c_toolchain() { build() {
case $TARGET in cargo build --target $TARGET
aarch64-unknown-linux-gnu) cargo build --target $TARGET --release
sudo apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
;;
*)
;;
esac
} }
install_rust() { run_tests() {
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=nightly if [[ $QEMU_LD_PREFIX ]]; then
export RUST_TEST_THREADS=1
rustc -V
cargo -V
}
add_rustup_target() {
if [[ $TARGET != $HOST ]]; then
rustup target add $TARGET
fi fi
cargo test --target $TARGET
cargo test --target $TARGET --release
} }
configure_cargo() { inspect() {
if [[ $PREFIX ]]; then ${PREFIX}nm -g --defined-only target/**/debug/*.rlib
${PREFIX}gcc -v ${PREFIX}objdump target/**/debug/*.rlib
${PREFIX}objdump target/**/release/*.rlib
mkdir -p .cargo
cat >>.cargo/config <<EOF
[target.$TARGET]
linker = "${PREFIX}gcc"
EOF
fi
} }
main() { main() {
install_c_toolchain build
install_rust run_tests
add_rustup_target inspect
configure_cargo
} }
main main