Skip to content

Commit 8942e47

Browse files
committed
update numpy patch to compile on windows
1 parent 878fd17 commit 8942e47

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

graalpython/lib-graalpython/patches/numpy/numpy-1.26.4.patch

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,31 @@ index d4b73eb..af90a68 100644
77
try:
88
p = subprocess.Popen(
99
- ['git', 'log', '-1', '--format="%H %aI"'],
10-
+ ['git', 'log', '-1', "--format='%H %aI'"],
10+
+ ['git', 'log', '-1', "--format='%H %aI'"], # Workaround for GraalPy's emulated posix backend on Windows
1111
stdout=subprocess.PIPE,
1212
stderr=subprocess.PIPE,
1313
cwd=os.path.dirname(__file__),
14+
--- a/vendored-meson/meson/mesonbuild/utils/universal.py
15+
+++ b/vendored-meson/meson/mesonbuild/utils/universal.py
16+
@@ -727,6 +727,7 @@ def windows_detect_native_arch() -> str:
17+
"""
18+
if sys.platform != 'win32':
19+
return ''
20+
+ return 'amd64' # Workaround for GraalPy bug on Windows with kernel32.GetCurrentProcess()
21+
try:
22+
import ctypes
23+
process_arch = ctypes.c_ushort()
24+
--- a/vendored-meson/meson/mesonbuild/dependencies/python.py
25+
+++ b/vendored-meson/meson/mesonbuild/dependencies/python.py
26+
@@ -286,6 +286,8 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
27+
libpath = Path(f'libpypy{verdot}-c.dll')
28+
else:
29+
libpath = Path(f'python{vernum}.dll')
30+
+ elif self.variables.get('SOABI', '').startswith('graalpy'):
31+
+ libpath = Path('libs') / 'python-native.lib'
32+
else:
33+
if limited_api:
34+
vernum = vernum[0]
1435
--- a/numpy/core/include/numpy/ndarrayobject.h
1536
+++ b/numpy/core/include/numpy/ndarrayobject.h
1637
@@ -225,7 +225,7 @@ NPY_TITLE_KEY_check(PyObject *key, PyObject *value)

0 commit comments

Comments
 (0)