-
Notifications
You must be signed in to change notification settings - Fork 2.1k
CMake pulls in wrong libintl on macOS #5244
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
Comments
Obvious questions first (sorry): have you tried blowing away the build dir entirely and trying again? It builds with cmake for me on macOS High Sierra and Mojave. |
Yeah, I've tried that. Same deal.
Here's the complete output of
I added a few logging statements to
relevant output:
Another workaround appears to be |
Do you have either of |
No, neither are set |
CMake's heuristic for determining the match for Does anything there stand out to you? |
When I install gettext via homebrew, it says the following:
So by default no lib should be found. The question is why cmake is picking up on these (incorrect) libraries rather than ignoring them altogether. |
I think cmake is pulling them out of cmake output
however, if I then run
cmake finds the correct gettext I also tried running
as per brew's suggestion, but even though cmake can see those flags (they show up as env variables that I can print out using |
Ah, that explains it. We're not actually looking for gettext headers here, we're looking for the Since they are executable programs, cmake finds them not via $LDFLAGS or $CPPFLAGS, but via $PATH. And apparently the first component in your $PATH to have a msgmerge is... anaconda. I'm not sure what to do about this, though. I don't even know why anaconda would have msgmerge? I don't really get what it is, TBH. |
It's a package manager with a strong focus on tools like NumPy and R that are relevant to data science: https://www.anaconda.com/what-is-anaconda/. Although a lot of people like myself use it primarily as a better mechanism for managing multiple python environments than pyenv and the like. So in many my anaconda environments I'll have packages like openssl installed. If someone has activated a anaconda environment that that includes tools like P.S., I normally avoid having any anaconda environment activated when doing things like building fish to avoid such surprises. I really don't think this is the responsibility of fish. |
But why are we finding something by executable then feeding that to the linker:
I imagine we need a separate check for libintl vs its bin files. |
I want to stress that I didn't have an Anaconda environment activated when I was building Fish. It's merely installed on my system (I use it as a general-purpose replacement for virtualenvs). AFAIK it adds its |
@JEphron noted, but my concern still holds. |
This is not quite true. We search separately for libintl and the gettext binaries. |
I can reproduce this - looks like I've got the Mono libintl, and if I add the brew gettext tools to my path, I get the same problem. I have spent some time reviewing the current state:
If you have Mono installed, libintl's headers are picked up by CMake from This is only exposed as a problem when gettext is in the path, because of the requirement for both gettext and libintl for the
I think this is a bug in CMake's FindIntl module, which I'll report to them. Someone has a similar problem in EOSIO/eos#1539. For now, you can work around this either by turning off the use of translation ( |
Wow that was a journey! Sounds like you helped fish and cmake. |
OSX 10.13.6
checkout: 6a9f0fc
make can't find my
libintl
:I've noticed that CMake is trying to use the
libintl
from an install of Mono that I have on my system:(and also the
gettext
from anaconda, for some reason: although maybe unrelated)I'm far from an expert on CMake, so I wasn't sure how to fix this properly. I worked around it by doing a
brew link gettext --force
, which causes CMake to see libintl at/usr/local/lib/libintl.dylib
, but brew warns that this is probably a bad idea and might cause other compilation issues.So, not sure if this is really a bug report or just my setup being wonky, but I figure it can't hurt to document it here (for posterity).
The text was updated successfully, but these errors were encountered: