Skip to content

Use CRuby logic for exec - #9627

Merged
headius merged 3 commits into
jruby:masterfrom
headius:exec_use_popen_logic
Sep 2, 2026
Merged

headius merged 3 commits into
jruby:masterfrom
headius:exec_use_popen_logic

Conversation

@headius

@headius headius commented Sep 1, 2026

Copy link
Copy Markdown
Member

This wires up the CRuby process logic to exec, fixing a number of issues and cleaning up some old code.

This is a follow-up to #9626 which fixed the handling of nil-or-boolean flags to popen and spawn but since exec did not use that logic it did not fix the reported issue in #9609.

Fixes #9609

@headius headius added this to the JRuby 10.1.2.0 milestone Sep 1, 2026
@headius
headius force-pushed the exec_use_popen_logic branch 2 times, most recently from 7c5c2ad to 73eed45 Compare September 1, 2026 23:13
@headius
headius force-pushed the exec_use_popen_logic branch from 73eed45 to e05d38f Compare September 2, 2026 06:25
The logic ported from CRuby for spawn and popen is also used for
exec, but we never hooked that up. This fills in the last pieces
and connects up that logic to Process.exec.

Fixes jruby#9609
@headius
headius force-pushed the exec_use_popen_logic branch from e05d38f to 697fff5 Compare September 2, 2026 07:00
Follow-up work for jruby#9609, also connecting Kernel.exec
to the updated CRuby process logic. This includes a large
refactoring that moves the old logic into Helpers and deprecates
the old entry points for that logic. The old logic will only be
used when one of the following is true:

* Running on Windows, for which we have minimal native process
  support and no direct support in the CRuby logic
* Running with NATIVE_EXEC disabled
* Running without native POSIX support

Additional utility methods needed to support the old logic were
also refactored and moved to Helpers.
@headius
headius force-pushed the exec_use_popen_logic branch from 82b5fd9 to 258cd96 Compare September 2, 2026 07:39
@headius
headius merged commit 39aefe3 into jruby:master Sep 2, 2026
49 of 109 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No validation of unsetenv_others for Process.exec causes specs to execve() abruptly

1 participant