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
The extra option including a space is splitted to execute the command. #215
Comments
Could you try 1.2.2? |
Thank you for fixing this issue and releasing the new version 1.2.2!
I confirmed that the following command propagates the
Note that the
And the following command with the additional quotes that succeeded with the rake-compiler 1.2.1 failed in the rake-compiler 1.2.2.
I debugged with debug gem again. The
|
It's done by Rake: https://github.com/ruby/rake/blob/1d3579b01484a59bdf1a3e542662ea4ab7e79f7c/lib/rake/file_utils.rb#L80 If you think that we should improve this, please report it to Rake.
Right. |
Thank you for checking the part causing the issue. I reported the issue on ruby/rake#501 at the rake project. |
__Context__ In rake-compiler 1.2.1 and earlier, if an extension did something like this, rake-compiler handled it gracefully: ```ruby Rake::ExtensionTask.new("gem", spec) do |ext| ext.config_options << ENV["EXTOPTS"] # this is probably going to be nil end ``` It is OK to do this because in 1.2.1 and earlier, the command array was executed as: ``` sh cmd.join(' ') ``` However, this was changed in 1.2.2 to ``` sh *cmd ``` which of course is preferable. However, this breaks extensions [like nokogiri that do something silly like above](https://github.com/sparklemotion/nokogiri/actions/runs/5109347425/jobs/9184057367). __Details__ I've fixed Nokogiri (see sparklemotion/nokogiri#2894) but I do think that there may be other gems impacted by this change. This PR does a few things: - extract a method `make_makefile_cmd` so that we can unit test it - backfill basic test coverage - backfill test for #215 - write a test for this `nil` case, and fix it by returning the result of `cmd.compact` This is a big PR because of the extraction and test coverage. Please let me know if you would prefer this to be done a different way.
The ruby/openssl is using the rake-compiler. Here is my test on Fedora 37.
Install the gems. The
--standalone
option is my favorite. :)Then the following command with
--with-cflags='"-Wundef -Werror"'
propagates the-Wundef -Werror
to the compiler gcc command. Note that theMAKEFLAGS="V=1"
is an option to print the compiler commands.However, the following command with
--with-cflags='-Wundef -Werror'
(without additional quotes) separates the--with-cflags=-Wundef
from the-Werror
. And it doesn't propagate the-Werror
to the gcc command line.Is it an expected behavior? Is it a bug?
Debug
I debugged with debug gem by adding the
gem "debug"
to theGemfile
of the ruby/opnessl. And set the breakpoint below.I checked at the breakpoint
binding.break
.So, it seems that
cmd.join(' ')
causes this issue.rake-compiler/lib/rake/extensiontask.rb
Line 220 in 7fa360a
The text was updated successfully, but these errors were encountered: