Skip to content

Conversation

@eregon
Copy link
Member

@eregon eregon commented Nov 10, 2024

  • This is notably necessary on TruffleRuby, which is updating to Ruby 3.3 which introduces Prism as a default gem.
  • Using the existing path is not an option as it would end up in truffleruby/lib/build/libprism.so and "truffleruby/lib/include/#{header}" which are not good places for such files.

* This is notably necessary on TruffleRuby, which is updating to Ruby 3.3 which introduces Prism as a default gem.
* Using the existing path is not an option as it would end up in truffleruby/lib/build/libprism.so and
  "truffleruby/lib/include/#{header}" which are not good places for such files.
@eregon eregon requested a review from kddnewton November 10, 2024 14:08
INCLUDE_DIR = File.expand_path("../../include", __dir__)
ffi_lib libprism_in_build
else
INCLUDE_DIR = "#{RbConfig::CONFIG["libdir"]}/prism/include"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note I used libdir here and not includedir on purpose, those headers should not be reachable with C include statements and should not be mixed with Ruby C API headers.

@eileencodes eileencodes merged commit 7366114 into ruby:main Nov 12, 2024
55 checks passed
@kddnewton
Copy link
Collaborator

@eregon I'm not sure if I'm reading this right, but it seems like when on the FFI backend this would favor the builtin Prism instead of the one bundled with the gem. Does that mean that on the FFI backend you can no longer upgrade the Prism gem version?

@eregon
Copy link
Member Author

eregon commented Dec 3, 2024

It prefers the libprism in ../../build/libprism (the one bundled with/inside the gem) so that will get used when installing the gem, same as before.
It's only when it doesn't find it there, i.e. when prism is a default gem in TruffleRuby that it will use RbConfig.

Also if this was wrong the CI would fail and the version checks would fail as well.

@kddnewton
Copy link
Collaborator

Ahhh I see now, thanks!

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.

3 participants