gnucash master: Fix several dependency issues in scheme code

Geert Janssens gjanssens at code.gnucash.org
Thu Sep 12 04:21:44 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/617c4c4a (commit)
	from  https://github.com/Gnucash/gnucash/commit/0b3752d9 (commit)



commit 617c4c4ade54ceba918cfd7cb303f93562a02f14
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Sep 12 10:10:58 2019 +0200

    Fix several dependency issues in scheme code
    
    * Ensure all the files included in report.scm are built before
      any module calls '(use-modules (gnucash report))'
    * Break circular dependency between report.scm and the files it loads via
      '(load-from-path ...)'
      For example file 'gnucash/report/html-linechart' is loaded via
      '(load-from-path ...)' in 'reports.scm' it shouldn't call
      '(use-modules (gnucash report))'. That would  make it indirectly
      depend on its own.
    * In the same way 'engine-utilities.scm' was in a circular dependency loop
      with 'engine.scm' though even more indirectly via (gnc-module-load ...)'.
      The initialization code of libgncmod-engine calls
      '(use-modules (gnucash engine))' which in turn tries to load-from-path
      'engine-utilities.scm', completing the loop.

diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt
index 93df1726b..8fc62a115 100644
--- a/gnucash/report/CMakeLists.txt
+++ b/gnucash/report/CMakeLists.txt
@@ -132,7 +132,7 @@ gnc_add_scheme_deprecated_module ("gnucash report report-system report-collector
 gnc_add_scheme_deprecated_module ("gnucash report stylesheets" "" "" "")
 gnc_add_scheme_deprecated_module ("gnucash report utility-reports" "" "" "")
 
-add_custom_target(scm-report ALL DEPENDS scm-report-eguile)
+add_custom_target(scm-report ALL DEPENDS scm-report-2 scm-report-eguile)
 
 set_local_dist(report_DIST_local CMakeLists.txt
   report.i
diff --git a/gnucash/report/html-barchart.scm b/gnucash/report/html-barchart.scm
index 0af3e2f31..4032e462d 100644
--- a/gnucash/report/html-barchart.scm
+++ b/gnucash/report/html-barchart.scm
@@ -21,8 +21,6 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash report))
-
 (define <html-barchart>
   (make-record-type "<html-barchart>"
                     '(width 
diff --git a/gnucash/report/html-linechart.scm b/gnucash/report/html-linechart.scm
index a4dfe74fe..44ebd40b1 100644
--- a/gnucash/report/html-linechart.scm
+++ b/gnucash/report/html-linechart.scm
@@ -24,8 +24,6 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash report))
-
 (define <html-linechart>
   (make-record-type "<html-linechart>"
                     '(width
diff --git a/gnucash/report/html-piechart.scm b/gnucash/report/html-piechart.scm
index 3eee4e35a..f30ac8e51 100644
--- a/gnucash/report/html-piechart.scm
+++ b/gnucash/report/html-piechart.scm
@@ -21,8 +21,6 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash report))
-
 (define <html-piechart>
   (make-record-type "<html-piechart>"
                     '(width
diff --git a/gnucash/report/html-scatter.scm b/gnucash/report/html-scatter.scm
index cc931df6c..8167d1951 100644
--- a/gnucash/report/html-scatter.scm
+++ b/gnucash/report/html-scatter.scm
@@ -24,8 +24,6 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash report))
-
 (define <html-scatter>
   (make-record-type "<html-scatter>"
                     '(width
diff --git a/libgnucash/engine/engine-utilities.scm b/libgnucash/engine/engine-utilities.scm
index 939e65ba2..1840eddd5 100644
--- a/libgnucash/engine/engine-utilities.scm
+++ b/libgnucash/engine/engine-utilities.scm
@@ -22,7 +22,10 @@
 ;; Copyright 2000 Rob Browning <rlb at cs.utexas.edu>
 (use-modules (gnucash gnc-module))
 
-(gnc:module-begin-syntax (gnc:module-load "gnucash/engine" 0))
+(eval-when
+      (compile load eval expand)
+      (load-extension "libgncmod-engine" "scm_init_sw_engine_module"))
+(use-modules (sw_engine))
 
 (use-modules (srfi srfi-1)
              (srfi srfi-13))



Summary of changes:
 gnucash/report/CMakeLists.txt          | 2 +-
 gnucash/report/html-barchart.scm       | 2 --
 gnucash/report/html-linechart.scm      | 2 --
 gnucash/report/html-piechart.scm       | 2 --
 gnucash/report/html-scatter.scm        | 2 --
 libgnucash/engine/engine-utilities.scm | 5 ++++-
 6 files changed, 5 insertions(+), 10 deletions(-)



More information about the gnucash-changes mailing list