Homebrew / homebrew-portable-ruby

🚗 Versions of Ruby that can be installed and run from anywhere on the filesystem.
BSD 2-Clause "Simplified" License
133 stars 43 forks source link

portable-ruby: copy ncurses terminfo into bottle #103

Closed Bo98 closed 4 years ago

Bo98 commented 4 years ago

This is one step towards fixing irb on Linux not being able to handle left, right or backspace keys.

Bo98 commented 4 years ago

Moving some of the discussion here from Slack:

Part two of fixing the issue involves setting TERMINFO_DIRS somewhere, and the question now is where - be it in brew or by patching Ruby. This value to set TERMINFO_DIRS to cannot be baked in at compile time - it must be evaluated at runtime, since it doesn't work well with relative paths.

MikeMcQuaid commented 4 years ago

Part two of fixing the issue involves setting TERMINFO_DIRS somewhere, and the question now is where - be it in brew or by patching Ruby. This value to set TERMINFO_DIRS to cannot be baked in at compile time - it must be evaluated at runtime, since it doesn't work well with relative paths.

The suggestion I liked the most from Slack adding /usr/share/terminfo to the search patch rather than bundling our of terminfo files. I don't feel strongly, though. I think we need to have something merged by e.g. 5pm Scotland time today so this isn't blocking the release of the next Homebrew version.

Bo98 commented 4 years ago

Just to summarise the different options here:

MikeMcQuaid commented 4 years ago
  • Can be done either globally in brew.sh

ruby.sh might make more sense?

  • Is there any concern about this affecting subprocesses?

I'd think this is fine 👍. We can also always unset at install time if needed.

  • This requires hacking the Ruby source.
  • Where exactly?

On the timescale we're on I think this is a 👎

  • Likely bulletproof, but is ultimately still a patch.

Gentle 👎 as requiring a patch.

Don't bundle terminfo and pass a configure arg to ncurses to rely on a system installation.

This is my preference.


I'd be happy with either "configure arg" or "modify Homebrew/brew" approaches. The latter may be easier to fix if we have any issues cropping up (rebuilding and revisioning portable-ruby is not fun).

Bo98 commented 4 years ago

The latter may be easier to fix if we have any issues cropping up

Yeah, I think it's best to play it safe for now.

https://github.com/Homebrew/brew/pull/7718

MikeMcQuaid commented 4 years ago

Works for me, thanks again @Bo98!