-
Notifications
You must be signed in to change notification settings - Fork 196
Fix GraalPy compatibility #2040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,9 +58,12 @@ def spawn(process_name, cmdline, env, redirect_output): | |
| else: | ||
| kwargs = {} | ||
|
|
||
| if sys.platform != "win32" and sys.implementation.name != 'graalpy': | ||
| # GraalPy does not support running code between fork and exec | ||
| # GraalPy does not support running code between fork and exec, but supports the | ||
| # process_group argument for Popen | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📍 src/debugpy/launcher/debuggee.py:62 |
||
| if sys.platform != "win32" and sys.implementation.name == "graalpy": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📍 src/debugpy/launcher/debuggee.py:62
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would also require adding another branch to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📍 src/debugpy/launcher/debuggee.py:60 |
||
| kwargs.update(process_group=0) | ||
|
|
||
| if sys.platform != "win32" and sys.implementation.name != 'graalpy': | ||
| def preexec_fn(): | ||
| try: | ||
| # Start the debuggee in a new process group, so that the launcher can | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📍 src/debugpy/adapter/main.py:38
This PR adds a
hasattr(os, "fork")probe but leaves the sibling syscallsos.getsid/os.setsid(a few lines up in the sameif os.name == "posix":block) gated only onos.name == "posix". A forkless-POSIX runtime that also lackssetsidwould raiseAttributeError/OSErrorhere and crash before reaching the new fork guard — defeating the PR's goal. Please confirm GraalPy exposessetsid/getsid, or guard withhasattr(os, "setsid")/ wrap intry/except (AttributeError, OSError).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, GraalPy exposes those functions