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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Libv8::Node::Paths with RubyGems >=3.3.21 on *-linux-gnu platforms #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

knu
Copy link

@knu knu commented Oct 29, 2022

RubyGems 3.3.21 changed the value format of Gem::Platform.local for Ruby configured with *-linux-gnu as the platform name.

$ ruby -ve 'p Gem::VERSION; p Gem::Platform.local.to_s'
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux-gnu]
"3.3.20"
"x86_64-linux"

$ ruby -ve 'p Gem::VERSION; p Gem::Platform.local.to_s'
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux-gnu]
"3.3.21"
"x86_64-linux-gnu"

$ ruby -ve 'p Gem::VERSION; p Gem::Platform.local.to_s'
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux-gnu]
"3.3.24"
"x86_64-linux-gnu"

As you can see, it now has the -gnu prefix and Libv8::Node::Paths.object_paths thus has it when the built binary actually lives in the directory x86_64-linux, breaking the build of the gems like mini_racer on those platforms.

RUBY_TARGET_PLATFORM is set to *-linux, so Libv8::Node::Paths.platform needs to align with that.

nightpool and others added 4 commits January 18, 2022 12:15
RubyGems 3.3.21 changed the value format of `Gem::Platform.local` for Ruby configured with `*-linux-gnu` as the platform name.

```console
$ ruby -ve 'p Gem::VERSION; p Gem::Platform.local.to_s'
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux-gnu]
"3.3.20"
"x86_64-linux"

$ ruby -ve 'p Gem::VERSION; p Gem::Platform.local.to_s'
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux-gnu]
"3.3.21"
"x86_64-linux-gnu"

$ ruby -ve 'p Gem::VERSION; p Gem::Platform.local.to_s'
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux-gnu]
"3.3.24"
"x86_64-linux-gnu"
```

As you can see, it now has the `-gnu` prefix and `Libv8::Node::Paths.object_paths` thus has it when the built binary actually lives in the directory `x86_64-linux`, breaking the build of
the gems like mini_racer on those platforms.

[`RUBY_TARGET_PLATFORM` is set to `*-linux`](https://github.com/knu/libv8-node/blob/ad9105562185571f7b486f7770986f6a160318b2/libexec/platform#L28-L29), so `Libv8::Node::Paths.platform` needs to align with that.
@brevilo
Copy link

brevilo commented Mar 18, 2024

Just ran into the same issue. What's holding back a merge?

@lloeki
Copy link
Collaborator

lloeki commented Apr 9, 2024

What's holding back a merge?

Small bits of time I have available are spent on the catch up plan: rubyjs/mini_racer#277

I'll eventually get back to this. It might also be linked to rubyjs/mini_racer#284 (comment) as the *-linux packages should really be *-linux-gnu instead.

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 this pull request may close these issues.

None yet

4 participants