-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infer python version from Makefile.envs in PyO3 #19
Infer python version from Makefile.envs in PyO3 #19
Conversation
It isn't working, but at least I found that integration tests are useful enough to detect this kind or errors :) Let's see if I can fix it. |
for more information, see https://pre-commit.ci
It is working now. I also checked it in pyodide/pyodide in my fork ryanking13/pyodide@be7e588 |
@@ -213,8 +212,9 @@ def to_env(self) -> dict[str, str]: | |||
"cxxflags": "$(CXXFLAGS_BASE)", | |||
"ldflags": "$(LDFLAGS_BASE) -s SIDE_MODULE=1", | |||
# Rust-specific configuration | |||
"pyo3_cross_lib_dir": "$(CPYTHONINSTALL)/lib", | |||
"pyo3_cross_lib_dir": "$(CPYTHONINSTALL)/sysconfigdata", # FIXME: pyodide xbuildenv stores sysconfigdata here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about $(CPYTHONINSTALL)/lib/python$(PYMAJOR).$(PYMINOR)/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have that directory in our xbuildenv now. Normally sysconfigdata would be placed in that directory but we don't vendor lib/python3.X.Y/...
part in the xbuildenv and only store sysconfigdata in the top-level directory.
xbuildenv/pyodide-root$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
.
|-cpython
|---installs
|-----python-3.12.1 (this is CPYTHONINSTALL)
|-------include
|---------python3.12
|-----------cpython
|-----------internal
|-------sysconfigdata
|---------__pycache__
Maybe we can change the path in the xbuildenv, but for now the sysconfigdata directory works like a directory where first-party libraries are stored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks for the review! |
Instead of hardcoding the Python version, use
PYO3_CROSS_PYTHON_VERSION
env variable, which PyO3 uses to find the correct Python include/lib paths.Also removed pyo3_config.ini file. Otherwise, the config file always take precedence.