Cannot built gettext-runtime, and cannot proceed without rebuilding gettext-runtime

Esteemed Colleagues:

The proximate reason why I write today is that I cannot
build devel/gettext-runtime, and this is
preventing me from building other ports. Even when I
install devel/gettext-runtime with
pkg install devel/gettext-runtime, I still
cannot build other ports, because I cannot build
devel/gettext-runtime.

That is the proximate reason why I write. But it is
only an instance of a more fundamental phenomenon:
Rebuilding the ports never works. It never works.
It never works. I like FreeBSD, but it is like loving a
woman who gives you so much trouble that, at some point,
you have to decide that, no matter how much you love
her, she is just not worth it.

FreeBSD is like that. Every time I rebuild the ports,
it takes days. Not "hours" -- it takes days. But like
a woman whom you love, every time you do it, you go into
it thinking, This time it will be different. This time
I will rebuild the ports and it will not take days. But
she never changes.

I upgraded my system to FreeBSD 14.0. After upgrading
my system to 14.0 I discovered that on 14.0
portsnap no longer exists. You have to
update your ports tree with git. Also, the
base system does not contain a git command.
Git is a port. This is insane. You need a
port, in order to update your ports. This is insane.
Let us continue the narrative.

So I removed /usr/ports, recreated the
directory, and populated it with git. I
started rebuilding some ports. In particular, I wanted
to build x11/xorg in the hope that the new
FreeBSD 14.0 system would recognize my HDMI display.
Every dialect of Linux that I run on that computer can
draw to the HDMI display but when I boot FreeBSD
xrandr does not report that it even exists.
I rebuilt x11/xrandr and nothing changed. I
tried to rebuild x11/xorg and I could not,
because -- among other reasons, don't think that there
weren't other reasons -- it could not rebuild
devel/gettext-runtime. I manually
installed devel/gettext-runtime with the
pkg install command, and then I tried again
to rebuild x11/xorg and I again failed to
do so because -- you guessed it! -- because I could not
rebuild devel/gettext-runtime.

Maybe, I thought, the ports databases were temporarily
corrupt. I updated the ports tree with
git -C /usr/ports pull. I then tried again
to rebuild x11/xorg and I could not -- wait
for it -- because I could not rebuild devel/gettext-runtime.
I reinstalled devel/gettext-runtime with
pkg install after which I could not rebuild
x11/xorg because -- right again! -- I could
not rebuild devel/gettext-runtime.

I decided to rebuild as many as I could of the ports on
which x11/xorg depends, in the hope of
simplifying the problem. Most of these rebuilds failed
for their own insane reasons (remind me to tell you the
one about the rebuild that failed because there was no
devel/glslang directory underneath
/usr/ports and there is no mention of that
port's having been moved in the MOVED file;
there is a graphics/glslang port but the
MOVED file, apparently, wishes to conceal
that fact).

At some point I tried to re-run git -C /usr/ports pull.
Now I cannot run the git command at all. It
is complaining that it cannot find libcurl.so.4
and refuses to do anything further. So now I have to
rebuild devel/git otherwise I cannot even
maintain the ports tree (which needs a working port, in
order to be maintained -- have I mentioned how insane
that is?). So now I try to rebuild devel/git,
but I cannot, because -- what were the odds? -- I cannot
rebuild devel/gettext-runtime.

Here is the relevant excerpt from the error message:

Code:
===>>> devel/git >> autoconf-2.69_3 >> texinfo-6.6_4,1 >> gettext-runtime-0.22.3 (3/116)

===>  Installing for gettext-runtime-0.22.5
===>  Checking if gettext-runtime is already installed
===>   Registering installation for gettext-runtime-0.22.5
pkg-static: Unable to access file /usr/ports/devel/gettext-runtime/work/stage/usr/local/include/autosprintf.h:No such file or directory
pkg-static: Unable to access file /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.a:No such file or directory
pkg-static: Unable to access file /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.so:No such file or directory
pkg-static: Unable to access file /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.so.0:No such file or directory
pkg-static: Unable to access file /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.so.0.0.0:No such file or directory
pkg-static: Unable to access file /usr/ports/devel/gettext-runtime/work/stage/usr/local/share/doc/libasprintf/autosprintf_all.html:No such file or directory
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/gettext-runtime
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/gettext-runtime

===>>> A backup package for gettext-runtime-0.22.3 should
       be located in /usr/ports/packages/portmaster-backup

===>>> Installation of gettext-runtime-0.22.5 (devel/gettext-runtime) failed
===>>> Aborting update

