Skip to content

Commit c880d1c

Browse files
committed
Try to handle thumb targets and xargo
1 parent 89f2b5a commit c880d1c

File tree

4 files changed

+75
-66
lines changed

4 files changed

+75
-66
lines changed

azure-pipelines.yml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,43 @@ jobs:
1111
matrix:
1212
aarch64:
1313
TARGET: aarch64-unknown-linux-gnu
14-
arm:
15-
TARGET: arm-unknown-linux-gnueabi
16-
armhf:
17-
TARGET: arm-unknown-linux-gnueabihf
18-
i586:
19-
TARGET: i586-unknown-linux-gnu
20-
i686:
21-
TARGET: i686-unknown-linux-gnu
22-
mips:
23-
TARGET: mips-unknown-linux-gnu
24-
mips64:
25-
TARGET: mips64-unknown-linux-gnuabi64
26-
mips64el:
27-
TARGET: mips64el-unknown-linux-gnuabi64
28-
mipsel:
29-
TARGET: mipsel-unknown-linux-gnu
30-
powerpc:
31-
TARGET: powerpc-unknown-linux-gnu
32-
powerpc64:
33-
TARGET: powerpc64-unknown-linux-gnu
34-
powerpc64le:
35-
TARGET: powerpc64le-unknown-linux-gnu
14+
# arm:
15+
# TARGET: arm-unknown-linux-gnueabi
16+
# armhf:
17+
# TARGET: arm-unknown-linux-gnueabihf
18+
# i586:
19+
# TARGET: i586-unknown-linux-gnu
20+
# i686:
21+
# TARGET: i686-unknown-linux-gnu
22+
# mips:
23+
# TARGET: mips-unknown-linux-gnu
24+
# mips64:
25+
# TARGET: mips64-unknown-linux-gnuabi64
26+
# mips64el:
27+
# TARGET: mips64el-unknown-linux-gnuabi64
28+
# mipsel:
29+
# TARGET: mipsel-unknown-linux-gnu
30+
# powerpc:
31+
# TARGET: powerpc-unknown-linux-gnu
32+
# powerpc64:
33+
# TARGET: powerpc64-unknown-linux-gnu
34+
# powerpc64le:
35+
# TARGET: powerpc64le-unknown-linux-gnu
3636
thumbv6m:
3737
TARGET: thumbv6m-linux-eabi
38+
XARGO: 1
3839
thumbv7em:
3940
TARGET: thumbv7em-linux-eabi
41+
XARGO: 1
4042
thumbv7emhf:
4143
TARGET: thumbv7em-linux-eabihf
44+
XARGO: 1
4245
thumbv7m:
4346
TARGET: thumbv7m-linux-eabi
47+
XARGO: 1
4448
wasm32:
4549
TARGET: wasm32-unknown-unknown
50+
ONLY_BUILD: 1
4651
x86_64:
4752
TARGET: x86_64-unknown-linux-gnu
4853

@@ -55,8 +60,8 @@ jobs:
5560
matrix:
5661
x86_64:
5762
TARGET: x86_64-apple-darwin
58-
i686:
59-
TARGET: i686-apple-darwin
63+
# i686:
64+
# TARGET: i686-apple-darwin
6065

6166
- job: Windows
6267
pool:
@@ -67,9 +72,9 @@ jobs:
6772
matrix:
6873
i686-msvc:
6974
TARGET: i686-pc-windows-msvc
70-
x86_64-msvc:
71-
TARGET: x86_64-pc-windows-msvc
72-
i686-gnu:
73-
TARGET: i686-pc-windows-gnu
75+
# x86_64-msvc:
76+
# TARGET: x86_64-pc-windows-msvc
77+
# i686-gnu:
78+
# TARGET: i686-pc-windows-gnu
7479
x86_64-gnu:
7580
TARGET: x86_64-pc-windows-gnu

ci/azure-steps.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,23 @@ steps:
44

55
- template: azure-install-rust.yml
66

7+
- script: rustup component add rust-src
8+
displayName: Install Rust sources
9+
condition: eq( variables['XARGO'], '1' )
10+
711
- bash: rustup target add $TARGET
8-
displayName: Install compilation target
12+
displayName: Install Rust target
13+
condition: ne( variables['XARGO'], '1' )
914

1015
- bash: ./ci/run.sh $TARGET
1116
condition: ne( variables['Agent.OS'], 'Linux' )
1217
displayName: Run test script
1318

14-
- bash: cargo generate-lockfile && ./ci/run-docker.sh $TARGET
19+
- bash: |
20+
if [ "$ONLY_BUILD" = "1" ]; then
21+
cargo build --target $TARGET
22+
else
23+
cargo generate-lockfile && ./ci/run-docker.sh $TARGET
24+
fi
1525
condition: eq( variables['Agent.OS'], 'Linux' )
1626
displayName: Run docker test script

ci/run-docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ run() {
1818
--user $(id -u):$(id -g) \
1919
-e CARGO_HOME=/cargo \
2020
-e CARGO_TARGET_DIR=/target \
21+
-e XARGO \
2122
-v $HOME/.cargo:/cargo \
2223
-v `pwd`/target:/target \
2324
-v `pwd`:/checkout:ro \

ci/run.sh

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ set -ex
33
# FIXME(japarix/xargo#186) this shouldn't be necessary
44
export RUST_TARGET_PATH=`pwd`
55

6-
case $1 in
7-
thumb*)
8-
cargo=xargo
9-
;;
10-
*)
11-
cargo=cargo
12-
;;
13-
esac
6+
cargo=cargo
7+
if [ "$XARGO" = "1" ]; then
8+
cargo=xargo
9+
fi
1410

1511
INTRINSICS_FEATURES="c"
1612

@@ -22,34 +18,31 @@ if [ -z "$INTRINSICS_FAILS_WITH_MEM_FEATURE" ]; then
2218
fi
2319

2420
# Test our implementation
25-
case $1 in
26-
thumb*)
27-
run="xargo test --manifest-path testcrate/Cargo.toml --target $1"
28-
for t in $(ls testcrate/tests); do
29-
t=${t%.rs}
30-
31-
RUSTFLAGS="-C debug-assertions=no -C lto" \
32-
CARGO_INCREMENTAL=0 \
33-
$run --test $t --no-default-features --features 'mem c' --no-run
34-
qemu-arm-static target/${1}/debug/$t-*
35-
done
36-
37-
for t in $(ls testcrate/tests); do
38-
t=${t%.rs}
39-
RUSTFLAGS="-C lto" \
40-
CARGO_INCREMENTAL=0 \
41-
$run --test $t --no-default-features --features 'mem c' --no-run --release
42-
qemu-arm-static target/${1}/release/$t-*
43-
done
44-
;;
45-
*)
46-
run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
47-
$run
48-
$run --release
49-
$run --features c
50-
$run --features c --release
51-
;;
52-
esac
21+
if [ "$XARGO" = "1" ]; then
22+
run="xargo test --manifest-path testcrate/Cargo.toml --target $1"
23+
for t in $(ls testcrate/tests); do
24+
t=${t%.rs}
25+
26+
RUSTFLAGS="-C debug-assertions=no -C lto" \
27+
CARGO_INCREMENTAL=0 \
28+
$run --test $t --no-default-features --features 'mem c' --no-run
29+
qemu-arm-static target/${1}/debug/$t-*
30+
done
31+
32+
for t in $(ls testcrate/tests); do
33+
t=${t%.rs}
34+
RUSTFLAGS="-C lto" \
35+
CARGO_INCREMENTAL=0 \
36+
$run --test $t --no-default-features --features 'mem c' --no-run --release
37+
qemu-arm-static target/${1}/release/$t-*
38+
done
39+
else
40+
run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
41+
$run
42+
$run --release
43+
$run --features c
44+
$run --features c --release
45+
fi
5346

5447
PREFIX=$(echo $1 | sed -e 's/unknown-//')-
5548
case $1 in

0 commit comments

Comments
 (0)