Megatest

Check-in [f05f040231]
Login
Overview
Comment:updated method to set repository path to enable build-private egg installs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v2.01-local-mtfiles | v2.01-try-1
Files: files | file ages | folders
SHA1: f05f0402314a84b79882614ccc692810ea4c70f7
User & Date: bjbarcla on 2018-12-18 13:10:38
Other Links: branch diff | manifest | tags
Context
2018-12-18
18:13
removed CHICKEN_REPOSITORY from cfg.sh now that we have a better solution check-in: 1f8f21e43e user: bjbarcla tags: v2.01-local-mtfiles, v2.01-try-1
13:10
updated method to set repository path to enable build-private egg installs check-in: f05f040231 user: bjbarcla tags: v2.01-local-mtfiles, v2.01-try-1
2018-12-17
16:22
Partial work on mtconfigf as localized egg check-in: 9414991425 user: mrwellan tags: v2.01-local-mtfiles, v2.01-try-1
Changes

Modified Makefile from [9d31f3463a] to [082fe8dfd7].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56
57
58
59
60
61
62






63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#     You should have received a copy of the GNU General Public License
#     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

# make install CSCOPTS='-accumulate-profile -profile-name $(PWD)/profile-ww$(shell date +%V.%u)'
# rm <files>.o ; make install CSCOPTS='-profile' ; ... ;  chicken-profile | less
SHELL=/bin/bash
PREFIX=$(PWD)/tmpinstall
CSCOPTS=
INSTALL=install
SRCFILES = common.scm items.scm launch.scm \
   ods.scm runconfig.scm server.scm \
   db.scm keys.scm margs.scm megatest-version.scm \
   process.scm runs.scm tasks.scm tests.scm genexample.scm \
   http-transport.scm filedb.scm tdb.scm \
   client.scm mt.scm \
   ezsteps.scm lock-queue.scm sdb.scm \
   rmt.scm api.scm subrun.scm \
   portlogger.scm archive.scm env.scm diff-report.scm cgisetup/models/pgdb.scm

# module source files
MSRCFILES = ftail.scm 
#  mtcommon.scm mtdb.scm mtconfigf.scm


# Eggs to install (straightforward ones)
EGGS=matchable readline apropos base64 regex-literals format regex-case test coops trace csv \
dot-locking posix-utils posix-extras directory-utils hostinfo tcp-server rpc csv-xml fmt \
json md5 awful http-client spiffy uri-common intarweb spiffy-request-vars \
spiffy-directory-listing ssax sxml-serializer sxml-modifications iup canvas-draw sqlite3

GUISRCF  = dashboard-context-menu.scm dashboard-tests.scm dashboard-guimonitor.scm gutils.scm dcommon.scm tree.scm vg.scm

OFILES   = $(SRCFILES:%.scm=%.o)
GOFILES  = $(GUISRCF:%.scm=%.o)

MOFILES = $(MSRCFILES:%.scm=%.o)



%.o : %.scm ../adat.scm
	csc $(CSCOPTS) -J -c $< -o $*.o

ADTLSCR=mt_laststep mt_runstep mt_ezstep
HELPERS=$(addprefix $(PREFIX)/bin/,$(ADTLSCR))
DEPLOYHELPERS=$(addprefix deploytarg/,$(ADTLSCR))
MTESTHASH=$(shell fossil info|grep checkout:| awk '{print $$2}')

MT_EGGS_BASE=$(PREFIX)/eggs
MT_EGGS_DIR=$(MT_EGGS_BASE)/lib/chicken/7
MTEGGS=$(MT_EGGS_DIR)/mtconfigf.so
CHICKEN_REPOSITORY=$(MT_EGGS_BASE)







ifeq ($(MTESTHASH),)
$(error MTESTHASH is broken!)
endif