===>>> Update for gettext-runtime-0.22.3 failed
===>>> Aborting update

===>>> Update for texinfo-6.6_4,1 failed
===>>> Aborting update

===>>> Update for autoconf-2.69_3 failed
===>>> Aborting update


===>>> You can restart from the point of failure with this command line:
       portmaster <flags> devel/git devel/autoconf devel/autoconf-switch print/texinfo devel/gettext-runtime devel/gettext-tools devel/libtextstyle devel/p5-Locale-libintl misc/help2man devel/automake ftp/curl archivers/brotli devel/cmake-core devel/jsoncpp devel/meson devel/ninja devel/pkgconf devel/libuv security/libressl-devel@default security/rhash textproc/expat2 archivers/zstd archivers/liblz4 dns/libidn2 devel/libunistring multimedia/librtmp security/heimdal databases/db5 databases/sqlite3@default devel/libedit lang/tcl86 devel/readline security/libssh2 www/libnghttp2 lang/p5-Error security/p5-Authen-SASL security/p5-Digest-HMAC security/p5-IO-Socket-SSL net/p5-IO-Socket-IP devel/p5-Module-Build security/p5-Net-SSLeay www/p5-Mozilla-CA textproc/rubygem-asciidoctor devel/ruby-gems lang/ruby32 devel/libffi devel/libunwind textproc/libyaml textproc/xmlto misc/getopt print/libpaper devel/libtool shells/bash devel/bison textproc/libxml2 textproc/libxslt security/libgcrypt security/libgpg-error www/w3m devel/boehm-gc devel/libatomic_ops graphics/imlib2 audio/libid3tag graphics/giflib graphics/jpeg-turbo devel/nasm graphics/libjxl devel/glib20 devel/pcre2 devel/highway graphics/gdk-pixbuf2 devel/gobject-introspection graphics/png graphics/tiff archivers/libdeflate graphics/jbigkit misc/shared-mime-info graphics/openexr math/Imath textproc/asciidoc graphics/webp graphics/freeglut graphics/libGLU graphics/libglvnd x11/libX11 devel/xorg-macros x11/libxcb x11/libXau x11/xorgproto x11/libXdmcp x11/xcb-proto x11/xtrans x11/libXext x11/libICE x11/libXi x11/libXfixes x11/libXrandr x11/libXxf86vm print/freetype2 x11/libSM www/p5-CGI net/p5-URI www/p5-HTML-Parser www/p5-HTML-Tagset www/p5-HTTP-Message devel/p5-Clone devel/p5-IO-HTML www/p5-HTTP-Date devel/p5-TimeDate

This command has been saved to ~/portmasterfail.txt

Esteemed colleagues, what is your advice for me now? I
know that the correct advice is that I should divorce
this insane woman, but I am not ready to do that yet.
Not quite ready. So, given that I will not take the
advice that I should be getting, what advice do you
have? Thank you in advance for any and all replies.
 
I’ve just used gitup on FreeBSD 14 so a little bit lighter than git. But yes you have to do pkg install gitup to start with.

No issues building anything on FreeBSD 14 at the moment including gettext. I don’t use X on the machine, but yes if you try to build everything it will take quite some time unless you have a powerful machine, so packages are a better option (not perfect).

You‘ve got to the stage of typing random commands and it’s not going well. You’re just making more and more things broken.

Take a deep breath and start again. Probably see if you can get packages working.
 
===> Registering installation for gettext-runtime-0.22.5 pkg-static: Unable to access file /usr/ports/devel/gettext-runtime/work/stage/usr/local/include/autosprintf.h:No such file or directory
It looks like it's trying to install something that isn't there. Does directory /usr/ports/devel/gettext-runtime/work still exist? If so, clean it with /cd /usr/ports/devel/gettext-runtime && make clean, then restart your build.

To make sure you have a clean build environment, try find /usr/ports -iname "work*" -type d and give all the ports that show up a make clean.
 
Esteemed Colleagues:

I solved the problem, and am now able to build the
gazillion ports that depend on devel/gettext-runtime.
But I refuse to mark this thread as "solved" because my
solution is utterly bogus.

I installed devel/gettext-runtime with pkg by installing
a package that depended on it (e.g., pkg delete bison; pkg install bison).
It had to be done that way because direct installation
was impossible. Invoking pkg install gettext-runtime or
pkg install devel/gettext-runtime fails with
the message that no such package exists.

