Skip to content

Commit ac5ed11

Browse files
committed
fix setting CARGO_BUILD_TARGET
1 parent 67ca81a commit ac5ed11

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
continue-on-error: ${{ endsWith(inputs.python-version, '-dev') || contains(fromJSON('["3.7", "3.8"]'), inputs.python-version) || contains(fromJSON('["beta", "nightly"]'), inputs.rust) }}
2626
runs-on: ${{ inputs.os }}
2727
if: ${{ !(startsWith(inputs.python-version, 'graalpy') && startsWith(inputs.os, 'windows')) }}
28+
env:
29+
# On windows 32 bit, we are running on an x64 host, so we need to specifically set the target
30+
# NB we don't do this for *all* jobs because it breaks coverage of proc macros to have an
31+
# explicit target set.
32+
CARGO_BUILD_TARGET: ${{ (inputs.os == 'windows-latest' && inputs.python-architecture == 'x86' && inputs.rust-target) || '' }}
2833
steps:
2934
- uses: actions/checkout@v4
3035
with:
@@ -59,13 +64,6 @@ jobs:
5964
# rust-src needed to correctly format errors, see #1865
6065
components: rust-src,llvm-tools-preview
6166

62-
# On windows 32 bit, we are running on an x64 host, so we need to specifically set the target
63-
# NB we don't do this for *all* jobs because it breaks coverage of proc macros to have an
64-
# explicit target set.
65-
- if: ${{ inputs.os == 'windows-latest' && inputs.python-architecture == 'x86' }}
66-
name: Set cargo target
67-
run: echo "CARGO_BUILD_TARGET=${{ inputs.rust-target }}" >> $GITHUB_ENV
68-
6967
- uses: Swatinem/rust-cache@v2
7068
with:
7169
save-if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}

0 commit comments

Comments
 (0)