Skip to content

Allow building the C extension on GraalPy and running tests with it.#484

Merged
mattip merged 1 commit intomasterfrom
cext-on-graalpy
Apr 10, 2025
Merged

Allow building the C extension on GraalPy and running tests with it.#484
mattip merged 1 commit intomasterfrom
cext-on-graalpy

Conversation

@timfel
Copy link
Copy Markdown
Contributor

@timfel timfel commented Apr 9, 2025

With these changes we can build the HPy C extension on GraalPy and run the tests.

Copy link
Copy Markdown
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does is mean that GraalPy no longer has its own universal module? Does it now full support this via its CPython C API? Is this a good or bad thing? :)

What is the plan for the tests that fail on GraalPy? Slowly fix them somehow?

@mattip
Copy link
Copy Markdown
Contributor

mattip commented Apr 9, 2025

The previous PR merged to main was green, and now valgrind and python2.7 is failing. What changed?

@timfel
Copy link
Copy Markdown
Contributor Author

timfel commented Apr 10, 2025

The previous PR merged to main was green, and now valgrind and python2.7 is failing. What changed?

The 2.7 is just that i added a skip using sys.implementation without guarding for 2.7

The valgrind issue seems this: https://github.com/hpyproject/hpy/actions/runs/14363896576/job/40272010157?pr=484#step:6:13

python3 setup.py build_clib -f build_ext -if
/home/runner/work/hpy/hpy/.eggs/setuptools_scm-8.2.0-py3.9.egg/setuptools_scm/_integration/setuptools.py:31: RuntimeWarning: 
ERROR: setuptools==58.1.0 is used in combination with setuptools-scm>=8.x

Your build configuration is incomplete and previously worked by accident!
setuptools-scm requires setuptools>=61

Looking into it 👀

@timfel
Copy link
Copy Markdown
Contributor Author

timfel commented Apr 10, 2025

For valgrind I opened https://github.com/hpyproject/hpy/pull/485/files

@mattip
Copy link
Copy Markdown
Contributor

mattip commented Apr 10, 2025

#485 is in, do you want to rebase/merge to get that here?

@timfel
Copy link
Copy Markdown
Contributor Author

timfel commented Apr 10, 2025

What does is mean that GraalPy no longer has its own universal module? Does it now full support this via its CPython C API? Is this a good or bad thing? :)

It's a pretty good test case for our cpyext layer :)

What is the plan for the tests that fail on GraalPy? Slowly fix them somehow?

The nice thing is that these are pretty good small tests for our cpyext and they probably expose issues that manifest in other larger C extensions in a less reproducible way, so yes, I plan to pick at these and get them working. We used to have more working in fact, but we regressed a bit recently, but I would like to get this in sooner rather than later and continue with follow-up PRs.

@timfel timfel force-pushed the cext-on-graalpy branch 4 times, most recently from 9168f4b to e439953 Compare April 10, 2025 07:01
@hodgestar
Copy link
Copy Markdown
Contributor

The changes look good from my side. Happy to review again later once tests are passing.

@@ -1,4 +1,5 @@
from .support import HPyTest, make_hpy_abi_fixture
import pytest
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattip do these need to run as apptests in pypy?

@@ -1,4 +1,5 @@
from .support import HPyTest, SUPPORTS_SYS_EXECUTABLE, trampoline
import pytest
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattip same question as for test_cpy_compat, do these need to run as apptests in pypy? If so I will pull the skip into the body of the methods like in test_object.py etc

@timfel
Copy link
Copy Markdown
Contributor Author

timfel commented Apr 10, 2025

The changes look good from my side. Happy to review again later once tests are passing.

Thanks, tests are passing now, just need someone to check if this'll work for PyPy apptests.

@mattip
Copy link
Copy Markdown
Contributor

mattip commented Apr 10, 2025

All the test_* files are run untranslated on PyPy, so we cannot import pytest in the global level. On the other hand, it only becomes an issue if we pull latest HPy HEAD into PyPy, which will only happen if there is more development of PyPy + HPy. I am not sure that will happen, so I think we can merge the code as you have it here and refactor for PyPy when/if needed.

@mattip mattip merged commit d92d595 into master Apr 10, 2025
37 checks passed
@mattip
Copy link
Copy Markdown
Contributor

mattip commented Apr 10, 2025

It might be nice to make a release of HPy since HEAD includes the changes needed for Cython.

@timfel timfel deleted the cext-on-graalpy branch April 10, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants