GNOME Bugzilla – Bug 644896
gnucash-2.4.4: parallel "make install" fails from time to time
Last modified: 2018-06-29 22:55:00 UTC
As reported in: http://bugs.gentoo.org/show_bug.cgi?id=359123 and also experienced by me, from time to time "make install" fails when using MAKEOPTS > -j1 with this error: libtool: install: (cd /var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/src/backend/xml; /bin/sh /var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/libtool --tag CC --mode=relink x86_64-pc-linux-gnu-gcc -Wdeclaration-after-statement -march=core2 -pipe -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -Wl,-O1 -Wl,--as-needed -g -o libgnc-backend-xml-utils.la -rpath /usr/lib64 gnc-account-xml-v2.lo gnc-address-xml-v2.lo gnc-bill-term-xml-v2.lo gnc-book-xml-v2.lo gnc-budget-xml-v2.lo gnc-commodity-xml-v2.lo gnc-customer-xml-v2.lo gnc-employee-xml-v2.lo gnc-entry-xml-v2.lo gnc-freqspec-xml-v2.lo gnc-invoice-xml-v2.lo gnc-job-xml-v2.lo gnc-lot-xml-v2.lo gnc-order-xml-v2.lo gnc-owner-xml-v2.lo gnc-pricedb-xml-v2.lo gnc-recurrence-xml-v2.lo gnc-schedxaction-xml-v2.lo gnc-tax-table-xml-v2.lo gnc-transaction-xml-v2.lo gnc-vendor-xml-v2.lo io-example-account.lo io-gncxml-gen.lo io-gncxml-v1.lo io-gncxml-v2.lo io-utils.lo sixtp-dom-generators.lo sixtp-dom-parsers.lo sixtp-stack.lo sixtp-to-dom-parser.lo sixtp-utils.lo sixtp.lo -pthread -Wl,--export-dynamic -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lglib-2.0 -lgconf-2 -lglib-2.0 -lxml2 -lz ../../../src/engine/libgncmod-engine.la ../../../src/core-utils/libgnc-core-utils.la ../../../src/libqof/qof/libgnc-qof.la -lm -lm -inst-prefix-dir /var/tmp/portage/app-office/gnucash-2.4.4/image/) libtool: install: (cd /var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/src/backend/xml; /bin/sh /var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/libtool --tag CC --mode=relink x86_64-pc-linux-gnu-gcc -Wdeclaration-after-statement -march=core2 -pipe -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -module -avoid-version -Wl,-O1 -Wl,--as-needed -g -o libgncmod-backend-xml.la -rpath /usr/lib64/gnucash gnc-backend-xml.lo -pthread -Wl,--export-dynamic -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lglib-2.0 -lgconf-2 -lglib-2.0 -lxml2 -lz ../../../src/engine/libgncmod-engine.la ../../../src/core-utils/libgnc-core-utils.la libgnc-backend-xml-utils.la ../../../src/libqof/qof/libgnc-qof.la -lm -lm -inst-prefix-dir /var/tmp/portage/app-office/gnucash-2.4.4/image/) libtool: relink: x86_64-pc-linux-gnu-gcc -shared .libs/gnc-backend-xml.o -Wl,-rpath -Wl,/usr/lib64/gnucash -Wl,--as-needed -L/var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64 -L/usr/lib64 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lgconf-2 -lglib-2.0 -lxml2 -lz -L/var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64/gnucash -L/usr/lib64/gnucash -lgncmod-engine -lgnc-core-utils -lgnc-backend-xml-utils -lgnc-qof -lm -march=core2 -Wl,-O1 -pthread -Wl,--export-dynamic -pthread -Wl,-soname -Wl,libgncmod-backend-xml.so -o .libs/libgncmod-backend-xml.so libtool: relink: x86_64-pc-linux-gnu-gcc -shared .libs/gnc-account-xml-v2.o .libs/gnc-address-xml-v2.o .libs/gnc-bill-term-xml-v2.o .libs/gnc-book-xml-v2.o .libs/gnc-budget-xml-v2.o .libs/gnc-commodity-xml-v2.o .libs/gnc-customer-xml-v2.o .libs/gnc-employee-xml-v2.o .libs/gnc-entry-xml-v2.o .libs/gnc-freqspec-xml-v2.o .libs/gnc-invoice-xml-v2.o .libs/gnc-job-xml-v2.o .libs/gnc-lot-xml-v2.o .libs/gnc-order-xml-v2.o .libs/gnc-owner-xml-v2.o .libs/gnc-pricedb-xml-v2.o .libs/gnc-recurrence-xml-v2.o .libs/gnc-schedxaction-xml-v2.o .libs/gnc-tax-table-xml-v2.o .libs/gnc-transaction-xml-v2.o .libs/gnc-vendor-xml-v2.o .libs/io-example-account.o .libs/io-gncxml-gen.o .libs/io-gncxml-v1.o .libs/io-gncxml-v2.o .libs/io-utils.o .libs/sixtp-dom-generators.o .libs/sixtp-dom-parsers.o .libs/sixtp-stack.o .libs/sixtp-to-dom-parser.o .libs/sixtp-utils.o .libs/sixtp.o -Wl,-rpath -Wl,/usr/lib64/gnucash -Wl,--as-needed -L/var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64 -L/usr/lib64 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lgconf-2 -lglib-2.0 -lxml2 -lz -L/var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64/gnucash -L/usr/lib64/gnucash -lgncmod-engine -lgnc-core-utils -lgnc-qof -lm -march=core2 -Wl,-O1 -pthread -Wl,--export-dynamic -pthread -Wl,-soname -Wl,libgnc-backend-xml-utils.so.0 -o .libs/libgnc-backend-xml-utils.so.0.0.0 /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lgnc-backend-xml-utils collect2: ld returned 1 exit status libtool: install: error: relink `libgncmod-backend-xml.la' with the above command before installing it make[5]: *** [install-pkglibLTLIBRARIES] Error 1 make[5]: *** Waiting for unfinished jobs.... libtool: install: /usr/bin/install -c .libs/libgnc-backend-xml-utils.so.0.0.0T /var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64/libgnc-backend-xml-utils.so.0.0.0 libtool: install: (cd /var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64 && { ln -s -f libgnc-backend-xml-utils.so.0.0.0 libgnc-backend-xml-utils.so.0 || { rm -f libgnc-backend-xml-utils.so.0 && ln -s libgnc-backend-xml-utils.so.0.0.0 libgnc-backend-xml-utils.so.0; }; }) libtool: install: (cd /var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64 && { ln -s -f libgnc-backend-xml-utils.so.0.0.0 libgnc-backend-xml-utils.so || { rm -f libgnc-backend-xml-utils.so && ln -s libgnc-backend-xml-utils.so.0.0.0 libgnc-backend-xml-utils.so; }; }) libtool: install: /usr/bin/install -c .libs/libgnc-backend-xml-utils.lai /var/tmp/portage/app-office/gnucash-2.4.4/image//usr/lib64/libgnc-backend-xml-utils.la libtool: install: warning: remember to run `libtool --finish /usr/lib64' make[5]: Leaving directory `/var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/src/backend/xml' make[4]: *** [install-am] Error 2 make[4]: Leaving directory `/var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/src/backend/xml' make[3]: *** [install-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/src/backend/xml' make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/src/backend' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/app-office/gnucash-2.4.4/work/gnucash-2.4.4/src' make: *** [install-recursive] Error 1 Thanks for your help
Created attachment 183503 [details] build.log.zip
I would never recommend "make install" with -j larger than one, because I don't know any precautions that ensure to keep the correct inter-dependencies while installing. Does automake explicitly allow -j with the install target? I doubt it, but feel free to give us some pointers where the necessary dependency rules in the makefiles are explained.
I have asked in upstream and looks like it is supported: http://lists.gnu.org/archive/html/libtool/2011-03/msg00002.html But, as you suspected, there is a bug in libtool: http://lists.gnu.org/archive/html/libtool/2011-03/msg00003.html A workaround is commented here: http://lists.gnu.org/archive/html/libtool/2011-03/msg00004.html
The workaround says: > It seems that make is running install-libLTLIBRARIES and > install-pkglibLTLIBRARIES in parallel. Each one of these these rules > installs the libraries serially in a loop. However, if libtool is > relinking the libraries, it really needs to wait until the > prerequisite libraries from _other_ rules are installed. > > Yes, it's a bug in Automake/Libtool, but the workaround isn't quite > correct: you'd need something like > > install-pkglibLTLIBRARIES = install-pkglibLTLIBRARIES > $(install-pkglibLTLIBRARIES): install-libLTLIBRARIES @Pacho: Should those two lines go into the Makefile.am?
As read in: http://lists.gnu.org/archive/html/libtool/2011-03/msg00008.html Looks like this should be added to the generated Makefile as the bug looks to be in Makefile generation, the problem is that I don't know how this could be done in a cleaner way :-(
Well, we could just say "we don't support make -j" and move on. ;)
You open the doors for hiding more bugs like this. Just say there is a known bug in libtool and close this when it is solved there. At least other distros can find this bug report and know what to do accordingly.
Just joking. If someone proposes a patch for our Makefile.am (which looks somewhat sane) we will of course apply them over here. No problem. I just don't know what the libtool people expect from our Makefile.am.
This is the upstream bug (not sure how to subscribe to it :-( ) http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328
Possible workaround until bug is fixed: http://www.mail-archive.com/libtool@gnu.org/msg12653.html
This is the "possible workaround": > What they can do is split the libgnc-backend-xml-utils.la into it's > own separate subdirectory so that the make rules don't get mixed up > with the libgncmod-backend-xml.la ones. Kludgy, but it would work. I'm afraid we don't feel like re-organizing our directory structure just because of this libtool/automake issue. I guess this qualifies this bug as WONTFIX or NOTGNOME and we simply confirm "-j" is not supported during "make install" for this package. Sorry for that.
I looked at this for some time but didn't find a way to cleanly insert the workaround mentioned in comment 4 into the generated Makefile. Adding it to Makefile.am causes automake to fail. I agree with Christian that re-organizing our directory structure at this point is more work than it benefits so I'll close this bug now.
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=644896. Please update any external references or bookmarks.