At this point I now have the files /usr/local/include/autosprintf.h
and /usr/local/lib/libasprintf.a and /usr/local/lib/libasprintf.so*.
I then try to build the devel/gettext-runtime port with
portmaster or with make install, and I get to the point of failure
shown above. I then manually copy /usr/local/include/autosprintf.h
to /usr/ports/devel/gettext-runtime/work/stage/usr/local/include
and I manually copy /usr/local/lib/libasprintf.a and /usr/local/lib/libasprintf.so*
to /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib.
I then run make install from within /usr/ports/devel/gettext-runtime
and the command succeeds.
 
Following quarterly ports, I still have version 0.22.3. If I cd /usr/ports/devel/gettext-runtime && make, after finishing these "missing" files will be there under work/stage. Just like they should (as listed in pkg-plist).
If the files are indeed missing, there must have been some error before the install fase. Do you see any error when you give it a make clean && make?

Which ports do you follow, latest or quarterly?
 
I don't know whether I follow the latest ports or the quarterly ports. I populated /usr/ports with git clone https://git.FreeBSD.org/ports.git /usr/ports and I update it with git -C /usr/ports pull (which I did again earlier this morning, before "solving" my devel/gettext-runtime problem). I hope that answers your question because I do not otherwise know how to answer it.

I admire the confidence with which you asserted "If the files are indeed missing, there must have been some error before the install" but, in fact, the files were indeed missing, and there was no visible error before the install. I shall insert here the entire output of the portmaster command, if this website will allow me to insert so much text.

