Repository navigation
Preserve interpreter-boundary diagnostics and syslog restrictions - #9365
Conversation
Keep the callable representation as WTF-8 for unraisable hooks and audit callbacks. Preserve the existing String entry point and stderr fallback; this does not claim lossless stderr rendering. Assisted-by: OpenAI Codex:model unavailable
Use the existing From<&str> implementation to copy the message prefix without changing Unicode semantics. Assisted-by: OpenAI Codex:model unavailable
|
Caution Review failedThe pull request is closed. 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 |
Wrap failures from existing code/function serialization helpers as NotShareableError, matching the CPython 3.15 marshal boundary while retaining the original exception cause. No new test C API or lifecycle behavior. Assisted-by: OpenAI Codex:model-unavailable
Reject subinterpreter openlog/closelog before audit or host mutation, and reject implicit syslog opening after audit when the process logger is not already open, matching CPython 3.15 guard placement and error text. Already-open logging and setlogmask remain unchanged. Migrate concurrent/interpreters/_queues.py through scripts/update_lib to CPython d220409a13b77de7a6c30abe16ea90db01528edc, removing unused eager pickle import and exception targets. Native serialization imports pickle on demand; module import timing and debug locals may nevertheless differ. No new fixtures or interpreter lifecycle mechanisms are introduced. Assisted-by: OpenAI Codex:model version unavailable
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/profiling dependencies:
dependent tests: (3 tests)
[x] lib: cpython/Lib/concurrent dependencies:
dependent tests: (17 tests)
Legend:
|
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. |
Adopt landed RustPython#9365 Wtf8Buf thread diagnostics and current main wasm dependency updates without rewriting the published integration stack. Preserve removed Python-source Rust oracle tests and existing runtime fixtures. The final composition with the following tooling/export cleanup was validated by VM default/threading checks and strict Clippy. Rust sources here are identical to that final tested tree; this intermediate complete tree was not separately built. No interpreter or lifecycle runtime was executed. Assisted-by: OpenAI Codex:model version unavailable
Summary
Preserve exception diagnostics across two existing production VM boundaries:
_threadunraisable-hook messages from the callable's WTF-8 representation instead of replacing lone surrogates through RustDisplay.NotShareableError, preserving the original exception as__cause__and CPython's serialization/deserialization message.The existing
Option<String>unraisable entry point remains unchanged. Hook/audit dispatch, failure handling and finalization behavior are preserved. This does not change the lossy stderr fallback or other generator/deallocator message producers.The marshal change is limited to two existing private helpers. Successful operations and existing callers are unchanged. No new cross-interpreter mode, test C API, subinterpreter lifecycle, GC ownership, native-monitoring API or fixture registration is included.
CPython 3.15 sources: thread producer, Unicode formatting, marshal error boundaries, code/function callers.
Validation
All four gates passed on exact composed head
3df6951343b5; normal commit hooks also passed.Four compile-only gates cover VM-library
cargo checkand strictcargo clippy -- -D warnings, using--no-default-features --features compiler,host_env,stdio,gc,docwith and withoutthreading. All use locked/offline dependencies and Rust 1.99.0. These are selected feature sets, not Cargo default features or full-workspace validation.No runtime tests were run. The existing
test_thread.ThreadRunningTests.test_unraisable_exceptionstarts a thread and covers an ordinary representation, not the surrogate boundary. Canonical XI tests require native fixtures or interpreter lifecycle work outside this patch. No test markers or fixtures are changed; full workspace and C API tests remain unrun.RustPython's existing marshal path calls the Python module rather than CPython's direct C implementation; this pre-existing difference remains. This patch is not a claim of full serialization parity.
AI assistance: OpenAI Codex (model identifier unavailable), also disclosed in the commit trailers.
Queue and syslog interpreter-boundary follow-up
Match the CPython 3.15 syslog guards: reject subinterpreter
openlog()andcloselog()before auditing or host mutation, and reject implicitsyslog()opening after its audit event when the logger has not already been opened by the main interpreter. Already-open logging andsetlogmask()are unchanged. This does not redesign global logger locking or interpreter lifecycle.Migrate
Lib/concurrent/interpreters/_queues.pythroughscripts/update_libto that exact CPython commit, removing the unused eagerpickleimport and exception targets. Native serialization importspickleon demand. Public import timing, incidental module attributes, and debug exception locals can nevertheless differ; this is not claimed to be unobservable.The follow-up source tree was recovered exactly and validated anew in a fresh workspace using official Rust 1.99.0 and normal repository hooks. Four sequential, bounded, locked/offline compile-only gates cover default CLI
cargo check, frozen-stdlib CLIcargo check,cargo check -p rustpython-stdlib --lib, and strictcargo clippy -p rustpython-stdlib --lib -- -D warnings. Linux default stdlib features compile the Unix syslog guards. Full source, toolchain, and extracted dependency-source hashes/membership were checked before and after each gate. System Python/native OS libraries remain an explicitly trusted managed-environment boundary, not a fully hermetic build claim.No Python module imports, syslog calls, queue/thread/interpreter-lifecycle, or serialization runtime tests were run for this follow-up. No fixtures or test selections were changed. Full workspace and C-API runtime suites remain unrun. Earlier VM-feature receipts above describe their original head, not a rerun on this follow-up tree.
Exact follow-up head:
5fb5e68cdc31868e1c43c6787dc27ba334410221(tree7d406e46c4cc9c7592e3aa5eeccdaf59f3f2ba47). All four fresh compile-only gates and normal commit hooks passed. Prior public head3df69513had all 25 hosted CI checks succeed in run40191688907; that result does not validate this follow-up head. New-head hosted CI remains pending after publication.