Skip to content

@ruby//:headers assumes headers are in subdirectory of dist #208

@JasonLunn

Description

@JasonLunn

#197 exposes the location of Ruby headers/jars for use in rules that build native extensions, but it appears to make assumptions about the location of these files (e.g. that they are in a subdirectory named dist) that aren't universal.

When I install CRuby via RVM (inside a docker image):

ruby -e 'puts RbConfig::CONFIG["rubyhdrdir"]' outputs /usr/local/rvm/rubies/ruby-3.0.2/include/ruby-3.0.0

Similarly, for a user local installation of JRuby on my laptop, I find jruby.jar in ~/.rubies/jruby-9.4.5.0/lib/jruby.jar, which aligns with the output from ruby -e 'puts RbConfig::CONFIG["libdir"]'

In neither the CRuby or JRuby cases are the headers within a dist directory.

As a result, when I try to build the native extension examples on these system, I see 'ruby.h' file not found build errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions