cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
79 stars 26 forks source link

sci-mathematics/gap-core-4.11.1 fails to build due to libtool mismatch error #690

Closed derekperrin closed 2 years ago

derekperrin commented 2 years ago

I'm following the directions for installing sage using emerge -av @sagemath and running into problems when trying to emerge gap-core. I think the relevant lines of the build log are:

libtool: Version mismatch error.  This is libtool 2.4.7, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.7
libtool: and run autoconf again.
make: *** [Makefile.rules:354: obj/src/ariths.lo] Error 63
make: *** Waiting for unfinished jobs....
libtool: Version mismatch error.  This is libtool 2.4.7, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.7
libtool: and run autoconf again.
/bin/sh ./libtool --mode=compile --tag CC x86_64-pc-linux-gnu-gcc  -MQ "obj/src/bool.lo" -MMD -MP -MF "obj/src/.deps/bool.d" -march=ivybridge -O2 -pipe -fno-strict-aliasing -Wall -Wextra -Warray-bounds -Wno-cast-function-type -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self -Wno-inline -Wlogical-op -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wno-pragmas -Wpacked -Wpointer-arith -Wredundant-decls -Wrestrict -Wreturn-type -Wshadow -Wno-sign-compare -Wstrict-aliasing -Wundef -Wunused-but-set-variable -Wno-unused-parameter -Wwrite-strings -Wno-implicit-fallthrough -Wimplicit-function-declaration -Wjump-misses-init -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wno-error=cast-function-type -Wno-error=inline -Wno-error=pragmas -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=implicit-fallthrough -I./gen -I./src -DHAVE_CONFIG_H        -c src/bool.c -o obj/src/bool.lo
make: *** [Makefile.rules:355: obj/src/blister.lo] Error 63
libtool: Version mismatch error.  This is libtool 2.4.7, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.7
libtool: and run autoconf again.
make: *** [Makefile.rules:355: obj/src/bags.lo] Error 63
libtool: Version mismatch error.  This is libtool 2.4.7, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.7
libtool: and run autoconf again.
make: *** [Makefile.rules:355: obj/src/bool.lo] Error 63
kiwifb commented 2 years ago

That's an interesting log from a QA point of view and I should address those libtool messages. However, I think the warnings are harmless (for now) and the real error should be earlier in the logs.

I will see if I can see something locally. But could you provide 1) more of the log 2) emerge --info gap-core

derekperrin commented 2 years ago

Sure thing. They're both attached.

gap-core-emerge-info.txt build.log

kiwifb commented 2 years ago

OK, I didn't realize it would be this short. Quite brutal in fact and it make the new libtool the obvious suspect.

derekperrin commented 2 years ago

Does the required libtool version just need to be updated in an ebuild?

kiwifb commented 2 years ago

You should not, it is supposed to be part of @system or some other set. But I am thinking the autotool eclass may be doing stuff on the basis of libtool 2.4.6. If you look at the sources of gap there is nothing about libtool version in LT_INIT, just a pre-requisite of it being at least 2.4.2 in a separate declaration. But after running src_prepare you get a new m4 folder and there you have m4/ltversion.m4 which does embed the version of libtool. And this file is included in aclocal.m4. So, somehow, even so you have libtool 2.4.7 installed, eautoreconf in src_prepare did set version 2.4.6. I need to get to the bottom of this.

Can you double check the file /var/tmp/portage/sci-mathematics/gap-core-4.11.1/work/gap-4.11.1/m4/ltversion.m4 and see if it says 2.4.6 on your system?

derekperrin commented 2 years ago

Looks like it says 2.4.7. Here are the contents of that file


m4_define([LT_PACKAGE_REVISION], [2.4.7])

AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.7'
macro_revision='2.4.7'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])```
kiwifb commented 2 years ago

OK, it is a relief. Then there must be some syntax/options that screams 2.4.6 and are not forward compatible. I need to find the release notes for 2.4.7. But the autotool eclass has a number of patches that it applies for libtool 2.4.6, it may need new patches for 2.4.7.

kiwifb commented 2 years ago

I think I found where the stuff is coming from. I misread the content of aclocal.m4 and it will need to be touched. I have to collect kids from school. I will update this ticket ASAP.

kiwifb commented 2 years ago

Technically a very small change to an existing patch is all that is needed but just to be safe, I am going to also force regeneration of aclocal.m4. I'll push to master shortly.

kiwifb commented 2 years ago

Ready to be tested. Here is the story, a patch originally from the science overlay defined AC_CONFIG_MACRO_DIR to m4. And when eautoreconf is run, libtool macros are installed there. But upstream already has a macro directory at cnf/m4 and aclocal.m4 was built to include macros from that directory - including the libtool ones. Upstream ships with libtool 2.4.6 macros in cnf/m4 and that's where that version was coming from.

By changing AC_CONFIG_MACRO_DIR to cnf/m4, eautoreconf now copy its fresh libtool macros in that directory. So now aclocal.m4 finds fresh libtool macros. But just to make sure nothing is amiss I also force its regeneration too.

derekperrin commented 2 years ago

gap-core seems to have emerged just fine. Thanks for all of your work on this project; I really rely on it and you've saved me a few times. If you're still at UC, shoot me an email or come find me and I'll treat you to a meal and pick your brain about Gentoo stuff :)

kiwifb commented 2 years ago

Still at UC, although I interviewed for a position in Landcare this morning which would return me to active service at NeSI. That's if I get it and we would likely talk about leaving UC in June/July. Which department are you based in?

derekperrin commented 2 years ago

Best of luck on getting the new position!

I’m a PhD student in the maths department. I just arrived here from Canada a few weeks ago (so don’t really know anyone or what NeSi is), but I’ve been using this overlay for a few years now.