Skip to content

Commit

Permalink
Try again to make cross-compiling on Windows work.
Browse files Browse the repository at this point in the history
Change-Id: I620e5f48642454572a2187ce0532c2b333603389
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61613
Reviewed-by: Alex Chernyakhovsky <[email protected]>
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Jul 28, 2023
1 parent d992627 commit 0571ffa
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ jobs:
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 }}
Expand All @@ -125,9 +122,15 @@ jobs:
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
Expand All @@ -138,7 +141,7 @@ jobs:
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
Expand Down Expand Up @@ -182,7 +185,7 @@ jobs:
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
Expand Down

0 comments on commit 0571ffa

Please sign in to comment.