app-office/gnucash-5.8-r100 tries to build against installed version libraries: > FAILED: lib64/guile/3.0/site-ccache/gnucash/engine/business-core.go /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/engine/business-core.go > cd /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile && /usr/bin/cmake -E env LD_LIBRARY_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64:/var/tmp/portage/app-office/gn > ucash-5.8-r100/work/gnucash-5.8_build/lib64/gnucash: GNC_UNINSTALLED=YES GNC_BUILDDIR=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build GUILE_LOAD_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8 > /bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile/deprecated:/var/tmp/portage/app-office/gnucash-5. > 8-r100/work/gnucash-5.8_build/share/guile/site/3.0 GUILE_LOAD_COMPILED_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib6 > 4/guile/3.0/site-ccache:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/deprecated GNC_MODULE_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64:/v > ar/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/gnucash: /usr/bin/guile-3.0 -e "(@@ (guild) main)" -s /usr/bin/guild-3.0 compile -o /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/g > uile/3.0/site-ccache/gnucash/engine/business-core.go /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile/business-core.scm > Backtrace: > In ice-9/eval.scm: > 155:9 19 (_ _) > In srfi/srfi-1.scm: > 634:9 18 (for-each #<procedure 7f24456b3280 at scripts/compile.scm:276:14 (file)> ("/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile/business-core.scm")) > In scripts/compile.scm: > 279:27 17 (_ _) > In system/base/target.scm: > 82:6 16 (with-target _ _) > In system/base/compile.scm: > 187:6 15 (compile-file "/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile/business-core.scm" #:output-file _ #:from _ #:to _ #:env _ #:optimization-level _ #:warning-level _ #:opts _ #:canonicalizatio > n _) > 53:4 14 (call-with-output-file/atomic _ _ _) > In ice-9/boot-9.scm: > 1755:12 13 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) > In system/base/compile.scm: > 69:11 12 (_) > 190:11 11 (_ #<closed: file 7f2445e1ad90>) > 331:39 10 (read-and-compile #<input: business-core.scm 13> #:from _ #:to _ #:env _ #:optimization-level _ #:warning-level _ #:opts _) > 261:27 9 (_ _ _) > In ice-9/boot-9.scm: > 2858:4 8 (save-module-excursion #<procedure 7f244576bae0 at language/scheme/compile-tree-il.scm:29:3 ()>) > In language/scheme/compile-tree-il.scm: > 31:16 7 (_) > In ice-9/psyntax.scm: > 1243:36 6 (expand-top-sequence (#<syntax:business-core.scm:22:0 (#<syntax:business-core.scm:22:1 eval-when> #<syntax:business-core.scm:22:11 (#<syntax:business-core.scm:22:12 compile> #<syntax:business-core.scm:22:20 load> #<syntax:business-core.scm:22:25 eval> #<syntax:business-core.scm:22:30 expand>)> #<syntax:business-core.scm:23:2 (#<syntax:business-core.scm:23:3 load-extension> #<syntax:business-core.scm:23:18 "libgnucash-guile"> #<syntax:business-core.scm:23:37 "gnc_guile_bindings…>) …) > 1235:19 5 (parse _ (("placeholder" placeholder)) ((top) #(ribcage () () ())) _ c (compile load eval) (hygiene gnucash engine business-core)) > 259:10 4 (parse _ (("placeholder" placeholder)) ((top) #(ribcage () () ())) _ c&e (compile load) (hygiene gnucash engine business-core)) > In unknown file: > 3 (load-extension "libgnucash-guile" "gnc_guile_bindings_init") > In system/foreign-library.scm: > 190:25 2 (load-foreign-library _ #:extensions _ #:search-ltdl-library-path? _ #:search-path _ #:search-system-paths? _ #:lazy? _ #:global? _ #:rename-on-cygwin? _) > In unknown file: > 1 (dlopen "/usr/lib64/libgnucash-guile.so" 1) > In ice-9/boot-9.scm: > 1676:22 0 (raise-exception _ #:continuable? _) > > ice-9/boot-9.scm:1676:22: In procedure raise-exception: > In procedure dlopen: file "/usr/lib64/libgnucash-guile.so", message "/usr/lib64/libgnucash-guile.so: undefined symbol: xaccSplitsBeginStagedTransactionTraversals" When I deleted /usr/lib64/libgnucash-guile.so then it complained about /usr/lib64/libgnc-gnome.so. I had to delete /usr/lib64/libgnc-* to make the gnucash package build successfully. It looks like similar problem already happened in the past: bug #359033
I am getting compile error as well with: app-office/gnucash-5.8-r100::gentoo failed FAILED: lib64/guile/3.0/site-ccache/gnucash/engine/business-core.go /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/engine/business-core.go cd /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile && /usr/bin/cmake -E env LD_LIBRARY_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/gnucash: GNC_UNINSTALLED=YES GNC_BUILDDIR=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build GUILE_LOAD_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile/deprecated:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/share/guile/site/3.0 GUILE_LOAD_COMPILED_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/deprecated GNC_MODULE_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/gnucash: /usr/bin/guile-3.0 -e "(@@ (guild) main)" -s /usr/bin/guild-3.0 compile -o /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/engine/business-core.go /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile/business-core.scm Backtrace: In ice-9/eval.scm: 155:9 19 (_ _) In srfi/srfi-1.scm: 634:9 18 (for-each #<procedure 7efc4f93f280 at scripts/compile.scm:276:14 (file)> ("/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile/business-core.scm")) In scripts/compile.scm: 279:27 17 (_ _) In system/base/target.scm: 82:6 16 (with-target _ _) In system/base/compile.scm: 187:6 15 (compile-file "/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile/business-core.scm" #:output-file _ #:from _ #:to _ #:env _ #:optimization-level _ #:warning-level _ #:opts _ #:canonicalization _) 53:4 14 (call-with-output-file/atomic _ _ _) In ice-9/boot-9.scm: 1755:12 13 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In system/base/compile.scm: 69:11 12 (_) 190:11 11 (_ #<closed: file 7efc4f89dd90>) 331:39 10 (read-and-compile #<input: business-core.scm 13> #:from _ #:to _ #:env _ #:optimization-level _ #:warning-level _ #:opts _) 261:27 9 (_ _ _) In ice-9/boot-9.scm: 2858:4 8 (save-module-excursion #<procedure 7efc4f9fbfe0 at language/scheme/compile-tree-il.scm:29:3 ()>) In language/scheme/compile-tree-il.scm: 31:16 7 (_) In ice-9/psyntax.scm: 1243:36 6 (expand-top-sequence (#<syntax:business-core.scm:22:0 (#<syntax:business-core.scm:22:1 eval-when> #<syntax:business-core.scm:22:11 (#<syntax:business-core.scm:22:12 compile> #<syntax:business-core.scm:22:20 load> #<syntax:business-core.scm:22:25 eval> #<syntax:business-core.scm:22:30 expand>)> #<syntax:business-core.scm:23:2 (#<syntax:business-core.scm:23:3 load-extension> #<syntax:business-core.scm:23:18 "libgnucash-guile"> #<syntax:business-core.scm:23:37 "gnc_guile_bindings…>) …) 1235:19 5 (parse _ (("placeholder" placeholder)) ((top) #(ribcage () () ())) _ c (compile load eval) (hygiene gnucash engine business-core)) 259:10 4 (parse _ (("placeholder" placeholder)) ((top) #(ribcage () () ())) _ c&e (compile load) (hygiene gnucash engine business-core)) In unknown file: 3 (load-extension "libgnucash-guile" "gnc_guile_bindings_init") In system/foreign-library.scm: 190:25 2 (load-foreign-library _ #:extensions _ #:search-ltdl-library-path? _ #:search-path _ #:search-system-paths? _ #:lazy? _ #:global? _ #:rename-on-cygwin? _) In unknown file: 1 (dlopen "/usr/lib64/libgnucash-guile.so" 1) In ice-9/boot-9.scm: 1676:22 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1676:22: In procedure raise-exception: In procedure dlopen: file "/usr/lib64/libgnucash-guile.so", message "/usr/lib64/libgnucash-guile.so: undefined symbol: xaccSplitsBeginStagedTransactionTraversals" [359/786] cd /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/gnucash/gnome-utils && /usr/bin/swig -guile -Linkage module -I/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/common -I/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/libgnucash/engine -o /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/gnucash/gnome-utils/swig-gnome-utils.c /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/gnucash/gnome-utils/gnome-utils.i [360/786] : && /usr/bin/x86_64-pc-linux-gnu-gcc -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations -march=native -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -shared -Wl,-soname,libgnc-expressions-guile.so -o lib64/gnucash/libgnc-expressions-guile.so bindings/guile/CMakeFiles/gnc-expressions-guile.dir/swig-expressions-guile.c.o -Wl,-rpath,/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/gnucash:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64: lib64/gnucash/libgnc-expressions.so -L/usr/lib64 -lguile-3.0 -latomic_ops -lgc -lpthread -ldl lib64/libgnucash-guile.so lib64/libgnc-app-utils.so lib64/libgnc-engine.so -licui18n -licuuc -licudata -Wl,--export-dynamic -lgmodule-2.0 -pthread -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lxml2 -lxslt -lxml2 -lxslt -L/usr/lib64 -lguile-3.0 -latomic_ops -lgc -lpthread -ldl lib64/libgnc-core-utils.so /usr/lib64/libglib-2.0.so /usr/lib64/libboost_date_time.so.1.84.0 /usr/lib64/libboost_regex.so.1.84.0 /usr/lib64/libboost_filesystem.so.1.84.0 /usr/lib64/libboost_atomic.so.1.84.0 /usr/lib64/libboost_locale.so.1.84.0 /usr/lib64/libboost_chrono.so.1.84.0 /usr/lib64/libboost_thread.so.1.84.0 && : [361/786] cd /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile && /usr/bin/cmake -E env LD_LIBRARY_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/gnucash: GNC_UNINSTALLED=YES GNC_BUILDDIR=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build GUILE_LOAD_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile/deprecated:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/share/guile/site/3.0 GUILE_LOAD_COMPILED_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/bindings/guile:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/deprecated GNC_MODULE_PATH=/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64:/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/gnucash: /usr/bin/guile-3.0 -e "(@@ (guild) main)" -s /usr/bin/guild-3.0 compile -o /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/engine/gnc-numeric.go /var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8/bindings/guile/gnc-numeric.scm wrote `/var/tmp/portage/app-office/gnucash-5.8-r100/work/gnucash-5.8_build/lib64/guile/3.0/site-ccache/gnucash/engine/gnc-numeric.go' ninja: build stopped: subcommand failed. * ERROR: app-office/gnucash-5.8-r100::gentoo failed (compile phase): * ninja -v -j8 -l8 failed * * Call stack: * ebuild.sh, line 136: Called src_compile * environment, line 3581: Called cmake_src_compile * environment, line 1351: Called cmake_build * environment, line 1318: Called eninja * environment, line 1800: Called die * The specific snippet of code: * "$@" || die -n "${*} failed"
After restarting the system, the emerge "app-office/gnucash-5.8-r100" works without errors.
*** Bug 946927 has been marked as a duplicate of this bug. ***
I assumed the mess starts at https://github.com/Gnucash/gnucash/blob/6531d3e46b7bee1add61aa6c6aaf8fb1f889a586/libgnucash/gnc-module/gnc-module.c#L195. But your logs show that GNC_MODULE_PATH is set correctly to only the just-built gnucash. The mixing seems to just be with what it chooses to dlopen, so https://github.com/Gnucash/gnucash/blob/6531d3e46b7bee1add61aa6c6aaf8fb1f889a586/libgnucash/gnc-module/gnc-module.c#L245. I'm guessing that the use of g_module_open (https://github.com/Gnucash/gnucash/blob/6531d3e46b7bee1add61aa6c6aaf8fb1f889a586/libgnucash/gnc-module/gnc-module.c#L245) is the problem but not sure yet.
No, I'm wrong there (doubted myself). The question is why it gets the wrong path passed to begin with. gnc_module_system_search_dirs respects GNC_MODULE_PATH, but if it's unset, it uses DEFAULT_MODULE_PATH. so doesn't look like there. Going back to the log: > In system/foreign-library.scm: > 190:25 2 (load-foreign-library _ #:extensions _ #:search-ltdl-library-path? _ #:search-path _ #:search-system-paths? _ #:lazy? _ #:global? _ #:rename-on-cygwin? _) > In unknown file: > 1 (dlopen "/usr/lib64/libgnucash-guile.so" 1) > In ice-9/boot-9.scm: > 1676:22 0 (raise-exception _ #:continuable? _)
OK, I think it's actually guile's `load-extension` (https://www.gnu.org/software/guile/manual/html_node/Modules-and-Extensions.html) behaviour.
https://www.gnu.org/software/guile/manual/html_node/Environment-Variables.html#index-GUILE_005fLOAD_005fPATH makes me think that `...` should be at the end of the value the build system sets for GUILE_LOAD_PATH?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72dbf2ec4049df11ad63576971883ee239eadb7f commit 72dbf2ec4049df11ad63576971883ee239eadb7f Author: Sam James <sam@gentoo.org> AuthorDate: 2024-12-26 09:41:40 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-12-26 09:55:46 +0000 app-office/gnucash: don't use installed copy of gnucash for build or tests Per https://www.gnu.org/software/guile/manual/html_node/Foreign-Libraries.html, newer guile (>= 3.0.6) will respect GUILE_EXTENSIONS_PATH when looking up paths for `dlopen` for `load-extension` -> `load-foreign-library`. Older guiles will use `LTDL_LIBRARY_PATH` instead. Without this set, the system paths are checked instead (maybe falling back to another variable if not found on the system, unclear), and we end up with build failures when we try to mix system and just-built gnucash (this is also obviously a problem for testing as well). For tests, we additionally have to do a "fake install" in ${BUILD_DIR}/whatever and we set the path to that in the ebuild with GENTOO_TEMPORARY_TEST_INSTALLDIR. https://www.gnu.org/software/guile/manual/html_node/Load-Paths.html and https://www.gnu.org/software/guile/manual/html_node/Environment-Variables.html were also a lot of help. (When testing w/ guile-2.2 briefly, it didn't seem that we needed to set LTDL_LIBRARY_PATH, but someone can add that if it turns out to be needed, or I may later.) (With regard to GUILE_AUTO_COMPILE=0, dropped that as it doesn't seem necessary. Plan is to also add GUILE_AUTO_COMPILE=fresh to the eclass, am discussing it w/ Arsen.) Bug: https://bugs.gnucash.org/show_bug.cgi?id=799159 Bug: https://bugs.gentoo.org/359033 Bug: https://bugs.gentoo.org/371264 Bug: https://bugs.gentoo.org/734286 Bug: https://bugs.gentoo.org/946927 Closes: https://bugs.gentoo.org/941426 Signed-off-by: Sam James <sam@gentoo.org> .../files/gnucash-5.10-guile-load-path.patch | 96 ++++++++++++++++++++++ app-office/gnucash/gnucash-5.10.ebuild | 33 ++++++-- 2 files changed, 120 insertions(+), 9 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9c68d05e8fcaa3dd8be3a9b38b2070f3115dd7d commit c9c68d05e8fcaa3dd8be3a9b38b2070f3115dd7d Author: Sam James <sam@gentoo.org> AuthorDate: 2024-12-26 10:17:09 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-12-26 10:17:13 +0000 app-office/gnucash: backport guile load fixes to 5.8-r100 Backport the changes from 72dbf2ec4049df11ad63576971883ee239eadb7f. This allows easier testing of the fixes (because of the nature of them involving an upgrade/downgrade). Bug: https://bugs.gentoo.org/941426 Bug: https://bugs.gentoo.org/946388 Signed-off-by: Sam James <sam@gentoo.org> ...ath.patch => gnucash-5.8-guile-load-path.patch} | 0 app-office/gnucash/gnucash-5.10.ebuild | 2 +- app-office/gnucash/gnucash-5.8-r100.ebuild | 39 ++++++++++++++-------- 3 files changed, 26 insertions(+), 15 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8170672b2949a23581c166284e09370bb195773 commit f8170672b2949a23581c166284e09370bb195773 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-12-26 10:09:46 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-12-26 10:09:46 +0000 app-office/gnucash: backport boost-1.87 fix This allows easier testing of the bug #941426 fix. Closes: https://bugs.gentoo.org/946388 Bug: https://bugs.gentoo.org/941426 Signed-off-by: Sam James <sam@gentoo.org> app-office/gnucash/files/gnucash-5.8-boost-1.87.patch | 12 ++++++++++++ app-office/gnucash/gnucash-5.8-r100.ebuild | 2 ++ 2 files changed, 14 insertions(+)
I would appreciate it if people could bash against this and try to break it, and if it breaks, please file a new bug with logs. I'm hoping this has finally slayed this (very) longstanding issue.