Skip to content

Commit eecf96b

Browse files
committed
Use host toolchain and explicit target
This fixes a problem of installing i686 toolchain on an x86_64 host. Instead, we use the x86_64 toolchain, but add the i686 target and force all cargo commands to use that target using the `CARGO_BUILD_TARGET` environment variable. Fixes: mmtk#1107
1 parent 0540bb5 commit eecf96b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/minimal-tests-core.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,24 @@ jobs:
4242
name: minimal-tests-core/${{ matrix.target.triple }}/${{ matrix.rust }}
4343
runs-on: ${{ matrix.target.os }}
4444

45+
env:
46+
# This determines the default target which cargo-build, cargo-test, etc. use.
47+
CARGO_BUILD_TARGET: "${{ matrix.target.triple }}"
48+
4549
steps:
4650
- uses: actions/checkout@v4
4751
- name: Install Rust
4852
run: |
49-
rustup toolchain install ${{ matrix.rust }}-${{ matrix.target.triple }}
50-
rustup override set ${{ matrix.rust }}-${{ matrix.target.triple }}
53+
# "rustup toolchain install" should always install the host toolchain,
54+
# so we don't specify the triple.
55+
rustup toolchain install ${{ matrix.rust }}
56+
rustup override set ${{ matrix.rust }}
57+
58+
# Ensure we install the target support for the target we are testing for.
59+
# This is especially important for i686-unknown-linux-gnu
60+
# because it's different from the host.
61+
rustup target add ${{ matrix.target.triple }}
62+
5163
rustup component add rustfmt clippy
5264
5365
# Show the Rust toolchain we are actually using

0 commit comments

Comments
 (0)