GeezerVison is showing github.com — Rewrite getpath.c in Python · Issue #89745 · python/cpython
Rewrite getpath.c in Python #89745Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/zooba'
closed_at = <Date 2021-12-03.00:10:47.332>
created_at = <Date 2021-10-22.23:26:55.306>
labels = ['interpreter-core', 'type-feature', '3.11']
title = 'Rewrite getpath.c in Python'
updated_at = <Date 2022-03-06.19:49:35.401>
user = 'https://github.com/zooba'
bugs.python.org fields:
activity = <Date 2022-03-06.19:49:35.401>
actor = 'christian.heimes'
assignee = 'steve.dower'
closed = True
closed_date = <Date 2021-12-03.00:10:47.332>
closer = 'steve.dower'
components = ['Interpreter Core']
creation = <Date 2021-10-22.23:26:55.306>
creator = 'steve.dower'
dependencies = []
files = []
hgrepos = []
issue_num = 45582
keywords = ['patch']
message_count = 30.0
messages = ['404841', '404843', '405348', '405640', '405641', '405653', '405658', '405731', '405742', '406183', '406184', '406384', '407113', '407322', '407326', '407561', '407562', '407565', '407587', '407604', '407609', '407616', '407720', '407846', '407852', '407881', '407960', '407994', '408226', '414622']
nosy_count = 9.0
nosy_names = ['ncoghlan', 'christian.heimes', 'benjamin.peterson', 'lukasz.langa', 'eric.snow', 'steve.dower', 'miss-islington', 'neonene', 'FFY00']
pr_nums = ['29041', '29902', '29906', '29907', '29921', '29930', '29941', '29944', '29948', '29954', '29979', '30014', '31699']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue45582'
versions = ['Python 3.11']
Linked PRs
Activityzooba commented on Oct 22, 2021 As discussed in bpo-42260, combining the two getpath implementations into a single Python implementation would make it more maintainable and modifiable (particularly where distros need to patch to support alternative layouts). zooba commented on Oct 22, 2021 The PR has more work to do, but the overall layout/changes are more or less there, so happy to discuss feedback/etc.
Obviously there are a lot of edge cases here, but they seem to be mostly tested already. And I think we're early enough in alpha to find any major issues (or absorb any necessary minor changes - seems like trailing slashes might change on some paths).
There are also some changes/hacks into the new frozen module support, so that I can freeze getpath.py without turning it into a module. I really just want to execute the bytecode - no reason for any of its contents to stick around - and this works out pretty neatly. But if the changes to frozen modules seem off then maybe we can split it into totally separate freezing support? zooba commented on Oct 29, 2021 So I think I've found my first completely unavoidable API break: PyConfig_Read(config) has to work before initialisation, but is also supposed to fill out all the fields (including the search path). But because we need at least an interpreter state, we now can't calculate everything.
The only test that seems to be affected here is test_embed.test_init_read_set(), which does a PyConfig_Read() and then inserts new paths into module_search_paths before initialising. With that one skipped, I think everything else can be handled. zooba commented on Nov 3, 2021 Last remaining test failure is one that I can't figure out on my own - the freeze test is rerunning a CPython build (on Linux) and is apparently building getpath.c with the ".c.o" rule rather than the "Modules/getpath.o" rule.
Any tips as to what I should be looking at to figure this one out? ericsnowcurrently commented on Nov 3, 2021 On Wed, Nov 3, 2021 at 1:21 PM Steve Dower <[email protected]> wrote:
Last remaining test failure is one that I can't figure out on my own - the freeze test is rerunning a CPython build (on Linux) and is apparently building getpath.c with the ".c.o" rule rather than the "Modules/getpath.o" rule.
Any tips as to what I should be looking at to figure this one out?
That test does an out-of-tree build. Might that be related? zooba commented on Nov 3, 2021 I'm betting the out-of-tree (actually just deeper within the same tree) bit is related, but I just can't see how. Modules/getbuildinfo.c takes extra parameters and they seem to be being used, so I can't tell why getpath.c's are not (those rules are listed right next to each other, but well above the .c.o rule). zooba commented on Nov 4, 2021 Unsurprisingly, it was a bad edit that I made to the Makefile myself. The commit that undoes it is aedebcc but since I made the initial change as part of this PR, it was never merged in.
Now to find out why the old getpath could somehow locate the stdlib but new getpath cannot... (I'm guessing it is finding the "original" stdlib rather than the fresh clone, since AFAICT there's no reference at all to the original source dir) tiran commented on Dec 6, 2021 zooba commented on Dec 7, 2021 ambv commented on Dec 7, 2021 zooba commented on Dec 8, 2021 New changeset b0b3086 by Steve Dower in branch 'main':
bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directories (GH-29979)
b0b3086 zooba commented on Dec 10, 2021 tiran commented on Mar 6, 2022 added a commit that references this issue on Jun 17, 2022gh-89745: Avoid exact match when comparing program_name in test_embed… added 2 commits that reference this issue on Jun 17, 2022pythongh-89745: Avoid exact match when comparing program_name in test… gh-89745: Avoid exact match when comparing program_name in test_embed…
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|