Skip to content

Commit e0b1575

Browse files
timfelansalond
authored andcommitted
[GR-66930][GR-67331][GR-66050][GR-67249] Merge GraalPy master into 25 release branch.
PullRequest: graalpython/3919
2 parents 4dad324 + 23e9fae commit e0b1575

File tree

373 files changed

+2535
-17681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+2535
-17681
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@ repos:
44
- id: checkcopyrights
55
name: Copyright check
66
language: system
7+
require_serial: true
78
entry: bash scripts/pre-commit-checkcopyrights.sh
89
types: [text]
910
- id: eclipseformat
1011
name: Eclipse formatter
1112
language: system
13+
require_serial: true
1214
entry: bash scripts/pre-commit-eclipseformat.sh
1315
types: [text]
1416
files: '\.java$'
1517
- id: checkstyle
1618
name: Checkstyle
1719
language: system
20+
require_serial: true
1821
entry: bash scripts/pre-commit-checkstyle.sh
1922
types: [text]
2023
files: '\.java$'
2124
- id: pylint
2225
name: Pylint on mx files
2326
language: system
2427
pass_filenames: false
28+
require_serial: true
2529
entry: bash scripts/pre-commit-pylint.sh
2630
types: [text]
2731
files: '^mx\.graalpython/.*\.py$'

ci.jsonnet

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -196,46 +196,6 @@
196196
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
197197
"windows:amd64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST) + batches(2),
198198
}),
199-
"python-unittest-gradle-plugin": gpgate + platform_spec(no_jobs) + platform_spec({
200-
"linux:amd64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
201-
"linux:aarch64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
202-
"darwin:aarch64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
203-
"darwin:amd64:jdk-latest" : daily + t("02:00:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
204-
"windows:amd64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE) + batches(2),
205-
"linux:amd64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
206-
"linux:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
207-
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
208-
"windows:amd64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST) + batches(2),
209-
}),
210-
"python-unittest-gradle-plugin-long-run": gpgate + platform_spec(no_jobs) + platform_spec({
211-
"linux:amd64:jdk-latest" : post_merge + t("02:30:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
212-
"linux:aarch64:jdk-latest" : post_merge + t("02:30:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
213-
"darwin:aarch64:jdk-latest" : post_merge + t("02:30:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
214-
"windows:amd64:jdk-latest" : post_merge + t("03:59:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST) + batches(2),
215-
}),
216-
"python-unittest-maven-plugin": gpgate_maven + platform_spec(no_jobs) + platform_spec({
217-
"linux:amd64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
218-
"linux:aarch64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
219-
"darwin:aarch64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
220-
"darwin:amd64:jdk-latest" : daily + t("02:00:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
221-
"windows:amd64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE) + batches(2),
222-
"linux:amd64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
223-
"linux:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
224-
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
225-
"windows:amd64:jdk-latest" : post_merge + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST) + batches(2),
226-
}),
227-
"python-junit-vfsutils": gpgate + platform_spec(no_jobs) + platform_spec({
228-
"linux:amd64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE),
229-
"linux:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE),
230-
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE),
231-
"windows:amd64:jdk-latest" : post_merge + t("03:59:00") + require(GPY_JVM_STANDALONE),
232-
}),
233-
"python-unittest-maven-plugin-long-run": gpgate_maven + platform_spec(no_jobs) + platform_spec({
234-
"linux:amd64:jdk-latest" : post_merge + t("02:30:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
235-
"linux:aarch64:jdk-latest" : post_merge + t("02:30:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
236-
"darwin:aarch64:jdk-latest" : post_merge + t("02:30:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
237-
"windows:amd64:jdk-latest" : post_merge + t("02:30:00") + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST) + batches(2),
238-
}),
239199
"python-junit": gpgate + platform_spec(no_jobs) + platform_spec({
240200
"linux:amd64:jdk21" : daily + t("01:00:00"),
241201
"linux:aarch64:jdk21" : daily + t("01:30:00"),

ci/graal/ci/common.jsonnet

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,9 @@ local common_json = import "../common.json";
265265

266266
graalpy:: self.gradle + self.cmake + {
267267
packages+: if (self.os == "linux") then {
268-
libffi: '==3.2.1',
269-
bzip2: '==1.0.6',
270-
zlib: '==1.2.11',
271-
maven: "==3.6.3",
268+
libffi: '>=3.2.1',
269+
bzip2: '>=1.0.6',
270+
maven: ">=3.3.9",
272271
} else {},
273272
},
274273

ci/graal/common.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545

4646
"oraclejdk24": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24.0.1+9", "platformspecific": true, "extrabundles": ["static-libs"]},
4747

48-
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+30", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+30-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+30-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+30-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+30-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+30-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+30-jvmci-b01-sulong", "platformspecific": true }
48+
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+32", "platformspecific": true, "extrabundles": ["static-libs"]},
49+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+32-jvmci-b01", "platformspecific": true },
50+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+32-jvmci-b01-debug", "platformspecific": true },
51+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+32-jvmci-b01-sulong", "platformspecific": true },
52+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+32-jvmci-b01", "platformspecific": true },
53+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+32-jvmci-b01-debug", "platformspecific": true },
54+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+32-jvmci-b01-sulong", "platformspecific": true }
5555
},
5656

5757
"eclipse": {

graalpython/com.oracle.graal.python.cext/include/abstract.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -755,13 +755,12 @@ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
755755
#define PySequence_Fast_GET_ITEM(o, i)\
756756
(PyList_Check(o) ? PyList_GET_ITEM((o), (i)) : PyTuple_GET_ITEM((o), (i)))
757757

758-
// GraalPy-specific
759-
PyAPI_FUNC(PyObject **) PyTruffleSequence_Fast_ITEMS(PyObject *o);
760-
761758
/* Return a pointer to the underlying item array for
762759
an object returned by PySequence_Fast */
763760
// GraalPy change
764-
#define PySequence_Fast_ITEMS(sf) PyTruffleSequence_Fast_ITEMS(sf)
761+
#define PySequence_Fast_ITEMS(sf) \
762+
(PyList_Check(sf) ? GraalPyList_ITEMS(_PyObject_CAST((sf))) \
763+
: GraalPyTuple_ITEMS(_PyObject_CAST((sf))))
765764

766765
/* Return the number of occurrences on value on 'o', that is, return
767766
the number of keys for which o[key] == value.

graalpython/com.oracle.graal.python.cext/include/cpython/abstract.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -165,13 +165,10 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
165165

166166
/* === Sequence protocol ================================================ */
167167

168-
// GraalPy-specific
169-
PyAPI_FUNC(PyObject*) PyTruffleSequence_ITEM(PyObject* obj, Py_ssize_t index);
170-
171168
/* Assume tp_as_sequence and sq_item exist and that 'i' does not
172169
need to be corrected for a negative index. */
173-
// GraalPy change
174-
#define PySequence_ITEM(o, i) PyTruffleSequence_ITEM((o), (i))
170+
#define PySequence_ITEM(o, i)\
171+
( Py_TYPE(o)->tp_as_sequence->sq_item((o), (i)) )
175172

176173
#define PY_ITERSEARCH_COUNT 1
177174
#define PY_ITERSEARCH_INDEX 2

graalpython/com.oracle.graal.python.cext/include/cpython/code.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2022, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2022, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2022 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -374,9 +374,9 @@ PyAPI_FUNC(PyObject *) PyCode_GetCellvars(PyCodeObject *code);
374374
/* Equivalent to getattr(code, 'co_freevars') in Python. */
375375
PyAPI_FUNC(PyObject *) PyCode_GetFreevars(PyCodeObject *code);
376376

377-
/* GraalPy specific to avoid direct field access. Used by (at least) pytorch */
378-
PyAPI_FUNC(PyObject*) PyCode_GetFileName(PyCodeObject* code);
379-
PyAPI_FUNC(PyObject*) PyCode_GetName(PyCodeObject* code);
377+
/* GraalPy public API to avoid direct field access. Used by (at least) pytorch patch */
378+
PyAPI_FUNC(PyObject*) GraalPyCode_GetFileName(PyCodeObject* code);
379+
PyAPI_FUNC(PyObject*) GraalPyCode_GetName(PyCodeObject* code);
380380

381381
typedef enum _PyCodeLocationInfoKind {
382382
/* short forms are 0 to 9 */

graalpython/com.oracle.graal.python.cext/include/cpython/descrobject.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2023, Oracle and/or its affiliates.
1+
/* Copyright (c) 2023, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2023 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -37,8 +37,8 @@ typedef struct {
3737

3838
#define PyDescr_COMMON PyDescrObject d_common
3939

40-
#define PyDescr_TYPE(x) PyDescrObject_GetType((PyObject*)(x))
41-
#define PyDescr_NAME(x) PyDescrObject_GetName((PyObject*)(x))
40+
#define PyDescr_TYPE(x) GraalPyDescrObject_GetType((PyObject*)(x))
41+
#define PyDescr_NAME(x) GraalPyDescrObject_GetName((PyObject*)(x))
4242

4343
typedef struct {
4444
PyDescr_COMMON;
@@ -67,3 +67,12 @@ PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
6767
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
6868
struct wrapperbase *, void *);
6969
PyAPI_FUNC(int) PyDescr_IsData(PyObject *);
70+
71+
// GraalPy public API to replace struct accessors
72+
PyAPI_FUNC(PyMethodDef*) GraalPyMethodDescrObject_GetMethod(PyObject*);
73+
PyAPI_FUNC(PyTypeObject*) GraalPyDescrObject_GetType(PyObject*);
74+
PyAPI_FUNC(PyObject*) GraalPyDescrObject_GetName(PyObject*);
75+
// Deprecated aliases kept for current versions of Cython
76+
// Remove in 27.0
77+
#define PyDescrObject_GetType GraalPyDescrObject_GetType
78+
#define PyMethodDescrObject_GetMethod GraalPyMethodDescrObject_GetMethod

graalpython/com.oracle.graal.python.cext/include/cpython/floatobject.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,17 @@ typedef struct {
1212
double ob_fval;
1313
} PyFloatObject;
1414

15-
// GraalPy addition
16-
typedef struct {
17-
GraalPyObject ob_base;
18-
double ob_fval;
19-
} GraalPyFloatObject;
20-
2115
#define _PyFloat_CAST(op) \
2216
(assert(PyFloat_Check(op)), _Py_CAST(PyFloatObject*, op))
2317

18+
// GraalPy public API
19+
PyAPI_FUNC(double) GraalPyFloat_AS_DOUBLE(PyObject* op);
20+
2421
// Static inline version of PyFloat_AsDouble() trading safety for speed.
2522
// It doesn't check if op is a double object.
2623
static inline double PyFloat_AS_DOUBLE(PyObject *op) {
27-
#if 0 // GraalPy change
28-
return _PyFloat_CAST(op)->ob_fval;
29-
#else // GraalPy change
30-
if (points_to_py_handle_space(op)) {
31-
return ((GraalPyFloatObject*) pointer_to_stub(op))->ob_fval;
32-
} else {
33-
return _PyFloat_CAST(op)->ob_fval;
34-
}
35-
#endif // GraalPy change
24+
// GraalPy change
25+
return GraalPyFloat_AS_DOUBLE(op);
3626
}
3727
#define PyFloat_AS_DOUBLE(op) PyFloat_AS_DOUBLE(_PyObject_CAST(op))
3828

graalpython/com.oracle.graal.python.cext/include/cpython/frameobject.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
/* Copyright (c) 2022, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2022 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -33,4 +33,7 @@ PyAPI_FUNC(int) _PyFrame_IsEntryFrame(PyFrameObject *frame);
3333
PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f);
3434
PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
3535

36-
PyAPI_FUNC(void) _PyFrame_SetLineNumber(PyFrameObject *, int);
36+
// GraalPy public API to avoid struct access
37+
PyAPI_FUNC(void) GraalPyFrame_SetLineNumber(PyFrameObject *, int);
38+
// Deprecated alias used by current Cython, remove in 27.0
39+
#define _PyFrame_SetLineNumber GraalPyFrame_SetLineNumber

0 commit comments

Comments
 (0)