-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Prototype support for PEP 739 #13945
base: master
Are you sure you want to change the base?
Conversation
ea9aed7
to
697e20c
Compare
Rebased on |
64f9781
to
e9deda3
Compare
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.
This is starting to look quite nice! \o/ How close are we to getting the PEP approved and deployed (e.g. in a cpython alpha)?
Thanks! I have requested a review for the PEP, so hopefully we should hear something soon. If it gets accepted, I'll add the file to CPython as soon as possible, so it should be available on the following release. I'll also publish a package to generate the build config file to PyPI, so that we can use it on older Python versions, or Python implementations that do not ship it, as long as you are able to run code on the target. Afterwards, in a followup to PEP 739, I also want to standardize a file for the installation environment, which will provide the installation paths. We'll ship a file for the default environment, and unless we run into some issue, I'll also get |
43fcae5
to
f30406d
Compare
The PEP has been accepted. https://peps.python.org/pep-0739/ I'll add support for it in Python 3.14, and then come back to this PR. |
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.
Fantastic news! Looking forward to local testing as soon as the backportable version exists. Some more quick comments.
mesonbuild/dependencies/pkgconfig.py
Outdated
extra_paths: T.List[str] = self.env.coredata.optstore.get_value(key)[:] | ||
extra_paths: T.List[str] = self.env.coredata.optstore.get_value(key)[:] + self.extra_paths |
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.
Hmm, I see what you're doing here. You allow a PkgConfigDependency to take an additional PKG_CONFIG_PATH which is joined to the one in the cross file, which also means we don't need to push/pop os.environ.
On the flip side, the way we previously used it was via PKG_CONFIG_LIBDIR which was more narrowly scoped. I suspect this change means we can accidentally fall back to a different python than the one we were searching for (but still the same major.minor version at least)...
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.
Ah hold on, we anyways fall back to checking for pkg-config without the internal LIBPC which means this is actually doing exactly what we want with one less check. Heh. :)
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.
Yeah, and without modifying os.environ
😊
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
bc6ef41
to
b5e8baa
Compare
…figDependency Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
The overall goal is to support targeting Python installations without need for introspection, given all necessary information is given externally.
This is built upon:
_sysconfigdata
to a JSON file python/cpython#127178, forpy_installation.get_variable
/py_installation.has_variable
supportThis PR is just a prototype, as I work to get all necessary pieces finalized.