Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake-compiler 1.2.4 broken on Ruby 2.5 and below #224

Closed
ivoanjo opened this issue Aug 1, 2023 · 5 comments 路 Fixed by #226
Closed

rake-compiler 1.2.4 broken on Ruby 2.5 and below #224

ivoanjo opened this issue Aug 1, 2023 · 5 comments 路 Fixed by #226

Comments

@ivoanjo
Copy link

ivoanjo commented Aug 1, 2023

Hello there 馃憢!

I work at @DataDog on the ddtrace gem. We use the rake-compiler gem to build our native extension, and it's extremely useful, thanks for your work on it! 馃檹

Yesterday our CI started failing after it picked up rake-compiler 1.2.4 on Ruby 2.5 and below:

mkdir -p tmp/x86_64-linux/stage/lib
rake aborted!
NoMethodError: undefined method `cleanpath' for #<String:0x000055c199dee558>
/usr/local/bundle/ruby/2.3.0/gems/rake-compiler-1.2.4/lib/rake/extensiontask.rb:166:in `block in define_compile_tasks'
/usr/local/bundle/ruby/2.3.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'

We've had to pin an older version of rake-compiler to work around this.

The issue seems to be that #relative_path_from in those Rubies doesn't work with strings:

relative_lib_path = Pathname(lib_path).relative_path_from(tmp_path)

...I believe the fix would be to change it to:

relative_lib_path = Pathname(lib_path).relative_path_from(Pathname(tmp_path))

I can submit a PR if that helps!

@kou
Copy link
Member

kou commented Aug 1, 2023

Oh, could you open a PR for this?

@ivoanjo
Copy link
Author

ivoanjo commented Aug 2, 2023

Sounds good, I should have a PR for this within the next days! (Travelling a bit right now!)

mattbrictson added a commit to mattbrictson/concurrent-ruby that referenced this issue Aug 2, 2023
The recently released rake-compiler 1.2.4 breaks compatibility with Ruby
2.5 and below. It is causing concurrent-ruby CI jobs to fail with errors
like this:

```
NoMethodError: undefined method `cleanpath' for "tmp/x86_64-linux/concurrent_ruby_ext/2.3.8":String
```

The rake-compiler regression has been reported here:

rake-compiler/rake-compiler#224

As a workaround, this PR updates the ruby-concurrent Gemfile to avoid
rake-compiler 1.2.4. This should fix the broken CI jobs.
eregon pushed a commit to ruby-concurrency/concurrent-ruby that referenced this issue Aug 2, 2023
The recently released rake-compiler 1.2.4 breaks compatibility with Ruby
2.5 and below. It is causing concurrent-ruby CI jobs to fail with errors
like this:

```
NoMethodError: undefined method `cleanpath' for "tmp/x86_64-linux/concurrent_ruby_ext/2.3.8":String
```

The rake-compiler regression has been reported here:

rake-compiler/rake-compiler#224

As a workaround, this PR updates the ruby-concurrent Gemfile to avoid
rake-compiler 1.2.4. This should fix the broken CI jobs.
flavorjones added a commit to flavorjones/rake-compiler that referenced this issue Aug 2, 2023
Pathname#relative_path_from supports string arguments
only in Ruby 2.6+ (see ruby/ruby@dde0e30c)

Fixes rake-compiler#224
@flavorjones
Copy link
Contributor

I submitted PR #226

flavorjones added a commit to ruby/racc that referenced this issue Aug 2, 2023
flavorjones added a commit to ruby/racc that referenced this issue Aug 2, 2023
@kou kou closed this as completed in #226 Aug 2, 2023
kou pushed a commit that referenced this issue Aug 2, 2023
GitHub: fix GH-224

Pathname#relative_path_from supports string arguments only in Ruby 2.6+
(see ruby/ruby@dde0e30c)

Reported by Ivo Anjo. Thanks!!!
@kou
Copy link
Member

kou commented Aug 2, 2023

Could you try 1.2.5?

@ivoanjo
Copy link
Author

ivoanjo commented Aug 3, 2023

Yeap, can confirm it works now, thanks for the speedy fix :)

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 a pull request may close this issue.

3 participants