You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update makefile to use / fall back on built-in "ar" #2716
Also @forthrin that value is coming from RbConfig::CONFIG. Is it possible that you compiled Ruby with an ar and then somehow removed it?
⬆. The new release switched from make-default AR & etc. to those specified by RbConfig::CONFIG, so this sort of problem arise if the current setup differs that built Ruby with.
This might be the same issue as the one failing CI in #2711. [EDIT: It’s different.]
I’ll try some research on the Mac building environment. [Update: Homebrew/brew#17114 is reporting an incompatibility from Ubuntu.]
In the mean time, p RUBY_DESCRIPTION, RbConfig::CONFIG.slice('AR', 'ARFLAGS', 'CC') data could help us with confirmations.
I'm on macOS 14. gem says it's a "default gem". I have never installed it manually or used it directly. So everything that has happened with it has done so by default behind the scenes without my intervention or knowledge.
I'm still getting this error after trying the workaround.
@nickmccurdy
Your setup is probably different then.
Neither OP nor the lead dev have replied, so while I (we?) ponder about how things work, can you also get us your p … data and question responses?
This is an issue indeed (a recurring one, sounds like), but I don’t want to just push some workaround (like what the title says). I want to cure it at its root.
Just that I’m not yet certain if it’s my fault or rather similar to Homebrew/homebrew-portable-ruby#187.
[…]
Never compiled Ruby, at least not manually or intentionally. It's a cask.
Google says this’ll brew a formula, not a cask?
I don’t have experience in Mac development nor Homebrew, so this debugging is quite a challenge.
Might have experimentally run xcode-select as suggested workarounds for various issues.
That could be something. https://www.unix.com/man-page/OSX/1/xcode-select (from 2013?) implies that this Xcode util manages building tools including but not limited to /usr/bin/ar and /usr/bin/clang. But 🤔
Your ar exists in /usr/bin/ but not in Xcode where /usr/bin/* refers to.
Your CC searches the PATH while your AR is pinned to Xcode.
Like which?
Anything that says “Building native extensions. This could take a while” when gem installed (or gem updated).
Does brew upgrade ruby include gem update?
[Edit]
Actually, it look like a malformed AR entry won’t affect most C extension gems because they are dynamically linked (i.e., built as .so) which does not need ar.
Otherwise, mkmf doesn’t seem to have any mechanism to fall back to PATH ar if the rbconfigAR is broken (like what this issue requested (originally)).
Though I’m still puzzled on how your rbconfig ended up like that.
Also, the PR logs told that you needed the AR ?= ar line, but it was supposed to not matter for GNU make.
What’s your make --version? Could that be a possiblility?
(The README.md specifies GNUmake.)
@forthrin I have been trying to understand this issue in more details (here).
Could you share the output of ruby -ve 'pp RbConfig::CONFIG'?
And also the output of these 5 commands:
xcode-select --print-path
ls $(xcode-select --print-path)
ls $(xcode-select --print-path)/bin
ls $(ruby -e 'puts RbConfig::CONFIG["CC"]')
ls $(ruby -e 'puts RbConfig::CONFIG["AR"]')
?
I wonder if maybe an incorrect xcode-select or an XCode update removing an older toolchain could cause this.
The part about CC existing and AR not is really puzzling.
$ xcode-select --print-path
/Library/Developer/CommandLineTools
$ ls $(xcode-select --print-path)
Library SDKs usr
$ ls $(xcode-select --print-path)/bin
ls: /Library/Developer/CommandLineTools/bin: No such file or directory
$ ls $(ruby -e 'puts RbConfig::CONFIG["CC"]')
ls: clang: No such file or directory
$ ls $(ruby -e 'puts RbConfig::CONFIG["AR"]')
ls: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: No such file or directory
FYI:
$ ls -l /Library/Developer/CommandLineTools/usr/bin
/Library/Developer/CommandLineTools/usr/bin/ar
/Library/Developer/CommandLineTools/usr/bin/clang
# snip
Thank you, that confirms that RbConfig::CONFIG["CC"] is clang and so that just works.
And RbConfig::CONFIG["AR"] is /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar, which is a broken value as (from what I understood) you never had a file at that path on that machine.
This seems very much a case of Homebrew/homebrew-portable-ruby#187 or very similar.
IOW it's a bug of that precompiled ruby you got that RbConfig::CONFIG["AR"] is an invalid path.
Although ruby in your PATH is most likely brew install ruby from what you said earlier, not that homebrew-portable-ruby.
So then it'd be a bug of https://github.com/Homebrew/homebrew-core/blob/master/Formula/r/ruby.rb, specifically that the binary (bottle) contains such invalid paths.
Activity
kddnewton commentedon Apr 19, 2024
To be clear, did this work with 0.25.0?
kddnewton commentedon Apr 19, 2024
@ParadoxV5 do you think you could take a look at this?
forthrin commentedon Apr 19, 2024
Running
gem updatedaily for quite a while and first time this happened, so assume yes.kddnewton commentedon Apr 19, 2024
Also @forthrin that value is coming from
RbConfig::CONFIG. Is it possible that you compiled Ruby with anarand then somehow removed it?ParadoxV5 commentedon Apr 19, 2024
⬆. The new release switched from
make-defaultAR& etc. to those specified byRbConfig::CONFIG, so this sort of problem arise if the current setup differs that built Ruby with.This might be the same issue as the one failing CI in #2711.[EDIT: It’s different.]I’ll try some research on the Mac building environment. [Update: Homebrew/brew#17114 is reporting an incompatibility from Ubuntu.]
In the mean time,
p RUBY_DESCRIPTION, RbConfig::CONFIG.slice('AR', 'ARFLAGS', 'CC')data could help us with confirmations.forthrin commentedon Apr 19, 2024
I'm on macOS 14.
gemsays it's a "default gem". I have never installed it manually or used it directly. So everything that has happened with it has done so by default behind the scenes without my intervention or knowledge.ParadoxV5 commentedon Apr 19, 2024
Prism 0.19 is a default gem for Ruby 3.3, though
gemlets usupdatedefault gems to never versions (e.g., Prism 0.26) if we wish.ParadoxV5 commentedon Apr 19, 2024
This
CCwould search for “built-inclang” on thePATH, butARis the full path to specifically thearfrom Xcode.Help us out @forthrin (and thank you for your patience):
Did you switch toolsets after installing Ruby?
Had to create a directory that’s supposed to be managed by the Xcode app? 🤔
@kddnewton any other thoughts?
So we support ARM? 👌
nickserv commentedon Apr 19, 2024
I'm still getting this error after trying the workaround.
ParadoxV5 commentedon Apr 20, 2024
@nickmccurdy
Your setup is probably different then.
Neither OP nor the lead dev have replied, so while I (we?) ponder about how things work, can you also get us your
p …data and question responses?This is an issue indeed (a recurring one, sounds like), but I don’t want to just push some workaround (like what the title says). I want to cure it at its root.
Just that I’m not yet certain if it’s my fault or rather similar to Homebrew/homebrew-portable-ruby#187.
forthrin commentedon Apr 20, 2024
@ParadoxV5: Happy to help
Never compiled Ruby, at least not manually or intentionally. It's a cask.
Don't have Xcode, just CLT. Might have experimentally run
xcode-selectas suggested workarounds for various issues.Like which? (Generally haven't had problems with Ruby or gems)
ParadoxV5 commentedon Apr 20, 2024
Google says this’ll brew a formula, not a cask?
I don’t have experience in Mac development nor Homebrew, so this debugging is quite a challenge.
That could be something. https://www.unix.com/man-page/OSX/1/xcode-select (from 2013?) implies that this Xcode util manages building tools including but not limited to
/usr/bin/arand/usr/bin/clang. But 🤔arexists in/usr/bin/but not in Xcode where/usr/bin/*refers to.CCsearches the PATH while yourARis pinned to Xcode.Anything that says “Building native extensions. This could take a while” when
gem installed (orgem updated).Does
brew upgrade rubyincludegem update?[Edit]
Actually, it look like a malformed
ARentry won’t affect most C extension gems because they are dynamically linked (i.e., built as.so) which does not needar.Otherwise,
mkmfdoesn’t seem to have any mechanism to fall back to PATHarif therbconfigARis broken (like what this issue requested (originally)).12 remaining items
kddnewton commentedon Apr 23, 2024
Fixed on
mainforthrin commentedon Apr 23, 2024
What date will this be available in the central Gem repository? (It's breaking
gem updateatm.)kddnewton commentedon Apr 23, 2024
I'll make a new release today, I'll update the ticket when I do.
kddnewton commentedon Apr 23, 2024
Released with v0.27.0
forthrin commentedon Apr 24, 2024
Great detective work, you guys.
ParadoxV5 commentedon Apr 24, 2024
No thank you, @kddnewton did all the thing.
Though I’m still puzzled on how your
rbconfigended up like that.Also, the PR logs told that you needed the
AR ?= arline, but it was supposed to not matter for GNUmake.What’s your
make --version? Could that be a possiblility?(The
README.mdspecifies GNUmake.)eregon commentedon May 6, 2024
@forthrin I have been trying to understand this issue in more details (here).
Could you share the output of
ruby -ve 'pp RbConfig::CONFIG'?And also the output of these 5 commands:
?
I wonder if maybe an incorrect
xcode-selector an XCode update removing an older toolchain could cause this.The part about CC existing and AR not is really puzzling.
forthrin commentedon May 6, 2024
FYI:
$ ls -l /Library/Developer/CommandLineTools/usr/bin /Library/Developer/CommandLineTools/usr/bin/ar /Library/Developer/CommandLineTools/usr/bin/clang # sniperegon commentedon May 6, 2024
Thank you, that confirms that
RbConfig::CONFIG["CC"]isclangand so that just works.And
RbConfig::CONFIG["AR"]is/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar, which is a broken value as (from what I understood) you never had a file at that path on that machine.This seems very much a case of Homebrew/homebrew-portable-ruby#187 or very similar.
IOW it's a bug of that precompiled ruby you got that
RbConfig::CONFIG["AR"]is an invalid path.Although
rubyin your PATH is most likelybrew install rubyfrom what you said earlier, not that homebrew-portable-ruby.So then it'd be a bug of https://github.com/Homebrew/homebrew-core/blob/master/Formula/r/ruby.rb, specifically that the binary (bottle) contains such invalid paths.
eregon commentedon May 6, 2024
I used GitHub Actions (with
mxschmitt/action-tmate@v3) to check and it's a clear issue in Homebrewrubybottles since 3.2:eregon commentedon May 6, 2024
I filed Homebrew/homebrew-core#170978
forthrin commentedon May 7, 2024
@eregon: Kudos for digging deeper and locating the core issue!