Apparently the package builds files but is not able to find them later. It builds fine on all my Gentoo systems, except the one that uses Gentoo-prefix. Reproducible: Always
Created attachment 861583 [details] build.log of media-gfx/graphviz-8.0.3:0 Compressed because it exceeds 1000 KB
Also reported upstream, in case they have any suggestions → https://gitlab.com/graphviz/graphviz/-/issues/2401
Created attachment 861772 [details, diff] proposed patch This error happens because the ebuild does not run configure with --with-expatlibdir, and the graphviz configure script defaults to /usr/lib64, and then adds -L/usr/lib64 to basically every link command with disastrous results. I don't know why the configure script uses hardcoded paths like this but the solution on the ebuild side seems simple: just pass an appropriate --with-expatlibdir to the configure script. As a workaround, you can use EXTRA_ECONF="--with-expatlibdir='\${libdir}'"
Created attachment 861774 [details, diff] proposed patch v2 v2 patch: - Set EXPAT_CONFIG to the absolute filename of a program that produces no output. This will prevent the configure script from finding any expat-config program from the host bin directories (if it does find such a program, the configure script will run it and possibly add more bogus compiler flags). - Using --with-expatlibdir='${libdir}' works, and is expanded properly in the makefile, but the configure script runs its link test using a literal, unexpanded '-L${libdir}'. This is a minor issue since the GNU linker just ignores -L options that refer to nonexistent directories and it picks up libexpat from the default search path. Expand this in the ebuild instead.
Created attachment 861778 [details] build log after patch proposal v2 Thank you for the patch proposal. I tried it out but sadly it didn't work :(
Try my patch from https://gitlab.com/graphviz/graphviz/-/merge_requests/3244 (that also adds -lexpat for the libcommon target). Don't forget to add an eautoreconf call in src_prepare.
Sadly that did not work, attaching the build log and some shell commands showing the userpatch and the edit to the ebuild.
Created attachment 863836 [details] build.log after upstream patch 3244 Build log after Soap's patch
Created attachment 863837 [details] debug.log after upstream patch 3244 Debug log after Soap's patch
(In reply to Horea Christian from comment #8) > Created attachment 863836 [details] > build.log after upstream patch 3244 > > Build log after Soap's patch From this log: /home/chymera/gentoo/var/tmp/portage/media-gfx/graphviz-8.0.5/temp/environment: line 2054: eautoreconf: command not found [...] Looks like you've pooched your ebuild modifications (forgot to inherit autotools?)
This is caused by https://bugs.gentoo.org/892549, not an upstream bug
(In reply to Yiyang Wu from comment #11) > This is caused by https://bugs.gentoo.org/892549, not an upstream bug As a temporary workaround, try using linker other than ld.bfd, like gold/lld/mold, by specifying something like `LDFLAGS="-fuse-ld=mold"`
The problem is that the sysroot is being prepended to the runpath entries. > [pid 16697] openat(AT_FDCWD, "/mnt/tmp/myprefix/var/tmp/portage/media-gfx/graphviz-9.0.0/work/graphviz-9.0.0/lib/xdot/.libs/libxdot.so.4", O_RDONLY) = -1 ENOENT (No such file or directory) That is very frustrating after I thought we'd finally cracked such issues. The runtime linker presumably doesn't do this. I'll look into patching binutils again.
Created attachment 873197 [details, diff] Proposed binutils patch This proposed binutils patch fixes it. Please give it a try. It checks with the sysroot (like before), then failing that, without the sysroot. Depending on the path, the sysroot may or may not be appropriate, so without making it too clever or Gentoo-specific, we have to check both. This also fixes the cross-prefix case where the path involved really is outside the sysroot. When it's inside, there is no clean solution. Maybe we can get away without fixing that case, as -L flags probably cover it, but it's hard to say for sure.
*** Bug 949393 has been marked as a duplicate of this bug. ***
I don't know what the exact state here, since there was no update since late '23, but the other day I noticed media-gfx/graphviz is still broken on prefix. When emerging media-gfx/graphviz it inevitably fails because during linking of the `dot` executable it doesn't find certain libraries that are also part of the same build - part of graphviz. Here is the last steps before failure: make[3]: Entering directory '/home/share/gentoo/var/tmp/portage/media-gfx/graphviz-12.2.1-r1/work/graphviz-12.2.1/cmd/dot' x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -I../../lib/common -I../../lib/gvc -I../../lib/pathplan -I../../lib/cgraph -I../../lib/cdt -DDEMAND_LOADING=1 -O2 -pipe -O3 -pipe -march=tigerlake -mtune=tigerlake -Wall -Wextra -Wmissing-include-dirs -Wswitch-default -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wtrampolines -Wlogical-op -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -c -o dot-dot.o `test -f 'dot.c' || echo './'`dot.c x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -I../../lib/common -I../../lib/gvc -I../../lib/pathplan -I../../lib/cgraph -I../../lib/cdt -DDEMAND_LOADING=1 -O2 -pipe -O3 -pipe -march=tigerlake -mtune=tigerlake -Wall -Wextra -Wmissing-include-dirs -Wswitch-default -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wtrampolines -Wlogical-op -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -c -o dot-no_builtins.o `test -f 'no_builtins.c' || echo './'`no_builtins.c /home/share/gentoo/bin/bash ../../libtool --tag=CC --mode=link x86_64-pc-linux-gnu-gcc -O2 -pipe -O3 -pipe -march=tigerlake -mtune=tigerlake -Wall -Wextra -Wmissing-include-dirs -Wswitch-default -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wtrampolines -Wlogical-op -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -Wl,-O1 -Wl,--as-needed -o dot dot-dot.o dot-no_builtins.o ../../lib/gvc/libgvc.la ../../lib/cgraph/libcgraph.la libtool: link: x86_64-pc-linux-gnu-gcc -O2 -pipe -O3 -pipe -march=tigerlake -mtune=tigerlake -Wall -Wextra -Wmissing-include-dirs -Wswitch-default -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wtrampolines -Wlogical-op -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -Wl,-O1 -o .libs/dot dot-dot.o dot-no_builtins.o -Wl,--as-needed ../../lib/gvc/.libs/libgvc.so ../../lib/cgraph/.libs/libcgraph.so -Wl,-rpath -Wl,/home/share/gentoo/usr/lib64 /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libxdot.so.4, needed by ../../lib/gvc/.libs/libgvc.so, not found (try using -rpath or -rpath-link) /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libpathplan.so.4, needed by ../../lib/gvc/.libs/libgvc.so, not found (try using -rpath or -rpath-link) /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libcdt.so.5, needed by ../../lib/gvc/.libs/libgvc.so, not found (try using -rpath or -rpath-link) /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `dtflatten' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/cgraph/.libs/libcgraph.so: undefined reference to `dtrestore' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/cgraph/.libs/libcgraph.so: undefined reference to `dtextract' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/cgraph/.libs/libcgraph.so: undefined reference to `dtdisc' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `dtclose' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `Dttree' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `freePath' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/cgraph/.libs/libcgraph.so: undefined reference to `dtview' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `Dtobag' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `make_polyline' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `Pshortestpath' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `parseXDotF' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `freeXDot' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `Proutespline' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `Dtoset' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `dtsize' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/cgraph/.libs/libcgraph.so: undefined reference to `dtrenew' /home/share/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `dtopen' collect2: error: ld returned 1 exit status make[3]: *** [Makefile:757: dot] Error 1 make[3]: Leaving directory '/home/share/gentoo/var/tmp/portage/media-gfx/graphviz-12.2.1-r1/work/graphviz-12.2.1/cmd/dot' make[2]: *** [Makefile:536: all-recursive] Error 1 make[2]: Leaving directory '/home/share/gentoo/var/tmp/portage/media-gfx/graphviz-12.2.1-r1/work/graphviz-12.2.1/cmd' make[1]: *** [Makefile:751: all-recursive] Error 1 make[1]: Leaving directory '/home/share/gentoo/var/tmp/portage/media-gfx/graphviz-12.2.1-r1/work/graphviz-12.2.1' make: *** [Makefile:582: all] Error 2 Key Points are: ../x86_64-pc-linux-gnu/bin/ld: warning: libxdot.so.4, needed by ../../lib/gvc/.libs/libgvc.so, not found (try using -rpath or -rpath-link) ../x86_64-pc-linux-gnu/bin/ld: warning: libpathplan.so.4, needed by ../../lib/gvc/.libs/libgvc.so, not found (try using -rpath or -rpath-link) ../x86_64-pc-linux-gnu/bin/ld: warning: libcdt.so.5, needed by ../../lib/gvc/.libs/libgvc.so, not found (try using -rpath or -rpath-link) ../x86_64-pc-linux-gnu/bin/ld: ../../lib/gvc/.libs/libgvc.so: undefined reference to `dtflatten' ../x86_64-pc-linux-gnu/bin/ld: ../../lib/cgraph/.libs/libcgraph.so: undefined reference to `dtrestore' I should link to some libs that were also part of the build, but doesn't find them.
Is there anything up-to-date I can help with testing on my setup?
I was kinda waiting for feedback on the above patch, but then I forgot about it. I'm not sure that your latest errors are the same issue. I intend to spend more time on prefix soon, so I'll give this another look before long.
(In reply to James Le Cuirot from comment #18) > I was kinda waiting for feedback on the above patch, but then I forgot about > it. I'm not sure that your latest errors are the same issue. I didn't look like it from the logs I've seen, hence why I opened an extra bug: https://bugs.gentoo.org/949393, but it was closed as dup of this. There is some more infos over there as attachment. Full logs and such.
(In reply to Benjamin Block from comment #19) > (In reply to James Le Cuirot from comment #18) > > I was kinda waiting for feedback on the above patch, but then I forgot about > > it. I'm not sure that your latest errors are the same issue. > > I didn't look like it from the logs I've seen, hence why I opened an extra > bug: https://bugs.gentoo.org/949393, but it was closed as dup of this. There > is some more infos over there as attachment. Full logs and such. I still suspect it is, but FWIW, you should note that you've seen the other bug and you think it's different because XYZ if you're doing it deliberately, otherwise it just looks like an accident.
(In reply to Sam James from comment #20) > you should note that you've seen the other > bug and you think it's different because XYZ if you're doing it > deliberately, otherwise it just looks like an accident. Fair enough. Let's just leave it like it is for the moment.