CKREPOSITORY=$(shell chicken-install -repository)
CSIPATH=$(shell which csi)
CKPATH=$(shell dirname $(shell dirname $(CSIPATH)))
# ARCHSTR=$(shell uname -m)_$(shell uname -r)
# BASH_MACHTYPE=$(shell bash -c "echo \$$MACHTYPE")
# ARCHSTR=$(BASH_MACHTYPE)_$(shell lsb_release -sr)
ARCHSTR=$(shell if [[ -e /usr/bin/sw_vers ]]; then /usr/bin/sw_vers -productVersion; else lsb_release -sr; fi)
# ARCHSTR=$(shell bash -c "echo \$$MACHTYPE")

PNGFILES = $(shell cd docs/manual;ls *png)

#all : $(PREFIX)/bin/.$(ARCHSTR) mtest dboard mtut ndboard
all : $(PREFIX)/bin/.$(ARCHSTR) mtest dboard mtut eggs

mtest: $(OFILES) readline-fix.scm megatest.o $(MOFILES)
	csc $(CSCOPTS) $(OFILES) $(MOFILES) megatest.o -o mtest

showmtesthash:
	@echo $(MTESTHASH)

dboard : $(OFILES) $(GOFILES) dashboard.scm $(MOFILES)
	csc $(CSCOPTS) $(OFILES) dashboard.scm $(GOFILES) $(MOFILES) -o dboard







|












|

>













>
>












|
>
>
>
>
>
>



















|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#     You should have received a copy of the GNU General Public License
#     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

# make install CSCOPTS='-accumulate-profile -profile-name $(PWD)/profile-ww$(shell date +%V.%u)'
# rm <files>.o ; make install CSCOPTS='-profile' ; ... ;  chicken-profile | less
SHELL=/bin/bash
PREFIX=$(PWD)/tmpinstall

INSTALL=install
SRCFILES = common.scm items.scm launch.scm \
   ods.scm runconfig.scm server.scm \
   db.scm keys.scm margs.scm megatest-version.scm \
   process.scm runs.scm tasks.scm tests.scm genexample.scm \
   http-transport.scm filedb.scm tdb.scm \
   client.scm mt.scm \
   ezsteps.scm lock-queue.scm sdb.scm \
   rmt.scm api.scm subrun.scm \
   portlogger.scm archive.scm env.scm diff-report.scm cgisetup/models/pgdb.scm

# module source files
MSRCFILES = ftail.scm
#  mtcommon.scm mtdb.scm mtconfigf.scm


# Eggs to install (straightforward ones)
EGGS=matchable readline apropos base64 regex-literals format regex-case test coops trace csv \
dot-locking posix-utils posix-extras directory-utils hostinfo tcp-server rpc csv-xml fmt \
json md5 awful http-client spiffy uri-common intarweb spiffy-request-vars \
spiffy-directory-listing ssax sxml-serializer sxml-modifications iup canvas-draw sqlite3

GUISRCF  = dashboard-context-menu.scm dashboard-tests.scm dashboard-guimonitor.scm gutils.scm dcommon.scm tree.scm vg.scm

OFILES   = $(SRCFILES:%.scm=%.o)
GOFILES  = $(GUISRCF:%.scm=%.o)

MOFILES = $(MSRCFILES:%.scm=%.o)



%.o : %.scm ../adat.scm
	csc $(CSCOPTS) -J -c $< -o $*.o

ADTLSCR=mt_laststep mt_runstep mt_ezstep
HELPERS=$(addprefix $(PREFIX)/bin/,$(ADTLSCR))
DEPLOYHELPERS=$(addprefix deploytarg/,$(ADTLSCR))
MTESTHASH=$(shell fossil info|grep checkout:| awk '{print $$2}')

MT_EGGS_BASE=$(PREFIX)/eggs
MT_EGGS_DIR=$(MT_EGGS_BASE)/lib/chicken/7
MTEGGS=$(MT_EGGS_DIR)/mtconfigf.so
CHICKEN_REPOSITORY=$(MT_EGGS_DIR)
export CHICKEN_REPOSITORY
CSCOPTS=-Wl,-rpath,$(MT_EGGS_DIR)


