Skip to content

Commit 8267af4

Browse files
committed
[GR-60191][GR-60192] Refactor coverage gates, run on multiple patforms
PullRequest: graalpython/3597
2 parents 4224281 + d409a82 commit 8267af4

File tree

33 files changed

+178
-848
lines changed

33 files changed

+178
-848
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ language runtime. The main focus is on user-observable behavior of the engine.
1616
* 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.
1717
* `pip` is now able to fetch newer versions of GraalPy patches for third-party packages from `graalpython` GitHub repository, allowing us to add new patches to released versions.
1818
* The patch repository can be overridden using `PIP_GRAALPY_PATCHES_URL` environment variable, which can point to a local path or a URL. It can be disabled by setting it to an empty string.
19-
* Added `GRAALPY_VERSION` and `GRAALPY_VERSION_NUM` C macros
19+
* Added `GRAALPY_VERSION` and `GRAALPY_VERSION_NUM` C macros.
20+
* Remove `ginstall` module. It hasn't been necessary for several releases. Please, use `pip install`.
21+
* Remove experimental `SetupLLVMLibraryPaths` option. It was used to pre-set library path for LLVM toolchain's libc++. The path can still be set manually.
2022

2123
## Version 24.1.0
2224
* 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": "cdd68c4c8eaada96094af74927c487b5b8d95ec8" }
1+
{ "overlay": "85b7a69ee24cdbfc05245c449347ef4feec038a7" }

docs/contributor/IMPLEMENTATION_DETAILS.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,11 @@ and holding on to the last (if any) in a local variable.
8585
Some PyPI packages contain code that is not compatible with GraalPy.
8686
To overcome this limitation and support such packages, GraalPy contains
8787
patches for some popular packages. The patches are applied to packages
88-
installed via GraalPy specific utility `ginstall` and also to packages
8988
installed via `pip`. This is achieved by patching `pip` code.
9089

9190
The patches are regular POSIX `patch` command compatible diffs located in
92-
`lib-graalpython/patches`. Check out the directory structure and metadate.toml
93-
files to get an idea of how rules are set for patches to be applied.
91+
`lib-graalpython/patches`. The directory has a `README.md` file describing
92+
how the patches are applied.
9493

9594
## The GIL
9695

graalpy_virtualenv/graalpy_virtualenv/graalpy.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
from subprocess import check_output as subprocess_check_output
4444

4545
from virtualenv.create.creator import Creator
46-
from virtualenv.create.describe import PosixSupports
46+
from virtualenv.create.describe import PosixSupports, WindowsSupports
4747
from virtualenv.seed.embed.pip_invoke import PipInvoke
4848
from virtualenv.seed.wheels import get_wheel
4949
from virtualenv.seed.wheels.bundle import from_dir
5050

5151

52-
class GraalPyCreatorPosix(Creator, PosixSupports):
52+
class AbstractGraalPyCreator(Creator):
5353
"""
5454
Describe and fake Creator service for GraalPy.
5555
@@ -115,13 +115,21 @@ def create(self):
115115
"or environment variable VIRTUALENV_CREATOR=venv")
116116

117117

118+
class GraalPyCreatorPosix(AbstractGraalPyCreator, PosixSupports):
119+
pass
120+
121+
122+
class GraalPyCreatorWindows(AbstractGraalPyCreator, WindowsSupports):
123+
pass
124+
125+
118126
@lru_cache()
119127
def get_ensurepip_path(exe):
120128
if exe.samefile(sys.executable):
121129
import ensurepip
122130
ensurepip_path = ensurepip.__path__[0]
123131
else:
124-
cmd = [exe, "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])']
132+
cmd = [str(exe), "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])']
125133
ensurepip_path = subprocess_check_output(cmd, universal_newlines=True).strip()
126134
return Path(ensurepip_path) / '_bundled'
127135

graalpy_virtualenv/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ dependencies = [
5959

6060
[project.entry-points."virtualenv.create"]
6161
graalpy-posix = "graalpy_virtualenv.graalpy:GraalPyCreatorPosix"
62+
graalpy-windows = "graalpy_virtualenv.graalpy:GraalPyCreatorWindows"
6263

6364
[project.entry-points."virtualenv.seed"]
6465
graalpy = "graalpy_virtualenv:graalpy.GraalPySeeder"

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ static void initialize_builtin_types_and_structs() {
238238

239239
int mmap_getbuffer(PyObject *self, Py_buffer *view, int flags) {
240240
// TODO(fa) readonly flag
241-
return PyBuffer_FillInfo(view, (PyObject*)self, GraalPyTruffle_GetMMapData(self), PyObject_Size((PyObject *)self), 0, flags);
241+
char* data = GraalPyTruffle_GetMMapData(self);
242+
if (!data) {
243+
return -1;
244+
}
245+
return PyBuffer_FillInfo(view, (PyObject*)self, data, PyObject_Size((PyObject *)self), 0, flags);
242246
}
243247

244248
PyAPI_FUNC(void) mmap_init_bufferprotocol(PyObject* mmap_type) {

graalpython/com.oracle.graal.python.frozen/freeze_modules.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def add_graalpython_core():
119119
"java",
120120
"pip_hook",
121121
"unicodedata",
122-
"sulong_support",
123122
]:
124123
modname = f"graalpy.{os.path.basename(name)}"
125124
modpath = os.path.join(lib_graalpython, f"{name}.py")

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,6 @@ protected void launch(Builder contextBuilder) {
762762
if (!noSite) {
763763
contextBuilder.option("python.ForceImportSite", "true");
764764
}
765-
contextBuilder.option("python.SetupLLVMLibraryPaths", "true");
766765
contextBuilder.option("python.IgnoreEnvironmentFlag", Boolean.toString(ignoreEnv));
767766
contextBuilder.option("python.UnbufferedIO", Boolean.toString(unbufferedIO));
768767

graalpython/com.oracle.graal.python.test/src/runner.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ def run_in_subprocess_and_watch(self):
727727
port = server.getsockname()[1]
728728
assert port
729729

730+
retries = 3
731+
730732
while self.remaining_test_ids and not self.stop_event.is_set():
731733
last_remaining_count = len(self.remaining_test_ids)
732734
with open(tmp_dir / 'out', 'w+') as self.out_file:
@@ -744,8 +746,17 @@ def run_in_subprocess_and_watch(self):
744746
cmd.append('--failfast')
745747
self.process = subprocess.Popen(cmd, stdout=self.out_file, stderr=self.out_file)
746748

747-
server.settimeout(600.0)
748-
with server.accept()[0] as sock:
749+
server.settimeout(180.0)
750+
try:
751+
sock = server.accept()[0]
752+
except TimeoutError:
753+
interrupt_process(self.process)
754+
retries -= 1
755+
if retries:
756+
continue
757+
sys.exit("Worker failed to connect to runner multiple times")
758+
759+
with sock:
749760
conn = Connection(sock)
750761

751762
conn.send([TestSpecifier(t.test_file, t.test_name) for t in self.remaining_test_ids])

graalpython/com.oracle.graal.python.test/src/tests/conftest.toml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,20 @@ partial_splits_individual_tests = true
1212
# on Windows, yet, add their files here.
1313
exclude_on = ['win32']
1414
selector = [
15-
"test_code.py", # forward slash in path problem
16-
"test_csv.py",
17-
"test_imports.py", # import posix
18-
"test_locale.py",
19-
"test_math.py",
20-
"test_memoryview.py",
21-
"test_mmap.py", # sys.getwindowsversion
22-
"test_multiprocessing.py", # import _winapi
15+
"test_mmap.py", # all tests fail with PermissionError, so does the mmap test in test_memoryview and cpyext/test_abstract
2316
"test_multiprocessing_graalpy.py", # import _winapi
2417
"test_patched_pip.py",
2518
"test_pathlib.py",
26-
"test_pdb.py", # Tends to hit GR-41935
2719
"test_posix.py", # import posix
28-
"test_pyio.py",
20+
"test_pyio.py", # pyio imports msvcrt
2921
"test_signal.py",
30-
"test_struct.py",
3122
"test_structseq.py", # import posix
32-
"test_subprocess.py",
33-
"test_thread.py", # sys.getwindowsversion
34-
"test_traceback.py",
35-
"test_zipimport.py", # sys.getwindowsversion
36-
"test_ssl_java_integration.py",
37-
"cpyext/test_abstract.py",
38-
"cpyext/test_functions.py",
39-
"cpyext/test_long.py",
40-
"cpyext/test_member.py",
41-
"cpyext/test_memoryview.py",
42-
"cpyext/test_misc.py",
23+
"cpyext/test_abstract.py", # mmap PermissionError
24+
"cpyext/test_member.py", # Too many assumptions about long size
25+
"cpyext/test_memoryview.py", # Failure in test_memoryview_read_0dim
4326
"cpyext/test_mmap.py",
44-
"cpyext/test_slice.py",
45-
"cpyext/test_shutdown.py",
46-
"cpyext/test_thread.py",
47-
"cpyext/test_unicode.py",
48-
"cpyext/test_wiki.py",
49-
"cpyext/test_tp_slots.py", # Temporarily disabled due to GR-54345
27+
"cpyext/test_shutdown.py", # Uses gcc-specific attribute
28+
"cpyext/test_wiki.py", # Assumptions about long size
5029
]
5130

5231
[[test_rules]]

0 commit comments

Comments
 (0)