-
-
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
gettext should properly install its m4 macros #53192
Comments
I'm told that one may add to env. var. |
I think this is a problem that should be tackled earlier on the the build system of whatever project, autoreconf, or maybe needs to be libtoolized in a way that makes it more portable. Because according to GNU autotools docs, you should not expect that there is a location that is universally known by autotools on all systems. It actually uses gettext as an example.
|
While the quoted docs use Indeed, how one would go about finding said installation, unless it is in a standard location, and without a specific hint One can argue that a tip about |
Well, frankly I find myself in agreement often, where it would be more convenient if autoconf found gnu gettext automatically. But I think you are missing the point when you say that there should be an easy way to use the already installed Which one is that?? The reason gettext is keg-only in the first place is because the system provides bsd gettext by default. Just installing (even if you But again, I am just repeating what apparently "should" be done, and kind of what I feel like is the "correct" or "intended" approach, though it might sound pedantic and irrelevant in most cases, based on a section that almost reads like a petition written by the authors with full knowledge of how very few will listen.
Also, in macOS's case, I think more prudence is necessary when deciding to add such advice even as a note in caveats, because someone installing gnu gettext just to build one project might follow its instructions, or some unpredictable variant of it blindly. It's a lot harder to "break" the system by doing something like this nowadays, but I was somewhat traumatized after trying to transplant gnu tools back in place of llvm after Apple switched the default and an xserve was fubar until a clean reinstall. So yeah. about 80% of the time I want gnu gettext, closer to 100% if in an autotools built project, which is pretty much all of them except a handful of meson. But when I do, I can usually find the wrappers around it (using brew, for example) and I can't really think of a situation where following the second half of the caveats (adding compiler/linker flags) or adding paths for aclocal to look in would be the optimal approach. |
We merely want to call In particular it is meant to build on Linux, in Conda, in Homebrew, etc. Stand in our shoes for a moment, please, and tell us how are we supposed to figure out what to add to |
hear, hear! |
I'm saying that shouldn't be your problem. Especially since you're using automake, why should you have to know where gettext is installed on every single user's system? Even automake passes the buck to autoconf, but says it is including aclocal for the time being because it isn't going to be replaced anytime soon. (Or not. I was trying to find some examples for you and found a lot more projects switching to meson from autotools for some reason) If you're using brew, add gettext as a dependency and run something that will set up the build system for whatever machine you're doing this on, autoreconf, or maybe you have an autogen.sh or other script that will run autopoint from gettext, which will copy or symlink the files. If this doesn't work, you probably missed a step or two when configuring your project's build system. Did you have m4 installed first, before anything else, then install autoconf, gettext and automake, then configure your project to use each tool? (Because it sounds like it does use all of them) Is there any sign of gettextize ever being run in the build root in the master branch history? I'm starting to doubt if it was.
Yeah, if backwards compatibility was the only concern I'm sure that's what would have been done by default for all installs. But there's a huge interoperability issue for macOS users, which compose a majority of brew users, I'm guessing.
|
If you're building with brew, run |
No, we are not. We are using |
In more detail, we want to use, or can use, some packages from brew, and build some other packages ourselves. Thus, in particular, we need to detect the presense of iconv from our ./configure. The most natural way to do this is to use |
I really do not understand why refusing to reveal to the users how to use the macros you install is the way to go, instead inviting then basically reverse engineer what to do (by reading Ruby code) may be the way to go. |
Okay, so you're one of the people who "install Automake just to use ‘aclocal’, but do not use ‘automake’ Homebrew already tells you the reason for not installing the package fully, because the system gettext provided is the (very different) BSD gettext. If you're using brew on linux, maybe you're right, but I don't know if this is the right place for this issue (maybe Homebrew/linuxbrew-core?) |
You're supposed to read the gettext documentation to find out how to use the macros, what do you think all those binaries are for that come with gettext? |
Do you think that every developer that uses an autotools project must have read the gettext documentation? Certainly this is not the case, people usually merely want the soft being built, they are ready to read hints provided by Needless to say, I presume that there is no breakege in using Homebrew's gettext m4 macros with Homebrew's gettext, iconv, etc. Our |
Maybe not everyone who builds your software, but the project maintainer definitely should read the docs if he or she does not know how to use gettext and wants to use it in the project.
Well you don't need to use Homebrew's gettext, or any gettext at all, if all you need is libiconv. macOS ships with gnu iconv (I think, not 100% sure about this but I think it still ships with BSD gettext and GNU libiconv) If you do need gettext, instead of manually copying config.rpath (which I don't understand how your script does with just gettext in the PATH? Is there a function to print the path to config.rpath??) autopoint should replace the one already in the directory, as it should have been created/copied when the project was gettextized. autopoint is installed to the same directory as gettext, so I guess first try replacing the config.rpath copy step with, or appending an autopoint step afterwards if you want to be able to revert more easily. Getting gettext and friends included in PATH should be done just by adding gettext as a dependency. I didn't realize this, but maybe you (or your AWOL dev responsible for maintaining the build system...) should maybe heed the warning about aclocal disappearing one day a little more seriously. I wasn't aware (I don't maintain any projects with portable buildsystems) but even glib is using meson. |
Thanks for a pointer, we should look into
in We currently get the location of Presumably we can do the same for the m4 macros, in particular as
@mkoeppe - any thoughts on this? PS. We have about 4K lines of m4 macros, 70% of it written by us, not just copied. And there are templates for Makefiles, etc, too, that I don't count. This is a bit too much to just go and convert to another build system. |
I did not know they were literally shell script wrappers, but doesn't that just feel wrong 😬
You have a lot more than that, I agree it's a lot to convert to a non-proprietary build system, but unless you can get the original dev who concocted it to work on it, it's something that you probably want to do sooner than later if you want it to remain manageable and probably more importantly, if you want it to be maintainable by anyone other than the original author. (At least it's working in most linux distros at the moment right?) I think the issue is that you are trying to use automake macros that come with gettext, when you use neither. (On a side note, apparently Gnu libiconv and gettext have a circular dependence on one another, so you have to build at least one of them twice on system that runs libtoolize on the project and commits/pushes to origin master.) You could just find the system libiconv and headers for Mac, or add it as a dependency and find it using homebrew. |
|
I don't know what made you think like this. Sagemath mainly provides interactive capabilities, via Python shell, to a range of C/C++ libraries (e.g. gmp, mprf, NTL, arb, flint - and a range of more obsure ones Brew doesn't have, such as Symmetrica) as well as to "interactive" computer algebra systems such as Maxima, Singular, GAP, Polymake (not in Brew, I guess) etc. |
This was as far as I got. For the version, you can just add the minimum version IIRC, but as a requirement, (e.g. P.S.
I'm assuming that was a typo/autocorrect and you meant Cython there right? |
This is a very minor and small convenience module - we do have our own packaging system (oh, don't ask why a 15-years old project has this :-)) and it turns out that some configuration things for building the main Python module are best packaged this way. In fact, the majority of our autoconf code is akin to Brew formulae, only in m4, not Ruby. As we don't have a luxury of everything else uniformly packaged (apart from Python libs, but even they are not 100% uniform), it's very ad hoc, e.g. https://github.com/sagemath/sage/blob/develop/build/pkgs/gf2x/spkg-configure.m4
Oh yes, sorry - even though we do support Cygwin too (or at least try to). |
Oh wow yeah, no I didn't realize it was almost all in python. I'm in way over my head if you're building a python project with autotools and not in conjunction with setuptools (or is it used later on?), I'm guessing it needs to because it's an api to other C, C++, etc api's. One last fyi I've got is that But I think we've been off-topic with this issue for quite some time, though I'm curious what direction this will progress in, you'll get better advice than I've got from people more experienced with maintaining projects and their build systems to be portable on everything from Aix to windows elsewhere, maybe the autotools mailing list, or SO, maybe an issue on the project in question, for when your dev shows up again. |
I think this isn't a homebrew related issue, closing |
what's built with autotools are mostly libraries to be used in Python extensions (which are built with the usual Python toolchain). |
Sean, "Lees maar, er staat niet wat er staat" :-) |
I think some of the original issue discussed here should happen to be addressed by #53489. |
brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew gist-logs <formula>
(where<formula>
is the name of the formula that failed) and included the output link?brew gist-logs
didn't work: ranbrew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
install gettext package with its autoconf macros such as AM_ICONV
What happened (include command output)
its autoconf macros don't get installed to a location known to autotools,
even after running
they remain in
/usr/local/opt/gettext/share/aclocal/
What you expected to happen
the m4 files get installed in a location known to autotools, e.g.
/usr/local/share/aclocal/
Step-by-step reproduction instructions (by running
brew install
commands)This would need a small autotools project to demonstrate an error message such as
Running
brew link --force gettext
merely printsgiving no clue regarding the fate of m4 files.
While one may go and manually create symlinks to the files in
/usr/local/opt/gettext/share/aclocal/
at/usr/local/share/aclocal/
, this ought to happen automatically.The text was updated successfully, but these errors were encountered: