GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [WIP] Add SemLock implementation to RustPython by Copilot · Pull Request #6506 · RustPython/RustPython

Conversation

Copilot AI commented Dec 25, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Establish baseline by running targeted existing tests to observe current failures
  • Implement _multiprocessing.SemLock and sem_unlink functionality (Unix-focused, preserving Windows behavior)
  • Add or adapt focused tests to cover basic SemLock creation and acquire/release
  • Run targeted tests for _multiprocessing/multiprocessing synchronization and verify behavior
  • Final review, code cleanup, and security checks
Original prompt

This section details on the original issue you should resolve

<issue_title>_multiprocessing_SemLock</issue_title>
<issue_description>This is missing in RustPython.</issue_description>

<agent_instructions>Checkout SemLock in CPython and implement one for RustPython</agent_instructions>

Comments on the Issue (you are @copilot in this section)

  • Fixes _multiprocessing_SemLock #3965

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI assigned Copilot and youknowone Dec 25, 2025
@coderabbitai

coderabbitai Bot commented Dec 25, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of youknowone December 25, 2025 01:56
View session
Copilot AI requested a review from youknowone December 25, 2025 02:14
Copilot stopped work on behalf of youknowone due to an error December 25, 2025 02:14
Sorry, you've hit a rate limit that restricts the number of Copilot model requests you can make within a specific time period. Please try again in 46 minutes. Please review our Terms of Service (https://docs.github.com/site-policy/github-terms/github-terms-of-service). If the problem persists, please contact GitHub Support, including the request ID `9C03:3AF42C:1FECABE:29719CF:694C9DD1`. To retry, leave a comment on this pull request asking Copilot to try again.
@youknowone

youknowone commented Dec 25, 2025

Copy link
Copy Markdown
Member

@copilot try again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of youknowone December 25, 2025 03:43
View session

Copilot AI commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

@copilot try again

Implemented Unix _multiprocessing.SemLock (with constants and sem_unlink) and ran rustpython-stdlib tests in ec25df2.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of youknowone December 25, 2025 03:59
@youknowone

youknowone commented Dec 25, 2025

Copy link
Copy Markdown
Member

@copilot fix CI failure

error[E0425]: cannot find function `sem_getvalue` in crate `libc`
   --> crates/stdlib/src/multiprocessing.rs:308:38
    |
308 |             let res = unsafe { libc::sem_getvalue(self.handle.as_ptr(), &mut value) };
    |                                      ^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `sem_timedwait` in crate `libc`
    --> crates/stdlib/src/multiprocessing.rs:387:42
     |
 387 |                 let res = unsafe { libc::sem_timedwait(self.handle.as_ptr(), &ts) };
     |                                          ^^^^^^^^^^^^^ help: a function with a similar name exists: `sem_trywait`
     |
    ::: /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.178/src/unix/mod.rs:1550:5
     |
1550 |     pub fn sem_trywait(sem: *mut sem_t) -> c_int;
     |     --------------------------------------------- similarly named function `sem_trywait` defined here
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of youknowone December 25, 2025 04:18
View session

Copilot AI commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

@copilot fix CI failure

...

Added explicit extern bindings for sem_getvalue/sem_timedwait so CI builds succeed across libc targets; rustpython-stdlib tests now pass (aa11f3e).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of youknowone December 25, 2025 04:26
@youknowone

youknowone commented Dec 25, 2025

Copy link
Copy Markdown
Member

@copilot Something wrong. Carefully review the CI result and fix the problem.

e.g.

Run target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed -v test__colorize test_array test_asyncgen test_binop test_bisect test_bool test_bytes test_call test_class test_cmath test_collections test_complex test_contains test_copy test_dataclasses test_decimal test_decorators test_defaultdict test_deque test_dict test_dictcomps test_dictviews test_dis test_enumerate test_exception_variations test_float test_format test_fractions test_genericalias test_genericclass test_grammar test_range test_index test_int test_int_literal test_isinstance test_iter test_iterlen test_itertools test_json test_keyword test_keywordonlyarg test_list test_long test_longexp test_math test_operator test_ordered_dict test_pow test_raise test_richcmp test_scope test_set test_slice test_sort test_string test_string_literals test_strtod test_structseq test_subclassinit test_super test_syntax test_tuple test_types test_unary test_unpack test_weakref test_yield_from

