mirror of
https://github.com/dtolnay/rust-toolchain
synced 2026-09-14 20:13:54 +00:00
Pass --force-non-host unconditionally
This commit is contained in:
@@ -53,7 +53,6 @@ jobs:
|
||||
- uses: ./
|
||||
with:
|
||||
toolchain: stable-i686-pc-windows-msvc
|
||||
force-non-host: true
|
||||
- name: Check the active toolchain and compiler host
|
||||
run: |
|
||||
test "$(rustup show active-toolchain)" = "stable-i686-pc-windows-msvc (default)"
|
||||
|
||||
@@ -53,10 +53,6 @@ All inputs are optional.
|
||||
<td><code>components</code></td>
|
||||
<td>Comma-separated string of additional components to install e.g. <code>clippy, rustfmt</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>force-non-host</code></td>
|
||||
<td>Pass <code>--force-non-host</code> to rustup when installing and selecting the default toolchain. Defaults to <code>false</code>. Set to <code>true</code> when intentionally using a non-host toolchain that the host can run.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
+4
-9
@@ -18,12 +18,6 @@ inputs:
|
||||
components:
|
||||
description: Comma-separated list of components to be additionally installed
|
||||
required: false
|
||||
# Rustup 1.29.1 requires explicit opt-in for i686 toolchains on x64 Windows.
|
||||
# https://github.com/rust-lang/rustup/pull/4935
|
||||
force-non-host:
|
||||
description: Allow installing and selecting a toolchain that does not match the host platform
|
||||
required: false
|
||||
default: "false"
|
||||
|
||||
outputs:
|
||||
cachekey:
|
||||
@@ -66,7 +60,6 @@ runs:
|
||||
echo "targets=$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)" >> $GITHUB_OUTPUT
|
||||
echo "components=$(for c in ${components//,/ }; do echo -n ' --component' $c; done)" >> $GITHUB_OUTPUT
|
||||
echo "downgrade=${{steps.parse.outputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}" >> $GITHUB_OUTPUT
|
||||
echo "force-non-host=${{inputs.force-non-host == 'true' && ' --force-non-host' || ''}}" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
targets: ${{inputs.targets || inputs.target || ''}}
|
||||
components: ${{inputs.components}}
|
||||
@@ -95,14 +88,16 @@ runs:
|
||||
if: runner.os == 'Windows'
|
||||
shell: bash
|
||||
|
||||
# Let rustc below check whether the requested toolchain can run on this host.
|
||||
# This also permits i686 on x64 Windows: https://github.com/rust-lang/rustup/pull/4935.
|
||||
- name: rustup toolchain install ${{steps.parse.outputs.toolchain}}
|
||||
run: rustup toolchain install ${{steps.parse.outputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update${{steps.flags.outputs.force-non-host}}
|
||||
run: rustup toolchain install ${{steps.parse.outputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update --force-non-host
|
||||
env:
|
||||
RUSTUP_PERMIT_COPY_RENAME: 1
|
||||
shell: bash
|
||||
|
||||
- name: rustup default ${{steps.parse.outputs.toolchain}}
|
||||
run: rustup default ${{steps.parse.outputs.toolchain}}${{steps.flags.outputs.force-non-host}}
|
||||
run: rustup default ${{steps.parse.outputs.toolchain}} --force-non-host
|
||||
shell: bash
|
||||
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127
|
||||
|
||||
|
||||
Reference in New Issue
Block a user