Closed ndw closed 1 year ago
I don't think gettext
is broken.
If I had to guess, Python's build is detecting libintl but not using necessary linker flags when compiling.
gettext
, so it requires passing -lintl
to link to corresponding library.From your snippet, the failing step is only passing: -ldl -framework CoreFoundation
so it is missing -lintl
. You may need to review upstream build scripts to see why. Usually cross-platform autotools configure script should detect if additional linker flags are needed and add those into Makefile steps as needed.
The symbols should all be available once -lintl
is passed and corresponding libintl.dylib
is found:
❯ nm -gU /opt/homebrew/opt/gettext/lib/libintl.dylib | grep libintl
000000000000449c T _libintl_bind_textdomain_codeset
000000000000417c T _libintl_bindtextdomain
00000000000044c8 T _libintl_dcgettext
0000000000007994 T _libintl_dcngettext
00000000000044dc T _libintl_dgettext
00000000000079a4 T _libintl_dngettext
00000000000044e4 T _libintl_gettext
0000000000009540 T _libintl_newlocale
00000000000079ac T _libintl_ngettext
00000000000083e8 T _libintl_set_relocation_prefix
0000000000009048 T _libintl_setlocale
0000000000006100 T _libintl_textdomain
00000000000103e0 D _libintl_version
Also, since some brew doctor
output mentions /usr/local/lib
, if you have a Rosetta/x86_64 installation of Homebrew in /usr/local
(or files left over from migrating a Intel mac to ARM mac), you may want to review what libraries are installed there.
/usr/local
is a standard path that is often picked up by compilers. This can cause issues if you mix incompatible architecture libraries.
This is the first I'm hearing of this, so it seems unlikely that the issue is with Homebrew gettext
. I am willing to revise this belief given the right evidence, of course.
From your snippet, the failing step is only passing: -ldl -framework CoreFoundation so it is missing -lintl
Exactly this. The error is in the build process.
Indeed, it builds fine with
make LDFLAGS="-L/opt/homebrew/opt/gettext/lib -lintl"
Thank you for your patience. Now, can I persuade pyenv
to do this? We shall see...
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputand
Verification
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)?
I want to build Python (3.11.1). I'm trying to setup virtual environments, when that didn't work, I took a step back to see if I could simply compile python.
(I didn't actually delete the
libguile
files identified bybrew doctor
but I don't think they're involved.)What happened (include all command output)?
Make fails:
A little web searching lead me to some suggestions about removing
gettext
. I had trouble with that because of other installed packages with dependencies ongettext
, so I just uninstalled Homebrew. Then I reinstalled it, but didn't install any packages.In this state, Python builds fine.
Then I installed
git
which I need, andmake
because I have an alias formake
that expectsgmake
to exist. And I installedexa
because I have an alias forls
that uses it. I don't have any reason to think make and exa are involved anyway.In this state, Python won't build with the error above.
I don't see any obvious problem with the gettext libraries:
But I don't really know what else to try.
What did you expect to happen?
I expected Python to build :-)
Step-by-step reproduction instructions (by running
brew
commands)