-
-
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
Free-threaded libraries should be in lib/python3.14t
(configure)
#121103
Comments
That's the catch. The debug build is ABI-compatible; you do want this kind of cross-installation for the debug build. Perhaps there needs to be a new variable with just the |
Yeah, I think just the |
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.
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.
…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>
is there a reason to separate the stdlib as part of this? as far as I understand the stdlib would be byte-identical (ignoring the from this issue it seems to me that this is only an issue for with the duplicated copy this complicates distribution packaging (at least on debianlikes) where the stdlib is shipped in several packages (to separate minimal files, arch independent files, etc.). I'm inclined to undo that part of this patch to unbreak the builds and simplify things but I'm hesitant to deviate with no hope of convergence I'm also not quite sure what to do since this is a pretty significant breakage late in the beta period -- fortunately I'm noticing this due to nightly builds! |
at least for past precedence -- prior to the debug builds becoming abi-compatible this wasn't considered an issue (though the same exact problem occurred there!). I suspect (and maybe I'm wrong) that this is considered higher priority because free-threaded is shiny-new :) maybe we don't need this change at all and can instead recommend virtualenvs? I don't think mixing pythons in a virtualenv makes sense anyway |
You can have different patch versions installed side-by-side (i.e., 3.13.1 & free-threaded-3.13.3) with a common prefix - in that case the stdlib py files are not identical and will lead to confusing and difficult to debug behaviors. |
As I wrote on the PR, my concern is that sharing
Would it make sense to override the
We prioritize this because we got multiple bug reports related to this problem, and the way these failures manifest is confusing for even experienced CPython developers. The abi-incompatible debug builds did not make for a good user experience, and I don't think we want to emulate them. |
I don't think this is helpful to this discussion: installing 3.12.1 and 3.12.2 side-by-side will not work -- they will clobber each other's stdlib (the patch version isn't part of the libdir) |
The case @itamaro and I are referring to, is when you install 3.12.1 default and 3.12.2 free-threaded side by side. If you share |
yes that's precisely where the merge conflict I'm dealing with is right now (since debian also does the whole |
I understand that, but I assert that nobody would want that (or we would already encode the patch version in the libdir) -- in the same way that they wouldn't want to install two patch versions side-by-side in the same prefix independent of free-threaded edit emphasized |
I think I understand your concerns in general, but I'm unsure about the specifics. As I understand it they are:
On (1), I think there is still some work on duplicate symlinks, but I think that will be a smaller change. On (2), I think we still want to support the way Debian, deadsnakes, Fedora, etc. distribute Python, and that includes configurations that share the stdlib. For specific changes, I'm looking at https://github.com/deadsnakes/python3.13/blob/ubuntu/jammy/debian/patches/distutils-install-layout.diff. It seems like the patch needs to be refreshed because the base changed, but is otherwise fine. In particular, it looks like Debian does not depend on CPython's
It's not a matter of people deliberately wanting two different patch versions. If you are upgrading a co-located local People are definitely doing this now, including CPython core developers. At one point previously, I suggested that people should install the default and free-threaded builds in separate prefixes, but:
It would have been better if we addressed this earlier in the development cycle, but it still seems better to do this now (before beta 4), rather than leave the problem for later. |
…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.
The free-threaded Python variant places file in a lib/python3.13t directory. Take this into account in the recipe. Upstream change: python/cpython#121103
getting back around to this I'm having to also revert the patch to |
seems like this patch also breaks noarch conda packages per the linked issue ^^ |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…ythonGH-122737) (cherry picked from commit 1429651) Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…ython#122737) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…ython#122737) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
The free-threaded Python variant places file in a lib/python3.13t directory. Take this into account in the recipe. Upstream change: python/cpython#121103
Bug report
Background
When using
configure
based Python installations, if two the free-threaded and default builds are installed to the same prefix, they will share the samelib
directory. For example, when installing Python 3.14 the structure looks like:The include directories are not shared, which is good because they have different
pyconfig.h
files.However, the
lib/python3.14
is shared, which means that packages installed in the default build may be partially available in the free-threaded build and vice versa. This was unintended and can cause problems, such as confusing error messages and crashes.For example, if I run:
python3.14 -m pip install numpy
(install in default build)python3.14t -c "import numpy"
I get a confusing error message:
Error importing numpy: you should not try to import numpy from its source directory...
It would be better if installing NumPy in the default build did not make it available in the free-threaded build and vice versa.
Proposal
We should add the ABI suffix to the lib directory, like we do for the include directory. Specifically, we should use
python$(LDVERSION)
instead ofpython$(VERSION)
.For example, the free-threaded build would uselib/python3.14t
in Python 3.14.Debug builds have
d
as part of their ABI suffix (and LDVERSION), so this would incidentally affect installations of the debug configuration of the non-free-threaded build.Linked PRs
lib/python3.14t
#121293lib/python3.14t
(GH-121293) #121631The text was updated successfully, but these errors were encountered: