Closed svoop closed 1 year ago
Same with other Rubies such as 3.2.2
Could you try reproducing this without ruby-install
, but just run the ./configure --with-jemalloc CFLAGS="-march=core2 -msse4 -mcx16 -msahf -pipe -O2"
command in the ruby src directory?
ruby-install
uses "$@"
and "${configure_opts[@]}"
which should preserve the argument as a single argument. So I'm wondering if ./configure
isn't recognizing CFLAGS
as an env variable?
https://github.com/postmodern/ruby-install/blob/master/bin/ruby-install#L5
https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby-install.sh#L217
https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby/functions.sh#L40
Also, as a workaround, you could try passing the env variable in at the front of the command like you normally would:
CFLAGS="..." ruby-install ruby -- ...
Wait, I see the diff now between 0.8.5 and 0.9.0. I added the run
method which logs the command and then executes it. Appears that by calling $@
(without quotes) to run the given arguments as a command, it causes implicit arg splitting. According to the Wooledge Wiki, a lone "$@"
will preserve the arguments but also execute them as a command.
https://mywiki.wooledge.org/Quotes
Just tried it on the Linux box with current main – works like a charm, thanks a bunch!! 🎉
Our design guy has the same problem on his Mac (he needs to set CPPFLAGS for some exotic stuff). I'd rather wait for your release of 0.9.1 and then nudge Homebrew than going from source there – any chance to see 0.9.1 soonish?
Now to come up with a good test to verify that run
doesn't implicitly word split it's arguments.
On a Gentoo Linux box, I try to install the system Ruby 3.1 using:
This worked fine up until rub-install-0.8.5, however, with 0.9.0 all the latter CFLAGS cause an error message similar to:
It does work if I reduce CFLAGS to only
-march=core2
, but then I get a lot of warnings due to the missing optimization flag.There's nothing in the CHANGELOG which might give a hint towards a regression, but maybe you have an idea whether a particular commit could be related.
Meanwhile, I'm not really sure what to provide in order to help debugging. However, I have a standby box to try things, just tell me what I can provide. Big thanks!!