Skip to content

An option to use Rubies configured with --mkmf-verbose #505

@junaruga

Description

@junaruga

The feature to print compiler (e.g. gcc, clang) command lines in the build time of the Ruby native extensions is available on Ruby 3.1 or later versions, that is possible by building Ruby with configure --mkmf-verbose option.

Here is the commit on the ruby/ruby master branch. - ruby/ruby@019cbde

I would like to use the Rubies configured with --mkmf-verbose from the GitHub Actions: ruby/setup-ruby. Because I made this issue of the compiler warnings (-Wundef) printed in ruby/openssl. And the ruby/openssl's GitHub Actions CI didn't print the compiler warnings when I ran the bundle exec rake compile -- --with-cflags='-Wundef' on the CI. So, I would like to see the compiler command lines on the GitHub Actions.

I don't understand how the ruby/setup-ruby works. But seeing the code, the ruby/setup-ruby is calling https://github.com/rbenv/ruby-build.git? And seeing the https://github.com/rbenv/ruby-build, we can manage the configure options by the CONFIGURE_OPTS environment? I am not sure how much hard to implement this, and what are the concerns to add this new feature.

Considering the backward compatibility of the ruby/setup-ruby, I would like that the Rubies configured with --mkmf-verbose is optional, not a default behavior of the ruby/setup-ruby.

What do you think?

In the mean time, as a workaround, I plan to modify the mkmf.rb like this to enable the feature in GitHub Actions.

$ sudo sed -i -E 's/^V = .+/V = 1/' /path/to/mkmf.rb
$ diff mkmf.rb.orig mkmf.rb
1974c1974
< V = #{CONFIG['MKMF_VERBOSE']}
---
> V = 1

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