Open mitsuhiko opened 7 months ago
Here's a script that does some of the patching - at least sysconfigdata, at least for linux (and macos?), and it passes the uwsgi test. It's a python script with no dependencies, so it could be included by rye. This is just a quick way to do it, I don't think there is a way to do it perfectly, or rather, some use cases for these saved variables can only be relevant if the same build environment is still installed on the present computer, which it obviously is not.
https://github.com/bluss/sysconfigpatcher
I am a bit mystified how the CC variable is supposed to be used and what a good value is to patch it with. In rye's pythons it is set to clang -pthread
.
We're running into this issue with our Rust-Python interoperability course, which uses rye
to setup Python reliably on students' machines.
sysconfigpatcher
has been very useful to troubleshoot and patch students' machines, but it wasn't enough on its own.
Is this why my PyO3 tests fail if I use a Rye environment?
Is this why my PyO3 tests fail if I use a Rye environment?
Most likely, yes.
Today
sysconfig
and all the files inlib/pkgconfig
have incorrect paths. These paths should be fixed up when the interpreter is installed or maybe later at runtime when possible.lib/pkgconfig/python-3.12.pc
etc.lib/pkgconfig/python-3.12-embed.pc
etc.lib/python3.12/_sysconfigdata__darwin_darwin.py
etc.lib/python3.12/config-3.12-darwin/Makefile
etc.This way c extensions would build correctly. Basically
/install
would have to turn intosys.base_prefix
.A good test case after will be if
rye add uwsgi && rye sync
works.