Skip to content

Commit 4a93c66

Browse files
committed
Disable cross on x86_64 targets
1 parent bf1afbc commit 4a93c66

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

.github/workflows/rust.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ jobs:
4343
- env:
4444
TARGET: ${{ matrix.target }}
4545
CHANNEL: ${{ matrix.channel }}
46-
CROSS: ${{ matrix.target != 'x86_64-unknown-linux-gnu' && '1' || '0' }}
47-
NO_STD: ${{ matrix.target == 'thumbv6m-none-eabi' && '1' || '0' }}
4846
run: sh ci/run.sh
4947
strategy:
5048
matrix:

ci/run.sh

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ set -ex
44

55
: "${TARGET?The TARGET environment variable must be set.}"
66

7+
case "${TARGET}" in
8+
x86_64-unknown-linux-gnu|x86_64-apple-darwin|x86_64-pc-windows-msvc)
9+
CROSS=0
10+
NO_STD=0
11+
;;
12+
thumbv6m-none-eabi)
13+
CROSS=1
14+
NO_STD=1
15+
;;
16+
*)
17+
CROSS=1
18+
NO_STD=0
19+
;;
20+
esac
21+
22+
CARGO=cargo
23+
if [ "${CROSS}" = "1" ]; then
24+
export CARGO_NET_RETRY=5
25+
export CARGO_NET_TIMEOUT=10
26+
27+
cargo install --locked cross
28+
CARGO=cross
29+
fi
30+
731
if [ "${NO_STD}" = "1" ]; then
832
# Unfortunately serde currently doesn't work without std due to a cargo bug.
933
FEATURES="rustc-internal-api"
@@ -12,20 +36,12 @@ else
1236
FEATURES="rustc-internal-api,serde,rayon,raw"
1337
OP="test"
1438
fi
39+
1540
if [ "${CHANNEL}" = "nightly" ]; then
1641
FEATURES="${FEATURES},nightly"
1742
export RUSTFLAGS="$RUSTFLAGS -D warnings"
1843
fi
1944

20-
CARGO=cargo
21-
if [ "${CROSS}" = "1" ]; then
22-
export CARGO_NET_RETRY=5
23-
export CARGO_NET_TIMEOUT=10
24-
25-
cargo install --locked cross
26-
CARGO=cross
27-
fi
28-
2945
# Make sure we can compile without the default hasher
3046
"${CARGO}" -vv build --target="${TARGET}" --no-default-features
3147
"${CARGO}" -vv build --target="${TARGET}" --release --no-default-features

0 commit comments

Comments
 (0)