Skip to content

Commit c3e9513

Browse files
committed
[GR-59373] Merge GraalPy public and internal wheelbuilder.
PullRequest: graalpython/3539
2 parents ee43df2 + 9e583ba commit c3e9513

31 files changed

+939
-5472
lines changed

.github/workflows/build-act-wheels.yml

Lines changed: 0 additions & 577 deletions
This file was deleted.

.github/workflows/build-linux-aarch64-wheels.yml

Lines changed: 14 additions & 918 deletions
Large diffs are not rendered by default.

.github/workflows/build-linux-amd64-wheels.yml

Lines changed: 18 additions & 1284 deletions
Large diffs are not rendered by default.

.github/workflows/build-macos-aarch64-wheels.yml

Lines changed: 15 additions & 765 deletions
Large diffs are not rendered by default.

.github/workflows/build-macos-amd64-wheels.yml

Lines changed: 13 additions & 763 deletions
Large diffs are not rendered by default.

.github/workflows/build-repository.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/build-windows-amd64-wheels.yml

Lines changed: 15 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -2,141 +2,34 @@ name: build-windows-amd64-wheels
22
'on':
33
workflow_dispatch:
44
inputs:
5-
name:
5+
packages:
66
type: string
7-
description: Pkg to build (empty for all)
7+
description: Pkgs to build (comma-separated, empty for all)
88
required: false
9-
graalpy:
9+
graalpy_url:
1010
type: string
11-
description: GraalPy download url prefix (empty for default)
12-
required: false
11+
description: GraalPy download url
12+
required: true
1313
jobs:
14-
numpy-windows-amd64:
14+
build_wheels:
1515
runs-on: windows-latest
16-
if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy') }}
16+
env:
17+
PACKAGES_TO_BUILD: ${{ inputs.packages }}
1718
steps:
1819
- uses: ilammy/msvc-dev-cmd@v1
19-
- name: Install dependencies
20-
run: |
21-
Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip
22-
Expand-Archive patch.zip -DestinationPath ../patch -Force
2320
- name: Checkout
2421
uses: actions/checkout@main
25-
- name: Setup custom GraalPy
26-
if: inputs.graalpy != ''
27-
run: |-
28-
$ProgressPreference = 'SilentlyContinue'
29-
Invoke-WebRequest ${{ inputs.graalpy }}-windows-amd64.zip -OutFile graalpy-windows-amd64.zip
30-
Expand-Archive graalpy-windows-amd64.zip
31-
mv graalpy-windows-amd64/* graalpy
32-
graalpy/bin/graalpy.exe -s -m ensurepip
33-
graalpy/bin/graalpy.exe -m pip install wheel
34-
- name: Setup GraalPy
22+
- name: Setup Python
3523
uses: actions/setup-python@v5
36-
if: inputs.graalpy == ''
3724
with:
38-
python-version: graalpy24.1
39-
- name: Setup local GraalPy venv
40-
if: inputs.graalpy == ''
41-
run: python -m venv graalpy
42-
- name: Build wheel
43-
run: |-
44-
$env:PIP_FIND_LINKS=$PWD
45-
$env:PATH+=";$PWD\graalpy\bin;$PWD\graalpy\Scripts;$PWD\..\patch\bin"
46-
graalpy/bin/graalpy -m pip wheel --find-links $PWD numpy
47-
- name: Store wheels
48-
uses: actions/upload-artifact@main
49-
with:
50-
name: numpy-windows-amd64
51-
path: numpy*.whl
52-
if-no-files-found: error
53-
PyYAML-windows-amd64:
54-
runs-on: windows-latest
55-
needs: numpy-windows-amd64
56-
if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML') }}
57-
steps:
58-
- uses: ilammy/msvc-dev-cmd@v1
59-
- name: Install dependencies
25+
python-version: 3.12
26+
- name: Build wheels
6027
run: |
61-
Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip
62-
Expand-Archive patch.zip -DestinationPath ../patch -Force
63-
- name: Checkout
64-
uses: actions/checkout@main
65-
- name: Setup custom GraalPy
66-
if: inputs.graalpy != ''
67-
run: |-
68-
$ProgressPreference = 'SilentlyContinue'
69-
Invoke-WebRequest ${{ inputs.graalpy }}-windows-amd64.zip -OutFile graalpy-windows-amd64.zip
70-
Expand-Archive graalpy-windows-amd64.zip
71-
mv graalpy-windows-amd64/* graalpy
72-
graalpy/bin/graalpy.exe -s -m ensurepip
73-
graalpy/bin/graalpy.exe -m pip install wheel
74-
- name: Setup GraalPy
75-
uses: actions/setup-python@v5
76-
if: inputs.graalpy == ''
77-
with:
78-
python-version: graalpy24.1
79-
- name: Setup local GraalPy venv
80-
if: inputs.graalpy == ''
81-
run: python -m venv graalpy
82-
- name: Download artifacts from numpy
83-
uses: actions/download-artifact@main
84-
continue-on-error: true
85-
with:
86-
name: numpy-windows-amd64
87-
- name: Build wheel
88-
run: |-
89-
$env:PIP_FIND_LINKS=$PWD
90-
$env:PATH+=";$PWD\graalpy\bin;$PWD\graalpy\Scripts;$PWD\..\patch\bin"
91-
graalpy/bin/graalpy -m pip wheel --find-links $PWD PyYAML
92-
- name: Store wheels
93-
uses: actions/upload-artifact@main
94-
with:
95-
name: PyYAML-windows-amd64
96-
path: PyYAML*.whl
97-
if-no-files-found: error
98-
ujson-windows-amd64:
99-
runs-on: windows-latest
100-
needs: PyYAML-windows-amd64
101-
if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }}
102-
steps:
103-
- uses: ilammy/msvc-dev-cmd@v1
104-
- name: Install dependencies
105-
run: |
106-
Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip
107-
Expand-Archive patch.zip -DestinationPath ../patch -Force
108-
- name: Checkout
109-
uses: actions/checkout@main
110-
- name: Setup custom GraalPy
111-
if: inputs.graalpy != ''
112-
run: |-
113-
$ProgressPreference = 'SilentlyContinue'
114-
Invoke-WebRequest ${{ inputs.graalpy }}-windows-amd64.zip -OutFile graalpy-windows-amd64.zip
115-
Expand-Archive graalpy-windows-amd64.zip
116-
mv graalpy-windows-amd64/* graalpy
117-
graalpy/bin/graalpy.exe -s -m ensurepip
118-
graalpy/bin/graalpy.exe -m pip install wheel
119-
- name: Setup GraalPy
120-
uses: actions/setup-python@v5
121-
if: inputs.graalpy == ''
122-
with:
123-
python-version: graalpy24.1
124-
- name: Setup local GraalPy venv
125-
if: inputs.graalpy == ''
126-
run: python -m venv graalpy
127-
- name: Download artifacts from PyYAML
128-
uses: actions/download-artifact@main
129-
continue-on-error: true
130-
with:
131-
name: PyYAML-windows-amd64
132-
- name: Build wheel
133-
run: |-
134-
$env:PIP_FIND_LINKS=$PWD
135-
$env:PATH+=";$PWD\graalpy\bin;$PWD\graalpy\Scripts;$PWD\..\patch\bin"
136-
graalpy/bin/graalpy -m pip wheel --find-links $PWD ujson
28+
$env:PATH+=";C:\Program Files\Git\usr\bin"
29+
python3 scripts/wheelbuilder/build_wheels.py ${{ inputs.graalpy_url }}
13730
- name: Store wheels
13831
uses: actions/upload-artifact@main
13932
with:
140-
name: ujson-windows-amd64
141-
path: ujson*.whl
33+
name: wheels
34+
path: wheelhouse/*.whl
14235
if-no-files-found: error

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ language runtime. The main focus is on user-observable behavior of the engine.
1313
* This means all Python methods of these types are available on the corresponding foreign objects, which behave as close as possible as if they were Python objects.
1414
* See [the documentation](https://github.com/oracle/graalpython/blob/master/docs/user/Interoperability.md#interacting-with-foreign-objects-from-python-scripts) for more information.
1515
* Remove support for running with Sulong managed both in embeddings as well as through the `graalpy-managed` launcher.
16+
* Rewrite wheelbuilder to be easier to use and contribute to. This version is now the same we run internally to build publishable wheels for some platforms we support, so the community can build the same wheels on their own hardware easily if desired.
1617

1718
## Version 24.1.0
1819
* GraalPy is now considered stable for pure Python workloads. While many workloads involving native extension modules work, we continue to consider them experimental. You can use the command-line option `--python.WarnExperimentalFeatures` to enable warnings for such modules at runtime. In Java embeddings the warnings are enabled by default and you can suppress them by setting the context option 'python.WarnExperimentalFeatures' to 'false'.

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "947e97f768b6e4a5868c3afa76617c2b2f72ff33" }
1+
{ "overlay": "a53f75105e24ff44381970de172a8462fa45b9a7" }

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/CExtContext.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import org.graalvm.shadowed.com.ibm.icu.impl.Punycode;
6060
import org.graalvm.shadowed.com.ibm.icu.text.StringPrepParseException;
6161

62+
import com.oracle.graal.python.builtins.PythonOS;
6263
import com.oracle.graal.python.builtins.objects.cext.capi.CApiContext;
6364
import com.oracle.graal.python.builtins.objects.cext.common.CExtCommonNodes.CheckFunctionResultNode;
6465
import com.oracle.graal.python.builtins.objects.cext.common.LoadCExtException.ApiInitException;
@@ -309,7 +310,10 @@ public static Object loadCExtModule(Node location, PythonContext context, Module
309310
String message = "Loading C extension module %s from '%s'. Support for the Python C API is considered experimental.";
310311
if (!runViaLauncher) {
311312
message += " See https://www.graalvm.org/latest/reference-manual/python/Native-Extensions/#embedding-limitations for the limitations. " +
312-
"You can suppress this warning by setting the context option 'python.WarnExperimentalFeatures' to 'false'";
313+
"You can suppress this warning by setting the context option 'python.WarnExperimentalFeatures' to 'false'.";
314+
}
315+
if (PythonOS.getPythonOS() == PythonOS.PLATFORM_WIN32) {
316+
message += " If loading binary wheels fails, please make sure you installed the latest Microsoft Visual C++ Redistributable from https://aka.ms/vs/17/release/vc_redist.x64.exe.";
313317
}
314318
getLogger().warning(message.formatted(spec.name, spec.path));
315319
}

0 commit comments

Comments
 (0)