| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Signed-off-by: Filipe Laíns <lains@riseup.net>
|
(I've added the checklist to the PR description.) This is an accepted PEP, so needs SC approval:
https://peps.python.org/pep-0001/#pep-maintenance Please can you ask the SC about this change? |
Sorry, something went wrong.
|
@pfmoore, per python/steering-council#341 and python/steering-council#343, could you make a decision on this? Since the 3.15 feature freeze is just around the corner, I really don't want to have to wait for the Packaging Council to be up to speed. |
Sorry, something went wrong.
|
There's one edge case that I'd like to clarify before accepting. Suppose that a distribution has two Python builds that both get installed into the same prefix, but only one is actually installed by the user. From a strict reading, that one installation would need to be named build-details.json, and only if/when a second build got installed, would the new text apply. This would be problematic, because it would require renaming of the original build-details.json. It's arguable that the "UNLESS unfeasible due to technical limitations" exclusion applies here, and the potential to install two builds is considered enough of a technical limitation. But if it's too easy to justify using a different name, that dilutes the benefit of having an easily discoverable standard name for common cases, so allowing that could be a bad idea. Could you update the wording to clarify the intent in this case, please? |
Sorry, something went wrong.
Could you explain the meaning here? Does this mean: installed manually with tools such as make install from a CPython checkout, as opposed to installed by the user using system-level package manager? (In this case, for operating systems like Debian, the case in question is not possible: the package manager owns /usr, and the user can use /usr/local or /opt for manual local installs) |
Sorry, something went wrong.
|
What I mean is, suppose Debian has python314 and python314-ft builds. Both use the same sys.prefix (presumably /usr? Sorry, I don't know how Linux distros do their filesystem layouts). The user does apt install python314, so they only have one Python installed. A strict reading of the PEP implies that the file should be called build-details.json. Which presumably means that's what the file is called in the .deb archive. But the exact same logic applies to python314-ft, and you can't have two packages both "owning" the same file (I assume). The likely answer is that "technical reasons" apply here, so the files should be something like build-details-314.json and build-details-314ft.json. But if we do that, then we lose a lot of the discoverability that having a standard name gives - and as a result, I think that this scenario should be explicitly discussed. |
Sorry, something went wrong.
|
The free-threading case is one case (and still in Debian's future), but practically right now the there are two other clashes: debug builds and multiarch. Fundamentally the issue is that Debian installs multiple different builds of the same Python version, to the same tree. They can share .py files. C extensions are differentiated through ABI flags. For multiarch:
Fundamentally, you can't have two files with the same name with different contents. If each build needs its own file (and they do, because the file documents details of the Python interpreter like architecture and ABI flags), then they have to be named differently. We are currently working around this by calling our build-details files /usr/lib/python3.14/build-details_$(MULTIARCH).json. Based on the current state of this PR (and running the problem with debug builds), I'll rename them to /usr/lib/python3.14/build-details.$(ABIFLAGS).$(MULTIARCH).json. A little ugly to have .. in the default name, but it keeps the patch simple. |
Sorry, something went wrong.
That should and will pretty clearly apply to packages for any distro. Moving files from one package around based on the user installing another package is a big no-no (file listings are static and used in UIs, similar to RECORD files in wheels), and not how anyone is going to consider implementing this. Simple proposed textual fix to address the comment: change "share" to "may share" in _"When multiple Python installations share the same prefix". @FFY00 any reason not to make that small tweak to address @pfmoore's edge case concern?
I think any packager will only deviate from the SHOULD when necessary, as in Debian's case.
Dots vs. underscores is a minor stylistic choice I'd think, but either way it'd be nice to recommend something (the examples kinda are a recommendation). You're assuming a scheme here that's build-details[.{abiflags}.{multiarch}].json rather than build-details[.{abiflags}][.{multiarch}].json (note the ][ in the middle, you're getting .. because of always filling in abiflags). Also, your name will then end up as build-details.t.x86_64-linux-gnu.json for free-threading; using a plain .t is quite hard to read and imho quite a bit worse than using .free-threading is in the example in this PR. This matter much more here than for _sysconfigdata, because this build-details file is much more user-facing. In the end Debian is going to be the main user of this exception, so it'd be great to align the examples added to the PEP so they align with Debian's actual implementation and are readable. @stefanor would something like build-details[.{multiarch}][-free-threading][-debug].json work perhaps? |
Sorry, something went wrong.
Absolutely. That would be nice and readable. I think that naming scheme should be defined in the spec, and (ideally) created by the generation script, itself. I don't want to have to invent my own scheme of mapping abi flags to readable strings, downstream. I'd much rather we define it here. |
Sorry, something went wrong.
Ah, nice idea, I like it. Since it's opt-in anyway, I can't think of a downside of having some kind of toggle (env var perhaps, since plumbing this in through ./configure sounds like a pain?) inside the code that generates this json file. Doesn't feel like that should hold up merging this PR, but it's an opportunity for some Debian-CPython synergy - I believe we can use a bit of that:) |
Sorry, something went wrong.
Sorry for the delay getting back to you! As Ralf mentioned, in most distribution systems, packages are static, so we can't move files based on whether another package is installed or not. As such, if the user only has one os the Python distribution packages installed, it would have a single build-details.XXX.json file. I think that's fine, and it works with the PEP semantics — build-details.XXX.json map to Python installations, not the other way round. Do think the PEP text needs more clarification regarding this?
We can define something, but I would prefer not to for the following reasons:
Yeah, I was planning to add a ./configure option to specify the build-details.XXX.json identifier string. I agree, it shouldn't block this PR. |
Sorry, something went wrong.
I'm busy implementing something like that right now. I'll file it and tag you for review. |
Sorry, something went wrong.
Signed-off-by: Filipe Laíns <lains@riseup.net>
Applied this suggestion. Thanks Ralf! |
Sorry, something went wrong.
Documentation build overview749 files changed · ± 744 modified · - 5 deleted ± Modified
- Deleted |
Sorry, something went wrong.
Linux distributions that co-install multiple Python versions in the same path (e.g. multiarch on Debian, debug builds, and free-threading) need a way to place multiple build-details.jsons side-by-side. PEP-739 is being updated [0] to recommend renaming in this situation. To ensure some standardization, this PR generates appropriate names for distributions that need to use this feature. [0]: python/peps#4889
Linux distributions that co-install multiple Python versions in the same path (e.g. multiarch on Debian, debug builds, and free-threading) need a way to place multiple build-details.jsons side-by-side. PEP-739 is being updated [0] to recommend renaming in this situation. To ensure some standardization, this PR generates appropriate names for distributions that need to use this feature. [0]: python/peps#4889
* Configurable build-details.json name Linux distributions that co-install multiple Python versions in the same path (e.g. multiarch on Debian, debug builds, and free-threading) need a way to place multiple build-details.jsons side-by-side. PEP-739 is being updated [0] to recommend renaming in this situation. To ensure some standardization, this PR generates appropriate names for distributions that need to use this feature. [0]: python/peps#4889 * NEWS entry * Document configure option and add to whatsnew
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://pep-previews--4889.org.readthedocs.build/