GnuCash
Contact   Instructions
Bug 412151 - Not handling exception when guile is compiled w/o regexp support
Summary: Not handling exception when guile is compiled w/o regexp support
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: Lowest trivial
Target Milestone: ---
Assignee: general
QA Contact: Chris Lyttle
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-26 01:54 EST by Yaman666
Modified: 2019-10-12 01:38 EDT (History)
5 users (show)

See Also:


Attachments

Description Yaman666 2007-02-26 01:54:38 EST
Please describe the problem:
I am using gentoo system that uses "USE" flags to enable/disable package functionality. Similar to --with/--without flags.

When I upgraded new guile 1.8 (from 1.6) - all extra functionality was disabled by default. When I launched gnucash, it complained about missing "deprecated" functionality, so I added the "deprecated" flag. However, then gnucash would crash with the following trace:

Backtrace:
In unknown file:
   ?: 0* [primitive-load-path "qif-import/qif-parse.scm"]
In /usr/share/gnucash/scm/qif-import/qif-parse.scm:
   8: 1* (define qif-category-compiled-rexp #)
   9: 2* (make-regexp "^ *(\\[)?([^]/\\|]*)(]?)(/?)([^\\|]*)(\\|(\\[)?([^]/]*)(]
?)(/?)(.*))? *$")

/usr/share/gnucash/scm/qif-import/qif-parse.scm:9:3: In expression (make-regexp "^ *(\\[)?([^]/\\|]*)(]?)(/?)([^\\|]*)(\\|(\\[)?([^]/]*)(]?)(/?)(.*))? *$"):
/usr/share/gnucash/scm/qif-import/qif-parse.scm:9:3: Unbound variable: make-regexp

After spending an hour recompiling packages and searching the internet, I accidentally saw the "regex" flag for guile and linked that with "make-regexp" failing. Enabling the flag solved all the problems.

Steps to reproduce:
1. Use guile 1.8.1 without regexp
2. Launch gnucash



Actual results:
Backtrace:
In unknown file:
   ?: 0* [primitive-load-path "qif-import/qif-parse.scm"]
In /usr/share/gnucash/scm/qif-import/qif-parse.scm:
   8: 1* (define qif-category-compiled-rexp #)
   9: 2* (make-regexp "^ *(\\[)?([^]/\\|]*)(]?)(/?)([^\\|]*)(\\|(\\[)?([^]/]*)(]
?)(/?)(.*))? *$")

/usr/share/gnucash/scm/qif-import/qif-parse.scm:9:3: In expression (make-regexp "^ *(\\[)?([^]/\\|]*)(]?)(/?)([^\\|]*)(\\|(\\[)?([^]/]*)(]?)(/?)(.*))? *$"):
/usr/share/gnucash/scm/qif-import/qif-parse.scm:9:3: Unbound variable: make-regexp

Expected results:
Display message "guile is compiled without regex support"

Does this happen every time?
Yes

Other information:
Comment 1 Josh Sled 2007-02-26 10:51:42 EST
(FWIW, the gentoo ebuild for gnucash implements this check.)

The gnucash configure script should check for required guile features, though it wouldn't have caught this either.

The only solution would be to check for all required features at run-/init-time.
Comment 2 Yaman666 2007-02-26 19:12:44 EST
Gentoo ebuild did not implement either deprecated or regexp flags check. I know this because when I emerged gnucash it didn't complain. It only informed about deprecated flag *after* I ran it (so I had to re-emerge guile).

It would actually be nice to include those checks in the ebuild, so people wouldn't have to recompile everything *afterwards*. I'll try post a bug/request to the gentoo ebuild maintainer.

But if there was a way to trap "make-regexp" exception within gnucash and display a more meaningful error message - that would help too. I haven't tried compiling from source, but I have a feeling someone compiling on a machine where guile is w/o regexp support won't see any warning?

Of course this all may be in a README somewhere, and should've RTFM, but I'm just too used to gentoo doing all the hard work for me. :-)
Comment 3 Wm 2019-08-11 09:10:14 EDT
triage: I think this is no longer an issue
Comment 4 Christopher Lam 2019-10-09 21:26:41 EDT
@gjanssens - I thought initially CMake could detect guile-regex, but it seems that runtime guile *can* be compiled without regex, so, I agree we can autodetect regex support in utilities.scm and emit error if it's not found.

Alternatively qif-parse (and transaction report's regex matcher) can be disabled if regex is not found.
Comment 5 Christopher Lam 2019-10-12 01:38:33 EDT
fixed in maint.

qif-import is disabled if guile has no regex.

Note You need to log in before you can comment on or make changes to this bug.