(No, it didn't. I put it on my website at http://m5.chicago.il.us/portmaster.out and you can see it there.)

The context of the above command is that I had already installed devel/gettext-runtime with pkg install. I then tried to build x11/xterm. I know that you can install x11/xterm with pkg install -- and, in fact, I had already done do -- but I wanted to build something, so I could run make config and get something non-default, like, e.g., a toolbar. But when I tried to build x11/xterm, the crazy woman insisted that devel/gettext-runtime had to be built too, even though I had already installed the bloody thing, and then refused to do it, uttering the by-now familiar complaint that certain files having to do with autosprintf were missing.

Moreover, even though I have, through enormous exertions and utter bogosity, "solved" the problem of devel/gettext-runtime, there is another problem with devel/binutils that is even crazier. I installed that port with pkg install, but when I try to build lang/gcc, devel/binutils is rebuilt. More correctly, it is not rebuild. The unnecessary build fails, with even less of an indication than before of the nature of the failure, just an "Error 2" message. I tell you, I am this close (you must imagine a hand gesture here, showing two fingers touching each other) to walking away from this insane woman forever.
 
Indeed, that is wise advice. But it's hard to do. Because, you know, when it's good, it's good.

Until then, here is the devel/binutils insanity, if the website will allow me to post so much text:

(No, it didn't. I put it on my website at http://m5.chicago.il.us/gccbuild.txt).

As you can see from the above, the pkg command states that devel/binutils has been updated to its most recent version. But when I try to build lang/gcc, the insane woman insists that binutils-2.40_4,1 must be updated to binutils-2.40_5,1. This creature has multiple personalities, and the multiple personalities are not in agreement with each other. That would not be so bad, except that the update attempt fails. Let us zero in on the error message:

Code:
libtool: link: cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I/usr/local/include -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing -Wl,--undefined-version -o .libs/sysdump sysdump.o bucomm.o version.o filemode.o /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib  ../bfd/.libs/libbfd.so -L/usr/ports/devel/binutils/work-native/binutils-2.40/bfd/../libiberty/pic -L/usr/local/lib /usr/ports/devel/binutils/work-native/binutils-2.40/libsframe/.libs/libsframe.so ../libiberty/libiberty.a -liberty -lz -lzstd -Wl,-rpath -Wl,/usr/local/lib 
mv -f .deps/readelf.Tpo .deps/readelf.Po 
/bin/sh ./libtool  --tag=CC   --mode=link cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow  -I/usr/local/include -O2 -pipe  -isystem /usr/local/include -fno-strict-aliasing       -Wl,--undefined-version  -o readelf readelf.o version.o unwind-ia64.o dwarf.o demanguse.o elfcomm.o ../libctf/libctf-nobfd.la /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib ../libiberty/libiberty.a -lz -L/usr/local/lib -lzstd   ../libsframe/libsframe.la -L/usr/local/lib 
libtool: link: cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I/usr/local/include -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing -Wl,--undefined-version -o .libs/readelf readelf.o version.o unwind-ia64.o dwarf.o demanguse.o elfcomm.o /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib  ../libctf/.libs/libctf-nobfd.so -L/usr/ports/devel/binutils/work-native/binutils-2.40/libctf/../libiberty/pic -L/usr/local/lib ../libiberty/libiberty.a -lzstd ../libsframe/.libs/libsframe.so -liberty -lz -Wl,-rpath -Wl,/usr/local/lib 
gmake[4]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.40/binutils' 
gmake[3]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.40/binutils' 
gmake[2]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.40/binutils' 
gmake[1]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.40' 
gmake: *** [Makefile:1004: all] Error 2 
===> Compilation failed unexpectedly. 
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to 
the maintainer. 
*** Error code 1 
 
Stop. 
make[1]: stopped in /usr/ports/devel/binutils 
*** Error code 1 
 
Stop. 
make: stopped in /usr/ports/devel/binutils 
 
===>>> make build failed for devel/binutils@native 
===>>> Aborting update 
 
===>>> Update for binutils-2.40_4,1 failed 
===>>> Aborting update 
 
===>>> Update for lang/gcc13 failed 
===>>> Aborting update 
 
 
===>>> You can restart from the point of failure with this command line: 
       portmaster <flags> lang/gcc lang/gcc13 devel/binutils@native  
 
This command has been saved to ~/portmasterfail.txt 
 
1632.410u 129.246s 12:40.54 231.6%    75341+1076k 1222+160432io 45pf+0w 
root@landru:/usr/ports #

So this computer is complaining about something, but refuses to tell us what she is complaining about; she just says "Error 2". I did re-run the command with MAKE_JOBS_UNSAFE=yes but this is, first of all, totally bogus (the only way to build a program is to tell make to ignore failed commands?), and, second of all, the build fails further on anyway, because at some point a file indirectly tries to include __string/char_traits.h which does not exist -- which is the reason why I was trying to build lang/gcc in the first place.

As always, thank you in advance for any and all replies.
 
This creature has multiple personalities, and the multiple personalities are not in agreement with each other.
You are mixing binary packages and ports which is not recommended because you end up in a tangled mess like this.

Choose one or the other.

I think there are a couple of situations where you do have to mix them so it's not an absolute rule, but otherwise choose one or the other - binary packages are the easier option.
 
I don't know whether I follow the latest ports or the quarterly ports.
See /etc/pkg/FreeBSD.conf for packages and /usr/ports/.git/HEAD for Git and the ports. It works best when both point to the same branch...

I picked up the version from latest (will soon be part of 2024Q2) and that version builds nicely too. The files are build/copied from source dir /usr/ports/devel/gettext-runtime/work/gettext-0.22.3/gettext-runtime/libasprintf. Next, they're installed to the dir where the installer later expects them. Here a few relevant lines from the output I got from make:
Code:
Making install in libasprintf
/usr/bin/make  install-recursive
Making install in gnulib-lib
/usr/bin/make  install-recursive
 /bin/mkdir -p '/usr/ports/devel/gettext-runtime/work/stage/usr/local/lib'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c -s  libasprintf.la '/usr/ports/devel/gettext-runtime/work/stage/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libasprintf.so.0.0.0 /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.so.0.0.0
libtool: install: strip --strip-unneeded /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.so.0.0.0
libtool: install: (cd /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib && { ln -s -f libasprintf.so.0.0.0 libasprintf.so.0 || { rm -f libasprintf.so.0 && ln -s libasprintf.so.0.0.0 libasprintf.so.0; }; })
libtool: install: (cd /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib && { ln -s -f libasprintf.so.0.0.0 libasprintf.so || { rm -f libasprintf.so && ln -s libasprintf.so.0.0.0 libasprintf.so; }; })
libtool: install: /usr/bin/install -c .libs/libasprintf.lai /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.la
libtool: install: /usr/bin/install -c .libs/libasprintf.a /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.a
libtool: install: strip --strip-debug /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.a
libtool: install: chmod 644 /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.a
libtool: install: ranlib /usr/ports/devel/gettext-runtime/work/stage/usr/local/lib/libasprintf.a

This part is missing in the output that you sent. That may have to do with portmaster filtering output. Can you try again with a single make in dir /usr/ports/devel/gettext-runtime to see if that library gets build at all?
 
I think the easier way to install should be first install all packages you need, installing the binaries. Then, you configure poudriere (I tried portmaster before, but poudriere is the best), delete all binaries packages and install your compiled packages from your repository ... I was able to compile everything, without any problems, I even compiled Chromium, Firefox, with LTO flag enabled. You will take some time until you configure poudriere, but, since its done, I don't think you will have this kind of problems you have now.
 
Back
Top