Bug 248332

Summary: finance/gnucash: 4.1 fails to build due to guile error: In procedure module-lookup: Unbound variable: _
Product: Ports & Packages Reporter: eu9gu4
Component: Individual Port(s)Assignee: Guido Falsi <madpilot>
Status: Closed Not A Bug    
Severity: Affects Some People Keywords: needs-qa
Priority: --- Flags: madpilot: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   

Description eu9gu4 2020-07-28 16:21:05 UTC
4.0 built fine, 4.1 update fails with this error:

[793/935] cd /tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports && /usr/local/bin/cmake -E env LD_LIBRARY_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/gnucash: GNC_UNINSTALLED=YES GNC_BUILDDIR=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1 GUILE_LOAD_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports/deprecated:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/share/guile/site/2.2 GUILE_LOAD_COMPILED_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/guile/2.2/site-ccache:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/guile/2.2/site-ccache/gnucash/deprecated GNC_MODULE_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/gnucash: /usr/local/bin/guile -e "(@@ (guild) main)" -s /usr/local/bin/guild compile -o /tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/guile/2.2/site-ccache/gnucash/deprecated/gnucash/report/standard-reports.go /tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports/deprecated/standard-reports.scm
FAILED: lib/guile/2.2/site-ccache/gnucash/deprecated/gnucash/report/standard-reports.go 
cd /tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports && /usr/local/bin/cmake -E env LD_LIBRARY_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/gnucash: GNC_UNINSTALLED=YES GNC_BUILDDIR=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1 GUILE_LOAD_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports/deprecated:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/share/guile/site/2.2 GUILE_LOAD_COMPILED_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/guile/2.2/site-ccache:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/guile/2.2/site-ccache/gnucash/deprecated GNC_MODULE_PATH=/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib:/tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/gnucash: /usr/local/bin/guile -e "(@@ (guild) main)" -s /usr/local/bin/guild compile -o /tmp/usr/ports/finance/gnucash/work/gnucash-4.1/lib/guile/2.2/site-ccache/gnucash/deprecated/gnucash/report/standard-reports.go /tmp/usr/ports/finance/gnucash/work/gnucash-4.1/gnucash/report/reports/deprecated/standard-reports.scm
Backtrace:
In ice-9/boot-9.scm:
  2726:13 19 (_)
In ice-9/threads.scm:
    390:8 18 (_ _)
In ice-9/boot-9.scm:
  2994:20 17 (_)
   2312:4 16 (save-module-excursion _)
  3014:26 15 (_)
