Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add win-64 wheel builder GHA workflow #1139

Merged
merged 22 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e06c6f7
add win-64 wheel builder GHA workflow
swap357 Jan 30, 2025
ed2ad97
refactor win-64 wheel builder workflow
swap357 Jan 31, 2025
3438c6e
update win-64 wheel builder workflow for chaining
swap357 Feb 4, 2025
0fefef0
remove run-post flag from win-64 wheel builder workflow
swap357 Feb 4, 2025
9d8361f
improve wheel import validation with more detailed error reporting
swap357 Feb 4, 2025
28ffa50
remove zlib.dll from wheel import validation
swap357 Feb 4, 2025
758d5bc
refactor win-64 wheel builder workflow with environment variables and…
swap357 Feb 4, 2025
9325838
fix local artifact path handling in win-64 wheel builder workflow
swap357 Feb 4, 2025
d267380
simplify dependency installation in win-64 wheel builder workflow
swap357 Feb 4, 2025
b855e69
remove libxml2 dependency from win-64 wheel builder workflow
swap357 Feb 4, 2025
6c4b1a5
add libxml2 to dependency installation in win-64 wheel builder workflow
swap357 Feb 4, 2025
a4b510f
simplify trigger conditions
esc Feb 10, 2025
7260aa1
fixup build commands
esc Feb 10, 2025
614fac1
remove complex wheel installation
esc Feb 10, 2025
3248fb6
fix issues found by shellcheck
esc Feb 10, 2025
d92d2ce
reformat with black
esc Feb 10, 2025
b33d8b8
flake8
esc Feb 10, 2025
ba72aa6
fix quotes
esc Feb 10, 2025
5a55be2
Fix error in loop found by shellcheck
dbast Feb 11, 2025
71c8f43
Fix install deps step
dbast Feb 11, 2025
3dcf4b5
Update artifact download name
dbast Feb 11, 2025
0954403
Merge branch 'numba:main' into llvmlite_win_whl_builder_gha
swap357 Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions .github/workflows/llvmlite_win-64_wheel_builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: llvmlite_win-64_wheel_builder

on:
pull_request:
paths:
- .github/workflows/llvmlite_win-64_wheel_builder.yml
workflow_dispatch:
inputs:
llvmdev_run_id:
description: 'llvmdev workflow run ID (optional)'
required: false
type: string

# Add concurrency control
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
LOCAL_LLVMDEV_ARTIFACT_PATH: D:/a/llvmlite/llvmlite/llvmdev_conda_packages
FALLBACK_LLVMDEV_VERSION: "15"
CONDA_CHANNEL_NUMBA: numba/label/win64_wheel
VALIDATION_PYTHON_VERSION: "3.12"
ARTIFACT_RETENTION_DAYS: 7

jobs:
win-64-build:
name: win-64-build
runs-on: windows-2019
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: false

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
conda-remove-defaults: true
auto-update-conda: true
auto-activate-base: true

- name: Download llvmdev Artifact
if: ${{ inputs.llvmdev_run_id != '' }}
uses: actions/download-artifact@v4
with:
name: llvmdev_win-64_conda
path: llvmdev_conda_packages
run-id: ${{ inputs.llvmdev_run_id }}
repository: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install build dependencies
run: |
set -x
if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then
CHAN="file:///${{ env.LOCAL_LLVMDEV_ARTIFACT_PATH }}"
else
CHAN="${{ env.CONDA_CHANNEL_NUMBA }}"
fi
conda install -c "$CHAN" llvmdev=${{ env.FALLBACK_LLVMDEV_VERSION }} cmake libxml2 python-build

- name: Build wheel
run: python -m build

- name: Upload llvmlite wheel
uses: actions/upload-artifact@v4
with:
name: llvmlite-win-64-py${{ matrix.python-version }}
path: dist/*.whl
compression-level: 0
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error

win-64-validate:
name: win-64-validate
needs: win-64-build
runs-on: windows-2019
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ env.VALIDATION_PYTHON_VERSION }}
conda-remove-defaults: true
auto-update-conda: true
auto-activate-base: true

- name: Install validation dependencies
run: conda install -c defaults py-lief wheel twine keyring rfc3986

- name: Download llvmlite wheels
uses: actions/download-artifact@v4
with:
name: llvmlite-win-64-py${{ matrix.python-version }}
path: dist

- name: Validate wheels
run: |
cd dist
for WHL_FILE in *.whl; do
wheel unpack "$WHL_FILE"
python "$GITHUB_WORKSPACE"/buildscripts/github/validate_win64_wheel.py llvmlite/binding/llvmlite.dll
twine check "$WHL_FILE"
done

win-64-test:
name: win-64-test
needs: win-64-validate
runs-on: windows-2019
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: false

steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Download llvmlite wheel
uses: actions/download-artifact@v4
with:
name: llvmlite-win-64-py${{ matrix.python-version }}
path: dist

- name: Install and test
run: |
pip install dist/*.whl
python -m llvmlite.tests
38 changes: 38 additions & 0 deletions buildscripts/github/validate_win64_wheel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import lief
import pathlib

for path in pathlib.Path(".").rglob("**/*.dll"):
print("path", path)
dll = lief.PE.parse(str(path))

if hasattr(dll, "delay_imports"):
delay_imports = {x.name for x in dll.delay_imports}
print("Delay imports:", delay_imports)
expected_delay_imports = {"SHELL32.dll", "ole32.dll"}
assert (
delay_imports == expected_delay_imports
), f"Unexpected delay imports: {delay_imports}"

imports = {x.name for x in dll.imports}
print("Regular imports:", imports)
expected_imports = {
"ADVAPI32.dll",
"KERNEL32.dll",
"MSVCP140.dll",
"VCRUNTIME140.dll",
"VCRUNTIME140_1.dll",
"api-ms-win-crt-convert-l1-1-0.dll",
"api-ms-win-crt-environment-l1-1-0.dll",
"api-ms-win-crt-heap-l1-1-0.dll",
"api-ms-win-crt-locale-l1-1-0.dll",
"api-ms-win-crt-math-l1-1-0.dll",
"api-ms-win-crt-runtime-l1-1-0.dll",
"api-ms-win-crt-stdio-l1-1-0.dll",
"api-ms-win-crt-string-l1-1-0.dll",
"api-ms-win-crt-time-l1-1-0.dll",
"api-ms-win-crt-utility-l1-1-0.dll",
}
assert imports == expected_imports, (
f"Unexpected imports: {imports - expected_imports}\n"
f"Missing imports: {expected_imports - imports}"
)
Loading