-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
gh-121103: Put free-threaded libraries in lib/python3.14t
#121293
Conversation
On POSIX systems, excluding macOS framework installs, the lib directory for the free-threaded build now includes a "t" suffix to avoid conflicts with a co-located default build installation.
|
This also fixes the test_sysconfig failure on Windows.
Does this mean that all of the pure Python standard library files would need to be installed in lib/python3.14t |
As far as I can tell, from a quick look at this PR: yes. |
I thought so. The real question is: Is this the outcome we anticipated? If not, I suggest keeping the stdlib and platstdlib values intact. |
Yes, that was the intention. The goal is to separate the installation. We run into a lot of potential problems if we have partially overlapping stdlib files. |
FTR, I totally agree with this. |
To expand on my previous comment: if we have kept a common stdlib and platstdlib, the Python files would be shared, but the |
I plan to merge this tomorrow if there are no objections |
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.
Other than the nit comment, +1. This looks like it does what it promises. We still have a bit more to do before a free-threaded build can be installed to the same prefix as a non-free-threaded build without conflicts, primarily due to duplicate symlinked names in the bin
and lib/pkgconfig
directories. But this isn't really a new problem as there are similar conflicts when sharing with a debug build prior to this PR. I'd say let's merge this PR now and we can follow up in another PR for which I want to do some more investigation.
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…thonGH-121293) On POSIX systems, excluding macOS framework installs, the lib directory for the free-threaded build now includes a "t" suffix to avoid conflicts with a co-located default build installation. (cherry picked from commit e8c91d9) Co-authored-by: Sam Gross <colesbury@gmail.com>
GH-121631 is a backport of this pull request to the 3.13 branch. |
…thon#121293) On POSIX systems, excluding macOS framework installs, the lib directory for the free-threaded build now includes a "t" suffix to avoid conflicts with a co-located default build installation.
if hasattr(sys, 'abiflags') and 't' in sys.abiflags: | ||
abi_thread = 't' | ||
else: | ||
abi_thread = '' | ||
if os.sep == '/': | ||
libdirs = [sys.platlibdir] | ||
if sys.platlibdir != "lib": | ||
libdirs.append("lib") | ||
|
||
for libdir in libdirs: | ||
path = os.path.join(prefix, libdir, | ||
f"{implementation}{ver[0]}.{ver[1]}", | ||
f"{implementation}{ver[0]}.{ver[1]}{abi_thread}", |
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.
@colesbury -- would you be able to update the docs for the site
module to reflect these changes to how Python finds the site-packages
directory?
(The context is I'm currently working on reimplementing Python's logic here for Astral's work-in-progress type checker. I was reading through the site.py
source code, and it surprised me to find logic here that wasn't documented!)
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 for the pointer. I put up a PR to update the docs: #122737
On POSIX systems, excluding macOS framework installs, the lib directory for the free-threaded build now includes a "t" suffix to avoid conflicts with a co-located default build installation.
lib/python3.14t
(configure) #121103