rbenv / ruby-build

A tool to download, compile, and install Ruby on Unix-like systems.
https://rbenv.org/man/ruby-build.1
MIT License
3.89k stars 784 forks source link

Builds of TruffleRuby by asdf are broken #1955

Closed pinealservo closed 2 years ago

pinealservo commented 2 years ago

This is actually a ruby-build issue. It was introduced here: https://github.com/rbenv/ruby-build/pull/1784

It's not inherent to the core of ruby-build but is due to code meant to prevent ruby-build from deleting /usr/local or other sorts of FHS-compliant install locations, which TruffleRuby doesn't support: https://github.com/oracle/truffleruby/issues/1389

The problem with the existing method of detecting these installs is that it's too general and conflicts with the way asdf install works. This line is run to make the directory just before the plugin (which in this case is asdf-ruby which then calls ruby-build) gets to run. These install directories are a core part of how asdf (a set of bash scripts) tracks what's installed and what versions are available.

It seems to me that the check should explicitly be for FHS paths rather than just existing directories, or at least they should explicitly allow existing paths with .asdf as a component in the path.

Originally posted by @pinealservo in https://github.com/rbenv/ruby-build/discussions/1911#discussioncomment-2533456

eregon commented 2 years ago

Fixed in https://github.com/rbenv/ruby-build/pull/1956