Skip to content

Don't delete jruby.sh #2517

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged

Don't delete jruby.sh #2517

merged 1 commit into from
Apr 3, 2025

Conversation

headius
Copy link
Contributor

@headius headius commented Apr 2, 2025

I'm not sure why this file was being deleted but this code dates way back! Unfortunately deleting this interferes with a new version of the native JRuby launcher we want to release which is dependent on the shell script being present. This PR removes jruby.sh from the remove_windows_files function so it can be used by the new launcher.

See jruby/jruby-launcher#48 (comment)

I'm not sure why this file was being deleted but this code dates way back! Unfortunately deleting this interferes with a new version of the native JRuby launcher we want to release which is dependent on the shell script being present. This PR removes jruby.sh from the `remove_windows_files` function so it can be used by the new launcher.

See jruby/jruby-launcher#48 (comment)
@Earlopain
Copy link

I gave this a try with jruby-launcher 2.0.0.pr1 (see linked PR) and jruby 9.4.12.0, it seems to work ok. gem / ruby / bundle etc. commands all do what they're supposed to.

@headius
Copy link
Contributor Author

headius commented Apr 2, 2025

This should also not interfere with the installation of the "classic" native launcher, since that overwrites the jruby command and is not affected by jruby.sh

@mislav mislav merged commit bc1a47d into rbenv:master Apr 3, 2025
4 checks passed
@mislav
Copy link
Member

mislav commented Apr 3, 2025

Thank you!

@headius headius deleted the patch-1 branch April 3, 2025 15:04
@headius
Copy link
Contributor Author

headius commented Apr 3, 2025

@mislav Can you explain how this fix gets out to users? What process do they need to follow in e.g. rbenv?

We are trying to decide if we have to hack the jruby-launcher gem to bring its own jruby.sh to work around the deletion on older ruby-build.

headius added a commit to headius/jruby-launcher that referenced this pull request Apr 3, 2025
The new skinny launcher depends on jruby.sh being in the same bin
dir, but at least one installer (ruby-build) deletes it during
initial setup. This patch includes jruby.sh in the gem and copies
it into JRuby's bin dir if it does not already exist.

See rbenv/ruby-build#2517
headius added a commit to headius/jruby-launcher that referenced this pull request Apr 3, 2025
The new skinny launcher depends on jruby.sh being in the same bin
dir, but at least one installer (ruby-build) deletes it during
initial setup. This patch includes jruby.sh in the gem and copies
it into JRuby's bin dir if it does not already exist.

See rbenv/ruby-build#2517
@mislav
Copy link
Member

mislav commented Apr 9, 2025

@headius Certainly! Your fix is part of the latest ruby-build release: https://github.com/rbenv/ruby-build/releases/tag/v20250409

People will only benefit from this fix if they upgrade their ruby-build version prior to installing a new jruby version. Upgrading is done independently of rbenv: https://github.com/rbenv/ruby-build/wiki#updating-ruby-build

If jruby releases currently included in ruby-build (prior to this fix) are vulnerable to jruby.sh being missing, then I think it's worthwhile to add the hack to jruby-launcher gem that you are describing. Users of rbenv/ruby-build/asdf aren't strongly incentivized to upgrade ruby-build if their desired Ruby version is already supported through it.

@headius
Copy link
Contributor Author

headius commented Apr 9, 2025

Thank you for the clarification and for the release!

I think it's worthwhile to add the hack to jruby-launcher gem

We ended up at the same conclusion, and the just-released jruby-launcher 2.0 will copy the latest jruby.sh into bin if it is not already present. I believe it should install and work properly for all rbenv installs prior to the change in this PR.

@jasonkarns
Copy link
Member

I'm not sure why this file was being deleted but this code dates way back!

No kidding. First PR to ruby-build ever! #1

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.

4 participants