# prefix commands with $(withenv) following as a means to collect env vars for compilation...
withenv=CHICKEN_REPOSITORY=$(MT_EGGS_DIR) 

ifeq ($(MTESTHASH),)
$(error MTESTHASH is broken!)
endif

CKREPOSITORY=$(shell chicken-install -repository)
CSIPATH=$(shell which csi)
CKPATH=$(shell dirname $(shell dirname $(CSIPATH)))
# ARCHSTR=$(shell uname -m)_$(shell uname -r)
# BASH_MACHTYPE=$(shell bash -c "echo \$$MACHTYPE")
# ARCHSTR=$(BASH_MACHTYPE)_$(shell lsb_release -sr)
ARCHSTR=$(shell if [[ -e /usr/bin/sw_vers ]]; then /usr/bin/sw_vers -productVersion; else lsb_release -sr; fi)
# ARCHSTR=$(shell bash -c "echo \$$MACHTYPE")

PNGFILES = $(shell cd docs/manual;ls *png)

#all : $(PREFIX)/bin/.$(ARCHSTR) mtest dboard mtut ndboard
all : $(PREFIX)/bin/.$(ARCHSTR) mtest dboard mtut eggs

mtest: $(OFILES) readline-fix.scm megatest.o $(MOFILES) $(MTEGGS)
	csc $(CSCOPTS) $(OFILES) $(MOFILES) megatest.o -o mtest

showmtesthash:
	@echo $(MTESTHASH)

dboard : $(OFILES) $(GOFILES) dashboard.scm $(MOFILES)
	csc $(CSCOPTS) $(OFILES) dashboard.scm $(GOFILES) $(MOFILES) -o dboard
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

# setup the eggs dir in $PREFIX
#
$(MT_EGGS_DIR) :
	mkdir -p $(MT_EGGS_DIR)

$(MT_EGGS_DIR)/types.db : $(MT_EGGS_DIR)
	cp -rs $(CKREPOSITORY)/ $(MT_EGGS_BASE)/lib/chicken/

#	chicken-install -init $(MT_EGGS_DIR)

$(MT_EGGS_DIR)/mtconfigf.so : $(MT_EGGS_DIR)/types.db $(MTUTILS_DIR)/mtconfigf/mtconfigf.scm
	cd $(MTUTILS_DIR)/mtconfigf && chicken-install -prefix $(MT_EGGS_BASE)

#







|







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185

# setup the eggs dir in $PREFIX
#
$(MT_EGGS_DIR) :
	mkdir -p $(MT_EGGS_DIR)

$(MT_EGGS_DIR)/types.db : $(MT_EGGS_DIR)
	cp -rsf $(CKREPOSITORY)/ $(MT_EGGS_BASE)/lib/chicken/

#	chicken-install -init $(MT_EGGS_DIR)

$(MT_EGGS_DIR)/mtconfigf.so : $(MT_EGGS_DIR)/types.db $(MTUTILS_DIR)/mtconfigf/mtconfigf.scm
	cd $(MTUTILS_DIR)/mtconfigf && chicken-install -prefix $(MT_EGGS_BASE)

#

Modified cgisetup/models/pgdb.scm from [f29ecdedc5] to [644c3cf297].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;; 
;;     You should have received a copy of the GNU General Public License
;;     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

;;======================================================================

(declare (unit pgdb))
(declare (uses mtconfigf))
(import (prefix mtconfigf configf:))

