alup / puppet-rbenv

Puppet manifest for rbenv installation
MIT License
139 stars 103 forks source link

Support ruby compilation with piped patches #95

Open gsamokovarov opened 10 years ago

gsamokovarov commented 10 years ago

I just had to install an old Ruby 1.9.3-p448 on CentOS 6.4, however there is a known issue with compiling 2.0.0-p247 and lower on RedHat derivatives. See https://bugs.ruby-lang.org/issues/8384 for the issue. To do that, I needed to patch the Ruby, which I couldn't have done as easily with the current version.

If you checkout the ruby-build wiki, you can see other documented workarounds using the recently added --patch functionality of ruby-build, so I think its worth trying to support it.

While I'm not sure that this is the best interface for it, it seems flexible enough to support my (most?) use cases. I'm currently using it like this:

rbenv::compile { '1.9.3-p448':
  # Its important to strip the changelog changes from the patch, as they
  # won't apply. It's the first file, that's why we're not taking it.
  patch => 'curl -fsSL https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff?format=diff | filterdiff --files=2,3',
  user  => $user
}
Envek commented 10 years ago

Support this strongly!

We need to patch Ruby with patches from https://bugs.ruby-lang.org/issues/9830 . There are 2 patch files. Is it possible with this PR?

gsamokovarov commented 10 years ago

You can combine them with combinediff out of patchutils, so yeah.