Skip to content

Commit 29d67cc

Browse files
committed
Use rustup script instead of action in test-32bit
This fixes the following error in test-32bit, which only happens in the i386 job: error: toolchain 'stable-i686-unknown-linux-gnu' may not be able to run on this system note: to build software for that platform, try `rustup target add i686-unknown-linux-gnu` instead note: add the `--force-non-host` flag to install the toolchain anyway The command `dtolnay/rust-toolchain` ran that gave that error was: rustup toolchain install stable-i686-unknown-linux-gnu --profile minimal --no-self-update As can be observed in: https://github.com/EliahKagan/gitoxide/actions/runs/13602883937/job/38151997355 It is intentional that the test-32bit jobs use a toolchain of the same architecture as the target, in order to test that native builds on 32-bit platforms can be performed. This runs at, or almost at, native speeds. This is because these are run on runners whose 64-bit CPUs are capable of running these 32-bit binaries directly. No software-based emulation is used. It also seems strange that this error is produced with i386 on x86-64, which all x86-64 CPUs are capable of, but not with arm32v7 on AArch64, which *not* all AArch64 CPUs are capable of. (Libraries may be needed to run toolchain executables such as `rustc`, so it makes sense that such a diagnostic might occur on both systems, but for it to block only the i386 toolchain installation feels odd.) It seems there is no clear reliable way to pass `--force-non-host` through `dtolnay/rust-toolchain` when installing a toolchain. So this replaces that action with a `curl ... | sh ...` rustup install step and environment update step, similar to what we are already doing in the other container test job (`pure-rust-build`), but with the toolchain specified explicitly (for the same reason as before, that it has sometimes been misdetected due to assuming that the system platform matched the architecture of the running kernel). This makes it easy to pass `--force-non-host` if we need to, but we actually do not need to do so, seemingly due to differences between this installation method, where the toolchain is installed at the same time `rustup` is installed, and the subtly different method `dtolnay/rust-toolchain` uses, where the installation script is run without installing any toolchain, and then a toolchain is installed in a separate `rustup` command (which is itself the command, shown above, that would need to have `--force-non-host` on i386).
1 parent d0ef276 commit 29d67cc

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/ci.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ jobs:
5353
fi
5454
done
5555
- name: Install Rust via Rustup
56-
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
56+
run: |
57+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |
58+
sh -s -- -y --profile minimal
5759
- name: Add Rust tools to path
5860
run: echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV"
5961
- name: Generate dependency tree
@@ -235,10 +237,13 @@ jobs:
235237
apt-get install --no-install-recommends -y -- "${prerequisites[@]}"
236238
shell: bash
237239
- uses: actions/checkout@v4
238-
- uses: dtolnay/rust-toolchain@stable
239-
with:
240-
# Avoid possible misdetection based on the 64-bit running kernel.
241-
toolchain: ${{ matrix.toolchain }}
240+
- name: Install Rust via Rustup
241+
run: |
242+
# Specify toolchain to avoid possible misdetection based on the 64-bit running kernel.
243+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |
244+
sh -s -- -y --default-toolchain ${{ matrix.toolchain }} --profile minimal
245+
- name: Add Rust tools to path
246+
run: echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV"
242247
- uses: Swatinem/rust-cache@v2
243248
- uses: taiki-e/install-action@v2
244249
with:

0 commit comments

Comments
 (0)