;; I don't know how to mix compilation units and modules, so no module here.
;;
;; (module pgdb
;;     (
;;      open-pgdb
;;      )







|
|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;; 
;;     You should have received a copy of the GNU General Public License
;;     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

;;======================================================================

(declare (unit pgdb))
;;(declare (uses mtconfigf))
(use (prefix mtconfigf configf:))

;; I don't know how to mix compilation units and modules, so no module here.
;;
;; (module pgdb
;;     (
;;      open-pgdb
;;      )

Modified common.scm from [abcc1b341c] to [be9a9ca619].

24
25
26
27
28
29
30







































31
32
33
34
35
36
37
38
39
     matchable regex posix (srfi 18) extras ;; tcp 
     (prefix nanomsg nmsg:)
     (prefix sqlite3 sqlite3:)
     pkts (prefix dbi dbi:)
     )

(declare (unit common))







































(declare (uses mtconfigf))
(import (prefix mtconfigf configf:))

(include "common_records.scm")


;; (require-library margs)
;; (include "margs.scm")








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
     matchable regex posix (srfi 18) extras ;; tcp 
     (prefix nanomsg nmsg:)
     (prefix sqlite3 sqlite3:)
     pkts (prefix dbi dbi:)
     )

(declare (unit common))

(use posix-extras pathname-expand files)

;; this plugs a hole in posix-extras in recent chicken versions > 4.9)
(let-values (( (chicken-release-number chicken-major-version)
               (apply values
                      (map string->number
                           (take
                            (string-split (chicken-version) ".")
                            2)))))
  (let ((resolve-pathname-broken?
         (or (> chicken-release-number 4)
             (and (eq? 4 chicken-release-number) (> chicken-major-version 9)))))
    (if resolve-pathname-broken?
        (define ##sys#expand-home-path pathname-expand))))
      
(define (realpath x) (resolve-pathname  (pathname-expand (or x "/dev/null")) ))

(define (common:get-this-exe-fullpath #!key (argv (argv)))
  (let* ((this-script
          (cond
           ((and (> (length argv) 2)
                 (string-match "^(.*/csi|csi)$" (car argv))
                 (string-match "^-(s|ss|sx|script)$" (cadr argv)))
            (caddr argv))
           (else (car argv))))
         (fullpath (realpath this-script)))
    fullpath))
(define *common:this-exe-fullpath* (common:get-this-exe-fullpath))
(define *common:this-exe-dir*      (pathname-directory *common:this-exe-fullpath*))
(define *common:this-exe-name*     (pathname-strip-directory *common:this-exe-fullpath*))

(let* ((libpath (conc *common:this-exe-dir* "/../../eggs/lib/chicken/7")))
  (if (and (not (get-environment-variable "CHICKEN_REPOSITORY"))
           (directory-exists? libpath))
      (repository-path libpath)))



;;(declare (uses mtconfigf))
(use (prefix mtconfigf configf:))

(include "common_records.scm")


;; (require-library margs)
;; (include "margs.scm")

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237

(define *run-info-cache*     (make-hash-table)) ;; run info is stable, no need to reget
(define *launch-setup-mutex* (make-mutex))     ;; need to be able to call launch:setup often so mutex it and re-call the real deal only if *toppath* not set
(define *homehost-mutex*     (make-mutex))

;; Miscellaneous
(define *triggers-mutex*     (make-mutex))     ;; block overlapping processing of triggers

(use posix-extras pathname-expand files)

;; this plugs a hole in posix-extras in recent chicken versions > 4.9)
(let-values (( (chicken-release-number chicken-major-version)
               (apply values
                      (map string->number
                           (take
                            (string-split (chicken-version) ".")
                            2)))))
  (let ((resolve-pathname-broken?
         (or (> chicken-release-number 4)
             (and (eq? 4 chicken-release-number) (> chicken-major-version 9)))))
    (if resolve-pathname-broken?
        (define ##sys#expand-home-path pathname-expand))))
      
(define (realpath x) (resolve-pathname  (pathname-expand (or x "/dev/null")) ))

(define (common:get-this-exe-fullpath #!key (argv (argv)))
  (let* ((this-script
          (cond
           ((and (> (length argv) 2)
                 (string-match "^(.*/csi|csi)$" (car argv))
                 (string-match "^-(s|ss|sx|script)$" (cadr argv)))
            (caddr argv))
           (else (car argv))))
         (fullpath (realpath this-script)))
    fullpath))
(define *common:this-exe-fullpath* (common:get-this-exe-fullpath))
(define *common:this-exe-dir*      (pathname-directory *common:this-exe-fullpath*))
(define *common:this-exe-name*     (pathname-strip-directory *common:this-exe-fullpath*))






(defstruct remote
  (hh-dat            (common:get-homehost)) ;; homehost record ( addr . hhflag )







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







231
232
233
234
235
236
237
































238
239
240
241
242
243
244

(define *run-info-cache*     (make-hash-table)) ;; run info is stable, no need to reget
(define *launch-setup-mutex* (make-mutex))     ;; need to be able to call launch:setup often so mutex it and re-call the real deal only if *toppath* not set
(define *homehost-mutex*     (make-mutex))

;; Miscellaneous
(define *triggers-mutex*     (make-mutex))     ;; block overlapping processing of triggers





































(defstruct remote
  (hh-dat            (common:get-homehost)) ;; homehost record ( addr . hhflag )

Modified dashboard.scm from [cb1aa78dc2] to [687d67be40].

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

(declare (uses common))
(declare (uses margs))
(declare (uses keys))
(declare (uses items))
(declare (uses db))

(declare (uses mtconfigf))
(import (prefix mtconfigf configf:))

(declare (uses process))
(declare (uses launch))
(declare (uses runs))
(declare (uses dashboard-tests))
(declare (uses dashboard-guimonitor))
(declare (uses tree))







|
|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

(declare (uses common))
(declare (uses margs))
(declare (uses keys))
(declare (uses items))
(declare (uses db))

;;(declare (uses mtconfigf))
(use (prefix mtconfigf configf:))

(declare (uses process))
(declare (uses launch))
(declare (uses runs))
(declare (uses dashboard-tests))
(declare (uses dashboard-guimonitor))
(declare (uses tree))

Modified launch.scm from [2946ae3841] to [2f51eb8f10].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

(declare (unit launch))
(declare (uses subrun))
(declare (uses common))
;; (declare (uses configf))
(declare (uses db))

(declare (uses mtconfigf))
(import (prefix mtconfigf configf:))

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")

;;======================================================================
;; ezsteps







|
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

(declare (unit launch))
(declare (uses subrun))
(declare (uses common))
;; (declare (uses configf))
(declare (uses db))

;;(declare (uses mtconfigf))
(use (prefix mtconfigf configf:))

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")

;;======================================================================
;; ezsteps

Modified megatest.scm from [bcc6727fd2] to [7c5c594706].

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
(declare (uses mt))
(declare (uses api))
(declare (uses tasks)) ;; only used for debugging.
(declare (uses env))
(declare (uses diff-report))
(declare (uses ftail))
(import ftail)
(declare (uses mtconfigf))
(import (prefix mtconfigf configf:))

(define *db* #f) ;; this is only for the repl, do not use in general!!!!

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")







|
|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
(declare (uses mt))
(declare (uses api))
(declare (uses tasks)) ;; only used for debugging.
(declare (uses env))
(declare (uses diff-report))
(declare (uses ftail))
(import ftail)
;;(declare (uses mtconfigf))
(use (prefix mtconfigf configf:))

(define *db* #f) ;; this is only for the repl, do not use in general!!!!

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")

Modified mtut.scm from [d88a7425d4] to [8cda2487c9].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

(declare (uses common))
(declare (uses megatest-version))
(declare (uses margs))
;; (declare (uses rmt))

;; mtconfigf is compiled in as a compilation unit
(declare (uses mtconfigf))
(import (prefix mtconfigf configf:))

(use ducttape-lib)

(include "megatest-fossil-hash.scm")

(require-library stml)








|
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

(declare (uses common))
(declare (uses megatest-version))
(declare (uses margs))
;; (declare (uses rmt))

;; mtconfigf is compiled in as a compilation unit
;;(declare (uses mtconfigf))
(use (prefix mtconfigf configf:))

(use ducttape-lib)

(include "megatest-fossil-hash.scm")

(require-library stml)