Try to handle thumb targets and xargo
This commit is contained in:
parent
89f2b5a8bd
commit
c880d1ca06
@ -11,38 +11,43 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
aarch64:
|
aarch64:
|
||||||
TARGET: aarch64-unknown-linux-gnu
|
TARGET: aarch64-unknown-linux-gnu
|
||||||
arm:
|
# arm:
|
||||||
TARGET: arm-unknown-linux-gnueabi
|
# TARGET: arm-unknown-linux-gnueabi
|
||||||
armhf:
|
# armhf:
|
||||||
TARGET: arm-unknown-linux-gnueabihf
|
# TARGET: arm-unknown-linux-gnueabihf
|
||||||
i586:
|
# i586:
|
||||||
TARGET: i586-unknown-linux-gnu
|
# TARGET: i586-unknown-linux-gnu
|
||||||
i686:
|
# i686:
|
||||||
TARGET: i686-unknown-linux-gnu
|
# TARGET: i686-unknown-linux-gnu
|
||||||
mips:
|
# mips:
|
||||||
TARGET: mips-unknown-linux-gnu
|
# TARGET: mips-unknown-linux-gnu
|
||||||
mips64:
|
# mips64:
|
||||||
TARGET: mips64-unknown-linux-gnuabi64
|
# TARGET: mips64-unknown-linux-gnuabi64
|
||||||
mips64el:
|
# mips64el:
|
||||||
TARGET: mips64el-unknown-linux-gnuabi64
|
# TARGET: mips64el-unknown-linux-gnuabi64
|
||||||
mipsel:
|
# mipsel:
|
||||||
TARGET: mipsel-unknown-linux-gnu
|
# TARGET: mipsel-unknown-linux-gnu
|
||||||
powerpc:
|
# powerpc:
|
||||||
TARGET: powerpc-unknown-linux-gnu
|
# TARGET: powerpc-unknown-linux-gnu
|
||||||
powerpc64:
|
# powerpc64:
|
||||||
TARGET: powerpc64-unknown-linux-gnu
|
# TARGET: powerpc64-unknown-linux-gnu
|
||||||
powerpc64le:
|
# powerpc64le:
|
||||||
TARGET: powerpc64le-unknown-linux-gnu
|
# TARGET: powerpc64le-unknown-linux-gnu
|
||||||
thumbv6m:
|
thumbv6m:
|
||||||
TARGET: thumbv6m-linux-eabi
|
TARGET: thumbv6m-linux-eabi
|
||||||
|
XARGO: 1
|
||||||
thumbv7em:
|
thumbv7em:
|
||||||
TARGET: thumbv7em-linux-eabi
|
TARGET: thumbv7em-linux-eabi
|
||||||
|
XARGO: 1
|
||||||
thumbv7emhf:
|
thumbv7emhf:
|
||||||
TARGET: thumbv7em-linux-eabihf
|
TARGET: thumbv7em-linux-eabihf
|
||||||
|
XARGO: 1
|
||||||
thumbv7m:
|
thumbv7m:
|
||||||
TARGET: thumbv7m-linux-eabi
|
TARGET: thumbv7m-linux-eabi
|
||||||
|
XARGO: 1
|
||||||
wasm32:
|
wasm32:
|
||||||
TARGET: wasm32-unknown-unknown
|
TARGET: wasm32-unknown-unknown
|
||||||
|
ONLY_BUILD: 1
|
||||||
x86_64:
|
x86_64:
|
||||||
TARGET: x86_64-unknown-linux-gnu
|
TARGET: x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
@ -55,8 +60,8 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
x86_64:
|
x86_64:
|
||||||
TARGET: x86_64-apple-darwin
|
TARGET: x86_64-apple-darwin
|
||||||
i686:
|
# i686:
|
||||||
TARGET: i686-apple-darwin
|
# TARGET: i686-apple-darwin
|
||||||
|
|
||||||
- job: Windows
|
- job: Windows
|
||||||
pool:
|
pool:
|
||||||
@ -67,9 +72,9 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
i686-msvc:
|
i686-msvc:
|
||||||
TARGET: i686-pc-windows-msvc
|
TARGET: i686-pc-windows-msvc
|
||||||
x86_64-msvc:
|
# x86_64-msvc:
|
||||||
TARGET: x86_64-pc-windows-msvc
|
# TARGET: x86_64-pc-windows-msvc
|
||||||
i686-gnu:
|
# i686-gnu:
|
||||||
TARGET: i686-pc-windows-gnu
|
# TARGET: i686-pc-windows-gnu
|
||||||
x86_64-gnu:
|
x86_64-gnu:
|
||||||
TARGET: x86_64-pc-windows-gnu
|
TARGET: x86_64-pc-windows-gnu
|
||||||
|
@ -4,13 +4,23 @@ steps:
|
|||||||
|
|
||||||
- template: azure-install-rust.yml
|
- template: azure-install-rust.yml
|
||||||
|
|
||||||
|
- script: rustup component add rust-src
|
||||||
|
displayName: Install Rust sources
|
||||||
|
condition: eq( variables['XARGO'], '1' )
|
||||||
|
|
||||||
- bash: rustup target add $TARGET
|
- bash: rustup target add $TARGET
|
||||||
displayName: Install compilation target
|
displayName: Install Rust target
|
||||||
|
condition: ne( variables['XARGO'], '1' )
|
||||||
|
|
||||||
- bash: ./ci/run.sh $TARGET
|
- bash: ./ci/run.sh $TARGET
|
||||||
condition: ne( variables['Agent.OS'], 'Linux' )
|
condition: ne( variables['Agent.OS'], 'Linux' )
|
||||||
displayName: Run test script
|
displayName: Run test script
|
||||||
|
|
||||||
- bash: cargo generate-lockfile && ./ci/run-docker.sh $TARGET
|
- bash: |
|
||||||
|
if [ "$ONLY_BUILD" = "1" ]; then
|
||||||
|
cargo build --target $TARGET
|
||||||
|
else
|
||||||
|
cargo generate-lockfile && ./ci/run-docker.sh $TARGET
|
||||||
|
fi
|
||||||
condition: eq( variables['Agent.OS'], 'Linux' )
|
condition: eq( variables['Agent.OS'], 'Linux' )
|
||||||
displayName: Run docker test script
|
displayName: Run docker test script
|
||||||
|
@ -18,6 +18,7 @@ run() {
|
|||||||
--user $(id -u):$(id -g) \
|
--user $(id -u):$(id -g) \
|
||||||
-e CARGO_HOME=/cargo \
|
-e CARGO_HOME=/cargo \
|
||||||
-e CARGO_TARGET_DIR=/target \
|
-e CARGO_TARGET_DIR=/target \
|
||||||
|
-e XARGO \
|
||||||
-v $HOME/.cargo:/cargo \
|
-v $HOME/.cargo:/cargo \
|
||||||
-v `pwd`/target:/target \
|
-v `pwd`/target:/target \
|
||||||
-v `pwd`:/checkout:ro \
|
-v `pwd`:/checkout:ro \
|
||||||
|
61
ci/run.sh
61
ci/run.sh
@ -3,14 +3,10 @@ set -ex
|
|||||||
# FIXME(japarix/xargo#186) this shouldn't be necessary
|
# FIXME(japarix/xargo#186) this shouldn't be necessary
|
||||||
export RUST_TARGET_PATH=`pwd`
|
export RUST_TARGET_PATH=`pwd`
|
||||||
|
|
||||||
case $1 in
|
cargo=cargo
|
||||||
thumb*)
|
if [ "$XARGO" = "1" ]; then
|
||||||
cargo=xargo
|
cargo=xargo
|
||||||
;;
|
fi
|
||||||
*)
|
|
||||||
cargo=cargo
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
INTRINSICS_FEATURES="c"
|
INTRINSICS_FEATURES="c"
|
||||||
|
|
||||||
@ -22,34 +18,31 @@ if [ -z "$INTRINSICS_FAILS_WITH_MEM_FEATURE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Test our implementation
|
# Test our implementation
|
||||||
case $1 in
|
if [ "$XARGO" = "1" ]; then
|
||||||
thumb*)
|
run="xargo test --manifest-path testcrate/Cargo.toml --target $1"
|
||||||
run="xargo test --manifest-path testcrate/Cargo.toml --target $1"
|
for t in $(ls testcrate/tests); do
|
||||||
for t in $(ls testcrate/tests); do
|
t=${t%.rs}
|
||||||
t=${t%.rs}
|
|
||||||
|
|
||||||
RUSTFLAGS="-C debug-assertions=no -C lto" \
|
RUSTFLAGS="-C debug-assertions=no -C lto" \
|
||||||
CARGO_INCREMENTAL=0 \
|
CARGO_INCREMENTAL=0 \
|
||||||
$run --test $t --no-default-features --features 'mem c' --no-run
|
$run --test $t --no-default-features --features 'mem c' --no-run
|
||||||
qemu-arm-static target/${1}/debug/$t-*
|
qemu-arm-static target/${1}/debug/$t-*
|
||||||
done
|
done
|
||||||
|
|
||||||
for t in $(ls testcrate/tests); do
|
for t in $(ls testcrate/tests); do
|
||||||
t=${t%.rs}
|
t=${t%.rs}
|
||||||
RUSTFLAGS="-C lto" \
|
RUSTFLAGS="-C lto" \
|
||||||
CARGO_INCREMENTAL=0 \
|
CARGO_INCREMENTAL=0 \
|
||||||
$run --test $t --no-default-features --features 'mem c' --no-run --release
|
$run --test $t --no-default-features --features 'mem c' --no-run --release
|
||||||
qemu-arm-static target/${1}/release/$t-*
|
qemu-arm-static target/${1}/release/$t-*
|
||||||
done
|
done
|
||||||
;;
|
else
|
||||||
*)
|
run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
|
||||||
run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
|
$run
|
||||||
$run
|
$run --release
|
||||||
$run --release
|
$run --features c
|
||||||
$run --features c
|
$run --features c --release
|
||||||
$run --features c --release
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PREFIX=$(echo $1 | sed -e 's/unknown-//')-
|
PREFIX=$(echo $1 | sed -e 's/unknown-//')-
|
||||||
case $1 in
|
case $1 in
|
||||||
|
Loading…
Reference in New Issue
Block a user