In unknown file:
          14 (primitive-load-path "gnucash/reports" #<procedure 8025…>)
In reports.scm:
     52:6 13 (_)
In srfi/srfi-1.scm:
    640:9 12 (for-each #<procedure 8044b2058 at report.scm:830:4 (m…> …)
    640:9 11 (for-each #<procedure 802cc8760 at report.scm:832:8 (m…> …)
In report.scm:
   836:23 10 (_ _)
In ice-9/boot-9.scm:
  2800:17  9 (resolve-interface (gnucash reports standard invoice) # …)
In ice-9/threads.scm:
    390:8  8 (_ _)
In ice-9/boot-9.scm:
  2726:13  7 (_)
In ice-9/threads.scm:
    390:8  6 (_ _)
In ice-9/boot-9.scm:
  2994:20  5 (_)
   2312:4  4 (save-module-excursion #<procedure 8025b05a0 at ice-9/b…>)
  3014:26  3 (_)
In unknown file:
           2 (primitive-load-path "gnucash/reports/standard/invoice" #)
In standard/invoice.scm:
   113:34  1 (_)
In ice-9/boot-9.scm:
   752:25  0 (dispatch-exception _ _ _)

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
In procedure module-lookup: Unbound variable: _
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/finance/gnucash
*** Error code 1

Stop.
make: stopped in /usr/ports/finance/gnucash
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20200728-22772-15hbqu3 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=gnucash-4.0 UPGRADE_PORT_VER=4.0 make
** Fix the problem and try again.
--->  Build of finance/gnucash ended at: Tue, 28 Jul 2020 09:09:56 -0700 (consumed 00:04:54)
--->  Upgrade of finance/gnucash ended at: Tue, 28 Jul 2020 09:09:56 -0700 (consumed 00:04:54)
--->  ** Upgrade tasks 1: 0 done, 0 ignored, 0 skipped and 1 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
	! finance/gnucash (gnucash-4.0)	(unknown build error)
--->  Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2020-07-28 16:56:05 UTC
I have nit experienced this error in multiple builds I performed to test the port.

I'd like to have some more information about the environment you're building the port in.

Do you have any custom options in gnucash or guile?

since you use portupgrade, it looks like you're building on a live system from ports. Have you tried forcing a guile port rebuild/reinstall?
Comment 2 eu9gu4 2020-07-28 17:36:25 UTC
(In reply to Guido Falsi from comment #1)

The options for guile2 and gnucash shown below.

# This file is auto-generated by 'make config'.
# Options for guile2-2.2.7_1
_OPTIONS_READ=guile2-2.2.7_1
_FILE_COMPLETE_OPTIONS_LIST=NLS THREADS
OPTIONS_FILE_SET+=NLS
OPTIONS_FILE_SET+=THREADS

# This file is auto-generated by 'make config'.
# Options for gnucash-4.1
_OPTIONS_READ=gnucash-4.1
_FILE_COMPLETE_OPTIONS_LIST=AQBANKING DATABASE DOCS NLS OFX PYTHON
OPTIONS_FILE_SET+=AQBANKING
OPTIONS_FILE_UNSET+=DATABASE
OPTIONS_FILE_UNSET+=DOCS
OPTIONS_FILE_SET+=NLS
OPTIONS_FILE_SET+=OFX
OPTIONS_FILE_SET+=PYTHON

I rebuilt guile2 hoping to fix the issue. It did not.

Additional info: gnucash 4.1 build fails with the exact same error on Gentoo Linux (my second system), which indicates it may not be a FreeBSD/ports issue, it could come from upstream.
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2020-07-28 19:22:15 UTC
I understand. AT the same time gnucash builds fine in poudriere, and I bet it would in a just installed FreeBSD system (poudriere actually simulates a clean system for each port it builds).

SO my guess is that something you have installed on your system, both FreeBSD and Linux, is interfering with the gnucash build.

Maybe some guile module with some component with the same name? I actually don't know much about guile, I only happen to have something to do with it due to using gnucash and maintaining it's port.

I try a wild guess. In my most recent gnucash build log I cannot see anything named "ice-9" or like that, but that appears in your error message.

Could you investigate if you have anything installed that creates guile related files with a name like that? Maybe that's related?

If there is a conflict I don't think I can do much more than register it in the port though. Maybe report it upstream to see if they can do something about it.
Comment 4 eu9gu4 2020-07-28 20:36:01 UTC
(In reply to Guido Falsi from comment #3)

I have absolutely no idea about what could heave happened related to guile and what the ice-9 problem would be.

What I can say is that I am a typical home user without programming expertise. The way I install software on both FreeBSD and Gentoo is by using the package managers provided by those systems, portupgrade and portage. I leave it to them to take care of installing all dependencies and they are usually good at it, but not perfect.

It just happened that I got a new machine and I installed both systems last week, so everything is clean install. So, last week gnucash-4.0 built perfectly fine and this week the upgrade to 4.1 fails on both systems with the same error!

FreeBSD show this for guile2:

Depends on:
guile2-2.2.7_1:
	indexinfo-0.3.1
	gmp-6.2.0
	readline-8.0.4
	ncurses-6.1.20190525
	libunistring-0.9.10_1
	libltdl-2.4.6
	libffi-3.3
	gettext-runtime-0.20.2
	boehm-gc-threaded-8.0.4_1
These ports ddepend on guile2:
guile2-2.2.7_1:
	graphviz-2.44.1
	gnucash-4.0

So, it's only graphviz and gnucash that depend on guile.

A Google search on "ice-9/boot-9.scm" doesn't show much, but I see some old threads with hints that could relate to a "deprecated" option for guile.

I remember there were gnucash build problems a few years ago when it switched from guile-1 to guile-2, but in time they were sorted out.

Can't say much more than this. Hope it's not a dead end.
Comment 5 Guido Falsi freebsd_committer freebsd_triage 2020-07-29 17:45:38 UTC
(In reply to eu9gu4 from comment #4)

> What I can say is that I am a typical home user without programming expertise.
> The way I install software on both FreeBSD and Gentoo is by using the package
> managers provided by those systems, portupgrade and portage. I leave it to
> them to take care of installing all dependencies and they are usually good
> at it, but not perfect.

As a personal suggestion, and not necessarily related to this problem:

For this kind of usage in FreeBSD i think you would be better off using binary packages via pkg instead of compiling them through portupgrade.

Years ago when we were using the old pkg_install binary packages were not very usable and your approach was the best one, but since pkgng binary packages on FreeBSD are quite good and avoid this kind of build problems.


> A Google search on "ice-9/boot-9.scm" doesn't show much, but I see some old
> threads with hints that could relate to a "deprecated" option for guile.

Ok I've now checked and such a file is part of guile package. I have it here:

/usr/local/share/guile/2.2/ice-9/boot-9.scm

Could you check if you have this same file?

Unluckily I don't know what could be causing this on your machine. I'm going to make a test in a virtual machine, but it requires a little time.
Comment 6 eu9gu4 2020-07-29 19:21:07 UTC
(In reply to Guido Falsi from comment #5)

/usr/local/share/guile/2.2/ice-9/boot-9.scm is present on my system too.

Back to an earlier statement that I might have installed something that affected guile: gnucash was one of the last packages installed on my system last week. Only firefox and was installed after it. So, not too many chances that other software affected guile!
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2020-07-29 20:23:01 UTC
(In reply to eu9gu4 from comment #6)

> Back to an earlier statement that I might have installed something that affected
> guile: gnucash was one of the last packages installed on my system last week.
> Only firefox and was installed after it.

Actually what you are doing is not "installing software" but building and then installing it. There's a difference.

What fails for you is building gnucash, preventing you from installing it.

I'm trying to understand what problem you're experiencing but not being able to reproduce it locally I can only guess.

I tried manually building gnucash in an existing jail of mine with some software already installed and it builds fine.

At this point, unless some other user reports similar problems, suspect it is a local problem on your machine. I'm anyway willing to help you

> So, not too many chances that other software affected guile!

Even one chance is enough to break your build. also you say you installed gnucash last except for firefox, I don't know how many other packages you have installed but it does not look like a tiny chance.

Anyway mine was a guess. The build fails reporting it can't find a file that should be there and you confirm being there. This is not happening in poudriere and in my jail for example, we need to understand what is different on your system where the issue is appearing.

Could be also something in your environment. Maybe your PATH? SOme other variable?

I'm trying to guess, since I cannot know the state of your system.

Could you send a full log of the failed build of gnucash? Maybe I could gather some information there.
Comment 8 eu9gu4 2020-07-29 20:47:55 UTC
(In reply to Guido Falsi from comment #7)

I absolutely appreciate your patience willingness to help!

Your comments gave me two ideas:

1. I may need to use poudriere to check what's happening with it. Never used it, seems to be working with jails, never used those either. So, it might take some time for me to assimilate the knowledge and implement it. Will, probably try over the next weekend.

2. Wondering if you can connect somehow to my machine and check yourself what you need to check. I don't know if FreeBSD has a tool like TeamViewer or similar, nor if this idea is feasible or useful.

I can send a list of installed ports obtained with pkg info, if that can be of any use.
Comment 9 Guido Falsi freebsd_committer freebsd_triage 2020-07-29 21:06:12 UTC
(In reply to eu9gu4 from comment #8)

> 1. I may need to use poudriere to check what's happening with it. Never used it,
> seems to be working with jails, never used those either. So, it might take some
> time for me to assimilate the knowledge and implement it. Will, probably try
> over the next weekend.

If you insist on compiling software yourself (*) poudriere is a great tool.You can build your own repo with compiled packages and install from there on machines. Each package is built in a clean environment, so pollution by other factors (installed packages, user environment) is avoided.

To use poudriere you don't really need to have an understanding about jails, all the details are handled automatically.

(*) Sine you said you are just a user with no programming experience, compiling software yourself looks unnatural for you, from my POV. Unless you strictly need some package built with custom options, I really think you should evaluate using official binary packages via pkg(8).


> 2. Wondering if you can connect somehow to my machine and check yourself what
> you need to check. I don't know if FreeBSD has a tool like TeamViewer or
> similar, nor if this idea is feasible or useful.

FfeeBSD, like all modern unices, has ssh. It's not a screen sharing each user connects to the machine and has it's terminal. But really remote assistance is beyond any support that can be provided by committers. I can assist you in analyzing your findings and give suggestions to try to understand what is going on, but you should do the analysis on your systems.

As I said you should attach here a FULL log of the failing build. You can create it using tee(1). Launch tee (check man page for details) and then launch the command you use to build and install gnucash. You will get a full log you can send here and I can have a look.
Comment 10 Guido Falsi freebsd_committer freebsd_triage 2020-07-29 21:28:49 UTC
By the way, while trying to build gnucash 4.1, do you happen to have gnucash 4.0 still installed? Have you tried uninstalling it before trying to build the new version.

That could be the conflict we are looking for.
Comment 11 eu9gu4 2020-07-29 22:01:38 UTC
(In reply to Guido Falsi from comment #10)

That solved the problem!

Odd though, this is only the second piece of software exhibiting this, I mean it could only be built after uninstalling the previous version. The first was evolution-data-server a while ago.
Comment 12 Guido Falsi freebsd_committer freebsd_triage 2020-07-30 18:38:25 UTC
(In reply to eu9gu4 from comment #11)

This kind of issue appears from time to time in various software.

Usually it's an upstream build system issue, the fact it also happens in linux indicates this is the case here.

Can this issue be closed since we found what the problem was?
Comment 13 eu9gu4 2020-07-30 19:27:16 UTC
(In reply to Guido Falsi from comment #12)

Absolutely, please close it.