-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
ruby >= 3.2 bottles have an incorrect path in RbConfig::CONFIG["AR"] #170978
Comments
I copy here the whole RbConfig::CONFIG.
|
I ticked this box even though the output says differently but I am absolutely certain that would change nothing, and the issue reproduces 100% regardless of that One more thought: this problem could likely also be solved if the bottle was built on a system which does not have XCode installed, because then CRuby wouldn't find those executables. Or maybe there are ways to tell CRuby which toolchain to use (the CLT is better if it's always guaranteed to be there for Homebrew) rather than letting it guess. |
This is caused by ruby/ruby@038f9ad. |
Indeed, I see:
Interesting that LD above is not affected but AR and NM are. Any idea how to fix this in Homebrew? Maybe it should be changed in CRuby? But that wouldn't fix it for existing 3.2 and 3.3 releases. cc @nobu since you did this change and might know more about it |
This bug will likely affect all macOS Ruby builds (unless Xcode is missing) so definitely seems like an upstream fix is desirable here. |
Agreed, although for the common case of compiling ruby from source on the same machine it's not an issue because then either no XCode and fine anyway, or XCode is installed and then those paths will most likely work fine (unless XCode is later uninstalled). |
@Bo98 Could you file an issue at https://bugs.ruby-lang.org/ ? Also, since this basically only happens with Homebrew builds of CRuby (Homebrew is one of the very few to have binary builds of Ruby on macOS), it seems worth working around in parallel in Homebrew until it gets fixed & released in CRuby. |
Likely affects MacPorts too - but I haven't checked for sure. Can open an issue shortly, and maybe a pull request too if I find the time. |
Apologies for the delay: https://bugs.ruby-lang.org/issues/20499 |
Fixed upstream at ruby/ruby@8277cf0 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Upstream fix backported to Ruby 3.3.3: ruby/ruby@d3b1398 |
Should be fixed now after a We will accept a PR to apply the patch to |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
It's also merged to the 3.2 branch now: ruby/ruby@5141d72, so I think we can close this, it will be fixed with the next 3.2 release and Homebrew using the newer versions. |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
In ruby/prism#2716 we had a report that someone using ruby from Homebrew failed to build the Prism gem.
After investigation it became clear the problem is that the value of
RbConfig::CONFIG["AR"]
is incorrect in the bottles of the ruby 3.2 and 3.3 formulae.What happened (include all command output)?
CC is fine, and this explains why most gems with native extensions install fine:
AR:
But AR is this absolute path from Ruby 3.2, which can cause problems.
Notably, the path
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
does not exist if XCode is not installed and only the Command Line Tools are installed.This means any Ruby relying on
RbConfig::CONFIG["AR"]
is broken.What did you expect to happen?
RbConfig::CONFIG["AR"] is valid and existing path for any Homebrew user, whether they have XCode installed or not.
This change might be partly caused by changes in CRuby upstream.
However, it seems clear Homebrew should ship a properly-built Ruby with correct paths.
See Homebrew/homebrew-portable-ruby#187 which seems a fairly similar issue but for
homebrew-portable-ruby
instead of the[email protected]
/[email protected]
formulae.The fix can very likely be the same/similar.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: