Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -72,11 +72,11 @@ ;; the comment can be set in the step record in launch.scm ;; (define (launch:load-logpro-dat run-id test-id stepname) (let ((cname (conc stepname ".dat"))) (if (common:file-exists? cname) - (let* ((dat (configf:read-config cname #f #f)) + (let* ((dat (configf:read-config cname #f #f keep-filenames: (debug:debug-mode 9))) (csvr (db:logpro-dat->csv dat stepname)) (csvt (let-values (((fmt-cell fmt-record fmt-csv) (make-format ","))) (fmt-csv (map list->csv-record csvr)))) (status (configf:lookup dat "final" "exit-status")) (msg (configf:lookup dat "final" "message"))) @@ -646,11 +646,11 @@ ;; NOTE: Current order is to process runconfigs *before* setting the MT_ vars. This ;; seems non-ideal but could well break stuff ;; BUG? BUG? BUG? (let ((rconfig (full-runconfigs-read)) ;; (read-config (conc *toppath* "/runconfigs.config") #f #t sections: (list "default" target)))) - (wconfig (configf:read-config "waivers.config" #f #t sections: `( "default" ,target )))) ;; read the waivers config if it exists + (wconfig (configf:read-config "waivers.config" #f #t sections: `( "default" ,target ) keep-filenames: (debug:debug-mode 9)))) ;; read the waivers config if it exists ;; (setup-env-defaults (conc *toppath* "/runconfigs.config") run-id (make-hash-table) keyvals target) ;; (set-run-config-vars run-id keyvals target) ;; (db:get-target db run-id)) ;; Now have runconfigs data loaded, set environment vars (for-each (lambda (section) @@ -878,19 +878,19 @@ ;; side effects: ;; sets; *configdat* (megatest.config info) ;; *runconfigdat* (runconfigs.config info) ;; *configstatus* (status of the read data) ;; -(define (launch:setup #!key (force-reread #f) (areapath #f)) +(define (launch:setup #!key (force-reread #f) (areapath #f) (keep-filenames #f)) (mutex-lock! *launch-setup-mutex*) (if (and *toppath* (eq? *configstatus* 'fulldata) (not force-reread)) ;; got it all (begin (debug:print 2 *default-log-port* "NOTE: skipping launch:setup-body call since we have fulldata") (mutex-unlock! *launch-setup-mutex*) *toppath*) - (let ((res (launch:setup-body force-reread: force-reread areapath: areapath))) + (let ((res (launch:setup-body force-reread: force-reread areapath: areapath keep-filenames: keep-filenames))) (mutex-unlock! *launch-setup-mutex*) res))) ;; return paths depending on what info is available. ;; @@ -917,16 +917,17 @@ "\n cachedir=" cachedir "\n mtcachef=" mtcachef "\n rccachef=" rccachef) (cons mtcachef rccachef))) -(define (launch:setup-body #!key (force-reread #f) (areapath #f)) +(define (launch:setup-body #!key (force-reread #f) (areapath #f)(keep-filenames #f)) (if (and (eq? *configstatus* 'fulldata) *toppath* (not force-reread)) ;; no need to reprocess *toppath* ;; return toppath - (let* ((use-cache (common:use-cache?)) ;; BB- use-cache checks *configdat* for use-cache setting. We do not have *configdat*. Bootstrapping problem here. + (let* ((use-cache (and (not keep-filenames) + (common:use-cache?))) ;; BB- use-cache checks *configdat* for use-cache setting. We do not have *configdat*. Bootstrapping problem here. (toppath (or *toppath* areapath (getenv "MT_RUN_AREA_HOME"))) ;; preserve toppath (target (common:args-get-target)) (sections (if target (list "default" target) #f)) ;; for runconfigs (mtconfig (or (args:get-arg "-config") "megatest.config")) ;; allow overriding megatest.config (cachefiles (launch:get-cache-file-paths areapath toppath target mtconfig)) @@ -964,21 +965,25 @@ ;;(BB> "launch:setup-body -- cond branch 2") (let* ((first-pass (configf:find-and-read-config ;; NB// sets MT_RUN_AREA_HOME as side effect mtconfig environ-patt: "env-override" given-toppath: toppath - pathenvvar: "MT_RUN_AREA_HOME")) + pathenvvar: "MT_RUN_AREA_HOME" + keep-filenames: keep-filenames + )) (first-rundat (let ((toppath (if toppath toppath (car first-pass)))) (configf:read-config ;; (conc toppath "/runconfigs.config") ;; this should be converted to runconfig:read but it is non-trivial, leaving it for now. (conc (if (string? toppath) toppath (get-environment-variable "MT_RUN_AREA_HOME")) "/runconfigs.config") *runconfigdat* #t - sections: sections)))) + sections: sections + keep-filenames: keep-filenames + )))) (set! *runconfigdat* first-rundat) (if first-pass ;; (begin ;;(BB> "launch:setup-body -- \"first-pass\"=first-pass") (set! *configdat* (car first-pass)) @@ -1000,17 +1005,21 @@ ; (conc *toppath* "/lt")))) (second-pass (configf:find-and-read-config mtconfig environ-patt: "env-override" given-toppath: toppath - pathenvvar: "MT_RUN_AREA_HOME")) + pathenvvar: "MT_RUN_AREA_HOME" + keep-filenames: (debug:debug-mode 9)) + ) (runconfigdat (begin ;; this read of the runconfigs will see any adjustments made by re-reading megatest.config (for-each (lambda (kt) (setenv (car kt) (cadr kt))) key-vals) (configf:read-config (conc toppath "/runconfigs.config") *runconfigdat* #t ;; consider using runconfig:read some day ... - sections: sections))) + sections: sections + keep-filenames: (debug:debug-mode 9) + ))) (cachefiles (launch:get-cache-file-paths areapath toppath target mtconfig)) (mtcachef (car cachefiles)) (rccachef (cdr cachefiles))) ;; trap exception due to stale NFS handle -- Error: (open-output-file) cannot open file - Stale NFS file handle: "/p/fdk/gwa/lefkowit/mtTesting/qa/primbeqa/links/p1222/11/PDK_r1.1.1/prim/clean/pcell_testgen/.runconfigs.cfg-1.6427-7d1e789cb3f62f9cde719a4865bb51b3c17ea853" - ticket 220546342 ;; TODO - consider 1) using simple-lock to bracket cache write @@ -1038,16 +1047,20 @@ ;;(BB> "launch:setup-body -- cond branch 3 - else") (let* ((cfgdat (configf:find-and-read-config (or (args:get-arg "-config") "megatest.config") environ-patt: "env-override" given-toppath: (get-environment-variable "MT_RUN_AREA_HOME") - pathenvvar: "MT_RUN_AREA_HOME"))) + pathenvvar: "MT_RUN_AREA_HOME" + keep-filenames: keep-filenames + ))) (if (and cfgdat (list? cfgdat) (> (length cfgdat) 0) (hash-table? (car cfgdat))) (let* ((toppath (or (get-environment-variable "MT_RUN_AREA_HOME")(cadr cfgdat))) (rdat (configf:read-config (conc toppath ;; convert this to use runconfig:read! - "/runconfigs.config") *runconfigdat* #t sections: sections))) + "/runconfigs.config") *runconfigdat* #t sections: sections + keep-filenames: (debug:debug-mode 9) + ))) (set! *configinfo* cfgdat) (set! *configdat* (car cfgdat)) (set! *runconfigdat* rdat) (set! *toppath* toppath) (set! *configstatus* 'partial)) @@ -1116,11 +1129,13 @@ ;; if have -append-config then read and append here (let ((cfname (args:get-arg "-append-config"))) (if (and cfname (file-read-access? cfname)) - (configf:read-config cfname *configdat* #t))) ;; values are added to the hash, no need to do anything special. + (configf:read-config cfname *configdat* #t + keep-filenames: (debug:debug-mode 9) + ))) ;; values are added to the hash, no need to do anything special. *toppath*))) (define (get-best-disk confdat testconfig) (let* ((disks (or (and testconfig (hash-table-ref/default testconfig "disks" #f)) (hash-table-ref/default confdat "disks" #f))) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -424,10 +424,13 @@ "-diff-rep" ) args:arg-hash 0)) + +;; + ;; Add args that use remargs here ;; (if (and (not (null? remargs)) (not (or @@ -593,10 +596,12 @@ ;;====================================================================== ;; Misc setup stuff ;;====================================================================== +;; setup modules +(if (args:get-arg "-debug") (debug:set-debug-mode (args:get-arg "-debug"))) (debug:setup) (if (args:get-arg "-logging") (debug:add-logging-callback db:log-event)) @@ -989,12 +994,13 @@ (debug:print-error 0 *default-log-port* "-dumpmode of " (args:get-arg "-dumpmode") " not recognised"))) (set! *didsomething* #t)) (pop-directory))) (if (args:get-arg "-show-config") - (let ((tl (launch:setup)) + (let ((tl (launch:setup keep-filenames: (debug:debug-mode 9))) (data *configdat*)) ;; (read-config "megatest.config" #f #t))) + (BB> "in -show-config: keep-filenames: "(debug:debug-mode 9)) (push-directory *toppath*) ;; keep this one local (cond ((and (args:get-arg "-section") (args:get-arg "-var")) @@ -1007,11 +1013,11 @@ (pp (hash-table->alist data))) ((equal? (args:get-arg "-dumpmode") "json") (json-write data)) ((or (not (args:get-arg "-dumpmode")) (string=? (args:get-arg "-dumpmode") "ini")) - (configf:config->ini data)) + (configf:config->ini data) ) (else (debug:print-error 0 *default-log-port* "-dumpmode of " (args:get-arg "-dumpmode") " not recognised"))) (set! *didsomething* #t) (pop-directory) (set! *time-to-exit* #t))) @@ -2155,11 +2161,11 @@ (exit 0))) (if (or (getenv "MT_RUNSCRIPT") (args:get-arg "-repl") (args:get-arg "-load")) - (let* ((toppath (launch:setup)) + (let* ((toppath (launch:setup keep-filenames: (debug:debug-mode 9))) (dbstruct (if (and toppath (common:on-homehost?)) (db:setup #t) #f))) ;; make-dbr:dbstruct path: toppath local: (args:get-arg "-local")) #f))) (if *toppath* Index: modules.scm ================================================================== --- modules.scm +++ modules.scm @@ -15,18 +15,19 @@ ;; ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see . ;;====================================================================== -(use (prefix mtargs args:)) -(use mtdebug) -(use (prefix mtconfigf configf:)) +(define (load-common-modules) + (use (prefix mtargs args:)) + (use mtdebug) + (use (prefix mtconfigf configf:))) +(load-common-modules) ;; configure mtdebug ;; TODO: move to megatest.scm with other command line arg processing (if (args:get-arg "-v") (debug:set-verbose-mode)) (if (args:get-arg "-q") (debug:set-quiet-mode)) -(if (args:get-arg "-debug") (debug:set-verbosity (args:get-arg "-debug"))) (if (args:get-arg "-color") (case (string->symbol (args:get-arg "-color")) ((y Y yes YES t T) (debug:force-color)) ((n N no NO f F) (debug:suppress-color))))