Try again to make cross-compiling on Windows work.
Change-Id: I620e5f48642454572a2187ce0532c2b333603389
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61613
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 9989a52..24b7efa 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -109,10 +109,7 @@
arch:
- { name: X86, bazel-name: x64_x86, python-name: win32 }
- { name: X64, bazel-name: x64, python-name: win_amd64 }
- # FIXME: Compiling succeeds, but linking fails with an error like
- # "LINK : fatal error LNK1104: cannot open file 'python311.lib'".
- # Maybe we will need GitHub-hosted runners for Windows on ARM64?!
- # - { name: ARM64, bazel-name: arm64, python-name: win_arm64 }
+ - { name: ARM64, bazel-name: arm64, python-name: win_arm64 }
ver: ['3.8', '3.9', '3.10', '3.11']
env:
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -125,9 +122,15 @@
choco uninstall -y bazel
choco install -y bazelisk
shell: bash
+ # Lowercase the architecture name for `actions/setup-python`.
+ - run: |
+ ARCHITECTURE=${{ matrix.arch.name }}
+ echo "architecture=${ARCHITECTURE,,}" >> "${GITHUB_ENV}"
+ shell: bash
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.ver }}
+ architecture: ${{ env.architecture }}
- name: Prepare Python ${{ matrix.ver }} environment
run: |
python -m pip install --upgrade pip
@@ -138,7 +141,7 @@
run: |
python setup.py bdist_wheel \
--plat-name=${{ matrix.arch.python-name }}
- python -m delvewheel --wheel-dir=. dist/*
+ python -m delvewheel repair --wheel-dir=. dist/*
shell: bash
working-directory: python
- if: matrix.arch.name == runner.arch
@@ -182,7 +185,7 @@
run: |
mkdir -p dist
for WHL in */google_re2-*.whl; do
- python -m wheel unpack ${WHL}
+ python -m wheel unpack "${WHL}"
python -m wheel pack --dest-dir=dist --build-number=${{ inputs.build }} google_re2-*
rm -rf google_re2-*
done