-
Notifications
You must be signed in to change notification settings - Fork 339
Add win-64 wheel builder GHA workflow #1139
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
Merged
Merged
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 ed2ad97
refactor win-64 wheel builder workflow
swap357 3438c6e
update win-64 wheel builder workflow for chaining
swap357 0fefef0
remove run-post flag from win-64 wheel builder workflow
swap357 9d8361f
improve wheel import validation with more detailed error reporting
swap357 28ffa50
remove zlib.dll from wheel import validation
swap357 758d5bc
refactor win-64 wheel builder workflow with environment variables and…
swap357 9325838
fix local artifact path handling in win-64 wheel builder workflow
swap357 d267380
simplify dependency installation in win-64 wheel builder workflow
swap357 b855e69
remove libxml2 dependency from win-64 wheel builder workflow
swap357 6c4b1a5
add libxml2 to dependency installation in win-64 wheel builder workflow
swap357 a4b510f
simplify trigger conditions
esc 7260aa1
fixup build commands
esc 614fac1
remove complex wheel installation
esc 3248fb6
fix issues found by shellcheck
esc d92d2ce
reformat with black
esc b33d8b8
flake8
esc ba72aa6
fix quotes
esc 5a55be2
Fix error in loop found by shellcheck
dbast 71c8f43
Fix install deps step
dbast 3dcf4b5
Update artifact download name
dbast 0954403
Merge branch 'numba:main' into llvmlite_win_whl_builder_gha
swap357 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
dbast marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
dbast marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
pip install dist/*.whl | ||
python -m llvmlite.tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.