Repository navigation
Align startup paths and sysconfig/venv with Python 3.15 - #9174
Conversation
Assisted-by: OpenAI Codex:model version unavailable
Assisted-by: OpenAI Codex:model version unavailable
Assisted-by: OpenAI Codex:model version unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters: 14
📒 Files selected for processing: 13
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: :4: SyntaxWarning: invalid decimal literal dependencies:
dependent tests: (1 tests)
[ ] lib: cpython/Lib/sysconfig dependencies:
dependent tests: (58 tests)
[x] lib: cpython/Lib/zipimport.py dependencies:
dependent tests: (9 tests)
[ ] lib: cpython/Lib/trace.py dependencies:
dependent tests: (1 tests)
Legend:
|
Align zipimport and its tests with CPython 3.15.0 via update_lib, preserving inherited test guards. Keep build-time fallback paths after configured paths and the default ZIP, while respecting customized embedding paths. Assisted-by: OpenAI Codex:model version unavailable
Both canonical coverage-file tests execute successfully after preserving startup search order. Preserve the other two inherited guards and restore canonical Python 3.15 JIT optimizer decorators. Assisted-by: OpenAI Codex:model version unavailable
Merging this PR will degrade performance by 13.34%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | rustpython[frozenset.py] |
361 µs | 416.6 µs | -13.34% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing youknowdot:fix/startup-paths-sysconfig-315 (66e80ef) with main (fc9f4a9)
Footnotes
-
4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Import the pinned CPython 3.15 PythonSymlink class through a narrow, hash-pinned update_lib mode. Preserve canonical home/VPATH behavior and explicitly supply RustPython build stdlib to the Windows child without changing runtime PYTHONHOME semantics or skipping tests. Assisted-by: OpenAI Codex:model version unavailable
Reinitialize every live thread handle completion mutex and condition variable before skipping the surviving or not-yet-started handle. Preserve their completion payload and state, and retain the existing dead-thread cleanup. Assisted-by: OpenAI Codex:model version unavailable
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edb05403b5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let search_dir = if venv_prefix.is_some() | ||
| && home_dir.is_none() | ||
| && explicit_home.is_none() | ||
| && paths.base_executable.is_empty() |
There was a problem hiding this comment.
Resolve no-home venvs from the base executable
When PYTHONEXECUTABLE or __PYVENV_LAUNCHER__ points at a venv whose readable pyvenv.cfg has no home key, the override has already made paths.base_executable nonempty, so this guard skips the target-installation search and calculates base_prefix from the venv's bin/Scripts directory (typically falling back to /usr/local on Unix) instead of the actual executable's installation. This gives the newly supported no-home/launcher case incorrect base prefixes and stdlib search paths; use the parent of paths.base_executable as the landmark search directory rather than disabling this branch.
Useful? React with 👍 / 👎.
| ('_base_executable', sys._base_executable), | ||
| # Usually compare to sys.prefix, but if we're running in our own | ||
| # venv then we really need to compare to our base prefix | ||
| ('base_prefix', sys.base_prefix), |
There was a problem hiding this comment.
Preserve the venv base-executable assertion
When test_sysconfig launches the newly created venv, replacing the _base_executable case with this base_prefix case removes the general regression check for the base-interpreter path even though this patch substantially changes calculate_base_executable(). Keep the former assertion and add the prefix assertion separately so an incorrect launcher/base executable cannot pass this suite; replacing or deleting test assertions is also explicitly prohibited by the repository test policy.
AGENTS.md reference: AGENTS.md:L277-L278
Useful? React with 👍 / 👎.
Align startup paths and the CPython 3.15 sysconfig/venv closure
Split from #8954.
This remains a draft. Head edb0540 repairs a copied completion-lock invariant exposed by the macOS fork failure; fresh Linux release test_threading and native/lint gates pass, and hosted CI is now terminal success with all 25 jobs passing. Previous head bc27c61 fixed the Windows symlink-helper failures and passed Windows/Linux Python CI, with 24 passing jobs and one macOS thread/fork failure. The earlier CodSpeed performance-analysis result remains unresolved; a passing benchmark workflow alone does not resolve it.
Changes
This branch is based directly on main and excludes the separate lazy-import integration.
Symlink-helper repair at bc27c61
Fork completion-lock repair at edb0540
-D warnings) pass.Previous repair validation
Source checkpoint 66e80ef. The sealed release binary was built from 5be5a82; the only subsequent source change is the updater-generated test_trace guard retirement. All native inputs are identical.
Offline release build and normal hooks pass.
Twelve CPython-first startup observations: all 108 explicit semantic checks match; six cases match fully after fixture/binary normalization and six retain documented installation/build-layout differences.
Both exact package/subpackage-in-ZIP startup tests pass.
Canonical test_zipimport: 81 pass, 52 skip. Optional zstd/C-API, resource and inherited sparse-file guards remain; the skipped traceback test is not claimed as a pass.
Full test_trace with CPU coverage enabled: 25 pass and two inherited expected failures; no skips. Both retired coverage tests execute successfully.
Workspace native: 1,371 pass, including both new structural path-order tests.
C-API native: 123 pass and four existing ignored.
Strict workspace and C-API Clippy pass.
Final-binary test_sysconfig: 28 pass, 7 skip and 6 inherited expected failures.
Final-binary test_venv: 26 pass, 9 skip and 4 inherited expected failures, with the same three explicit local exclusions.
test__osx_support: 16 Linux skips.
Workspace docs: 24 pass and 18 existing ignored; C-API docs complete with zero tests.
Compiler-only nonthreading check passes.
Source/artifact hashes reconcile after every gate; generated bytecode is preserved separately. Final path/ZIP repeats and all later runtime launches pin the absence of the default ZIP inputs.
Previous hosted repair results
At head 66e80ef, all checks are terminal: 27 successful, two failed and one skipped.
Remaining platform and hosted limitations
AI assistance
OpenAI Codex assisted with extraction, implementation, canonical-library migration, validation and this description. Model version was unavailable. Independent source/input reviews and the explicit Linux checks above were performed; platform and environment gaps remain disclosed.