Skip to content
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

Improvements for popen process launch in Windows #6532

Merged
merged 2 commits into from Jan 13, 2021

Conversation

headius
Copy link
Member

@headius headius commented Jan 13, 2021

The primary fix here is to do the same argument processing and executable searching for popen that we do for system by aligning the relevant logic. The other fix is to handle another special case JDK error when launching a process using a path that does not exist.

This will fix #6516 once finished.

When a process launch is attempted against a non-existant file,
Windows JDK will raise an IOException that includes both this
message and some information about the win32 CreateProcess call.
We check endsWidth to recognize this as a ENOENT style error.
This modifies popen logic to use the same executable searching and
shell handling that the system call uses, in order to properly
search for the target executable.

See jruby#6516
@headius headius added this to the JRuby 9.2.15.0 milestone Jan 13, 2021
@headius
Copy link
Member Author

headius commented Jan 13, 2021

This change is a bit of a shot in the dark, since our testing on Windows is a little weak. I was able to execute the early stages of @enebo's verification script, so things seem to be working, but a more complete verification is warranted.

@headius
Copy link
Member Author

headius commented Jan 13, 2021

This has been verified by me testing basic gem installs and @enebo running his pre-release Windows verification scripts that build and run a Rails app. We'll go with it.

@headius headius merged commit cdc3c8c into jruby:jruby-9.2 Jan 13, 2021
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.

When extension is omitted, IO.popen does not find the executable in JRuby on Windows
1 participant