Avoid giving Pathname#relative_path_from a String for Ruby < 2.6 compat #228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
rake-compiler started to fail on Ruby 2.5 since its version 1.2.4. Here's an actual failure that I saw on haml project, https://github.com/haml/haml/actions/runs/5740494510/job/15558470282#step:5:26
which fails with
NoMethodError: undefined method `cleanpath' for "tmp/x86_64-linux/haml/2.5.9":String
.The error seems to be raised from this line
rake-compiler/lib/rake/extensiontask.rb
Line 166 in 77d9294
and it can be blamed to 0d93b08.
This happens because
Pathname#relative_path_from
used not to accept a String parameter until ruby/ruby#2049 (ruby/ruby@4cf8286 and ruby/ruby@78dc3da).The CI on this repo is passing on Ruby 2.5 although it's not working, because there are no test that tries to run
copy:*
task, whereas there exist some tests that test the definition or dependency to that task. I'm not sure if I'd better add such a test, but for now, let me just post a minimum patch that should fix the error.