From 617c4c4ade54ceba918cfd7cb303f93562a02f14 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Thu, 12 Sep 2019 10:10:58 +0200 Subject: [PATCH] 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. --- 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(-) diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt index 93df1726b6..8fc62a115f 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 0af3e2f31e..4032e462da 100644 --- a/gnucash/report/html-barchart.scm +++ b/gnucash/report/html-barchart.scm @@ -21,8 +21,6 @@ ;; Boston, MA 02110-1301, USA gnu@gnu.org ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(use-modules (gnucash report)) - (define (make-record-type "" '(width diff --git a/gnucash/report/html-linechart.scm b/gnucash/report/html-linechart.scm index a4dfe74fe8..44ebd40b1b 100644 --- a/gnucash/report/html-linechart.scm +++ b/gnucash/report/html-linechart.scm @@ -24,8 +24,6 @@ ;; Boston, MA 02110-1301, USA gnu@gnu.org ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(use-modules (gnucash report)) - (define (make-record-type "" '(width diff --git a/gnucash/report/html-piechart.scm b/gnucash/report/html-piechart.scm index 3eee4e35ad..f30ac8e519 100644 --- a/gnucash/report/html-piechart.scm +++ b/gnucash/report/html-piechart.scm @@ -21,8 +21,6 @@ ;; Boston, MA 02110-1301, USA gnu@gnu.org ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(use-modules (gnucash report)) - (define (make-record-type "" '(width diff --git a/gnucash/report/html-scatter.scm b/gnucash/report/html-scatter.scm index cc931df6c3..8167d19511 100644 --- a/gnucash/report/html-scatter.scm +++ b/gnucash/report/html-scatter.scm @@ -24,8 +24,6 @@ ;; Boston, MA 02110-1301, USA gnu@gnu.org ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(use-modules (gnucash report)) - (define (make-record-type "" '(width diff --git a/libgnucash/engine/engine-utilities.scm b/libgnucash/engine/engine-utilities.scm index 939e65ba26..1840eddd54 100644 --- a/libgnucash/engine/engine-utilities.scm +++ b/libgnucash/engine/engine-utilities.scm @@ -22,7 +22,10 @@ ;; Copyright 2000 Rob Browning (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))