thread 'main' (4106) panicked at crates/stdlib/src/multiprocessing.rs:343:22:
intern RECURSIVE_MUTEX
stack backtrace:
   0:     0x55b58e7f3253 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h718e2d17a1928e63
   1:     0x55b58d63ea2f - core::fmt::write::h1d2246b072ea91eb
   2:     0x55b58e7c6ea3 - std::io::Write::write_fmt::haf55272405c09d9b
   3:     0x55b58e7cf6d2 - std::sys::backtrace::BacktraceLock::print::h61c3bd81a9458a03
   4:     0x55b58e7d27ae - std::panicking::default_hook::{{closure}}::haf1ffb5d1e33a97f
   5:     0x55b58e7d22ef - std::panicking::default_hook::hc32245deb6eaa988
   6:     0x55b58e7d2b95 - std::panicking::panic_with_hook::h43adc00fd0e494cb
   7:     0x55b58e7d299a - std::panicking::panic_handler::{{closure}}::h44391079756da3e7
   8:     0x55b58e7cf819 - std::sys::backtrace::__rust_end_short_backtrace::h934e1568393e5b8f
   9:     0x55b58e7ba36d - __rustc[d9b87f19e823c0ef]::rust_begin_unwind
  10:     0x55b58d649020 - core::panicking::panic_fmt::h62031895f6e012da
  11:     0x55b58d647ebb - core::option::expect_failed::h40dde8b63ee0f843
  12:     0x55b58dfbc382 - <rustpython_stdlib::multiprocessing::_multiprocessing::SemLock as rustpython_vm::class::PyClassImpl>::impl_extend_class::h82ef0c5c139008a2
  13:     0x55b58dfbf3d4 - rustpython_vm::class::PyClassImpl::extend_class::h06a341b4833469e9
  14:     0x55b58df6e5f8 - once_cell::imp::OnceCell<T>::initialize::{{closure}}::h14eb56b716e2e7f9
  15:     0x55b58db718cc - once_cell::imp::initialize_or_wait::h34fa2e290e5e2ed3
  16:     0x55b58df6bd82 - once_cell::imp::OnceCell<T>::initialize::h11c02bfa74ceb193
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of youknowone December 25, 2025 05:35
View session

Copilot AI commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Something wrong. Carefully review the CI result and fix the problem.

e.g.
...

Switched SemLock constants to use ctx.intern_str to avoid missing intern entries (panic fixed) and reran cargo test -p rustpython-stdlib --lib -- --nocapture successfully (c91612c).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of youknowone December 25, 2025 05:43
Copilot AI and others added 5 commits December 25, 2025 18:33
@youknowone
Initial plan
34bbaf6
@youknowone
Changes before error encountered
dcd74f1
Co-authored-by: youknowone <[email protected]>
@youknowone
Implement Unix SemLock and expose sem_unlink
5a68008
Co-authored-by: youknowone <[email protected]>
@youknowone
Fix missing sem_* symbols on libc targets
4abfb6b
Co-authored-by: youknowone <[email protected]>
@youknowone
Fix SemLock constant interning to avoid panic
6c2a8fc
Co-authored-by: youknowone <[email protected]>
@youknowone
youknowone force-pushed the copilot/implement-semlock-for-rustpython branch from c91612c to a22a8fc Compare December 25, 2025 09:50
@youknowone
Fix cfg
4af41d3
@youknowone
youknowone force-pushed the copilot/implement-semlock-for-rustpython branch from a22a8fc to 4af41d3 Compare December 25, 2025 10:10
@youknowone youknowone mentioned this pull request Dec 26, 2025
impl multiprocessing SemLock #6542
Merged
@youknowone youknowone closed this in #6542 Jan 2, 2026
@fanninpm fanninpm mentioned this pull request Jan 3, 2026
Update test/libregrtest to CPython 3.13.10 #6410
Merged
2 tasks done
@youknowone
youknowone deleted the copilot/implement-semlock-for-rustpython branch March 7, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@youknowone youknowone Awaiting requested review from youknowone

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@youknowone youknowone

Copilot code review Copilot

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

_multiprocessing_SemLock

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.