From 25c937879affdfffb37210b8dc125de86b1db7e2 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Mon, 21 Jan 2019 15:02:39 +0100 Subject: [PATCH] Fix building for 3.6.1. The pgloader-image feature must be added in the lisp image before reading/compiling the pgloader sources for it to be useful. --- Makefile | 14 ++++++++++---- bundle/Makefile | 5 ++++- src/hooks.lisp | 10 +++++++--- src/main.lisp | 5 +++++ src/params.lisp | 6 +++--- src/utils/monitor.lisp | 3 ++- 6 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index f077847c..42511f5e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # pgloader build tool APP_NAME = pgloader -VERSION = 3.6.0 +VERSION = 3.6.1 # use either sbcl or ccl CL = sbcl @@ -24,7 +24,7 @@ QLDIR = $(BUILDDIR)/quicklisp MANIFEST = $(BUILDDIR)/manifest.ql LATEST = $(BUILDDIR)/pgloader-latest.tgz -BUNDLEDIST = 2018-10-18 +BUNDLEDIST = 2019-01-07 BUNDLENAME = pgloader-bundle-$(VERSION) BUNDLEDIR = $(BUILDDIR)/bundle/$(BUNDLENAME) BUNDLE = $(BUILDDIR)/$(BUNDLENAME).tgz @@ -99,8 +99,11 @@ clones: $(QLDIR)/local-projects/cl-ixf \ $(QLDIR)/local-projects/cl-csv \ $(QLDIR)/local-projects/qmynd ; -$(LIBS): $(QLDIR)/setup.lisp clones +$(LIBS): $(QLDIR)/setup.lisp $(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \ + --eval '(push :pgloader-image *features*)' \ + --eval '(setf *print-circle* t *print-pretty* t)' \ + --eval '(ql:quickload "pgloader")' \ --eval '(push "$(PWD)/" ql:*local-project-directories*)' \ --eval '(ql:quickload "pgloader")' \ --eval '(quit)' @@ -141,8 +144,11 @@ $(PGLOADER): $(MANIFEST) $(BUILDAPP) $(LISP_SRC) --manifest-file $(MANIFEST) \ --asdf-tree $(QLDIR)/dists \ --asdf-path . \ - --load-system $(APP_NAME) \ + --load-system cffi \ + --load-system cl+ssl \ + --load-system mssql \ --load src/hooks.lisp \ + --load-system $(APP_NAME) \ --entry pgloader:main \ --dynamic-space-size $(DYNSIZE) \ $(COMPRESS_CORE_OPT) \ diff --git a/bundle/Makefile b/bundle/Makefile index 9102bd40..fbeae718 100644 --- a/bundle/Makefile +++ b/bundle/Makefile @@ -48,9 +48,12 @@ $(PGLOADER): $(BUILDAPP) $(BUILDAPP_OPTS) \ --sbcl $(CL) \ --asdf-tree . \ + --load-system cffi \ + --load-system cl+ssl \ + --load-system mssql \ + --load $(SRCDIR)/src/hooks.lisp \ --load-system $(APP_NAME) \ --eval '(setf pgloader.params::*version-string* "$(VERSION)")' \ - --load $(SRCDIR)/src/hooks.lisp \ --entry pgloader:main \ --dynamic-space-size $(DYNSIZE) \ $(COMPRESS_CORE_OPT) \ diff --git a/src/hooks.lisp b/src/hooks.lisp index 62c878b8..c8cf1bc7 100644 --- a/src/hooks.lisp +++ b/src/hooks.lisp @@ -9,6 +9,8 @@ ;;; :cl+ssl in its system definition. ;;; +(in-package #:cl-user) + ;; So that we can #+pgloader-image some code away, see main.lisp (push :pgloader-image *features*) @@ -18,9 +20,6 @@ ;;; (setf *print-circle* t *print-pretty* t) - -(in-package #:cl-user) - (defun close-foreign-libs () "Close Foreign libs in use by pgloader at application save time." (let (#+sbcl (sb-ext:*muffled-warnings* 'style-warning)) @@ -47,6 +46,10 @@ ;;; Register all loaded systems in the image, so that ASDF don't search for ;;; them again when doing --self-upgrade ;;; + +;;; FIXME: this idea kept failing. + +#| (defun register-preloaded-system (system) (unless (string= "pgloader" (asdf::coerce-name system)) (let ((version (slot-value system 'asdf::version))) @@ -64,3 +67,4 @@ (asdf:find-system system-name))) when (typep o 'asdf:load-source-op) append (asdf:input-files o c))) +|# diff --git a/src/main.lisp b/src/main.lisp index c8e43f7c..ba75c049 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -243,6 +243,11 @@ ;; Then process options (when debug + (format t "pgloader version ~a~%" *version-string*) + #+pgloader-image + (format t "compiled with ~a ~a~%" + (lisp-implementation-type) + (lisp-implementation-version)) #+sbcl (format t "sb-impl::*default-external-format* ~s~%" sb-impl::*default-external-format*) diff --git a/src/params.lisp b/src/params.lisp index 8080dd78..60a754b5 100644 --- a/src/params.lisp +++ b/src/params.lisp @@ -40,11 +40,11 @@ (in-package :pgloader.params) -(defparameter *release* nil +(defparameter *release* t "non-nil when this build is a release build.") -(defparameter *major-version* "3.5") -(defparameter *minor-version* "2") +(defparameter *major-version* "3.6") +(defparameter *minor-version* "1") (defun git-hash () "Return the current abbreviated git hash of the development tree." diff --git a/src/utils/monitor.lisp b/src/utils/monitor.lisp index c56652d6..696eb505 100644 --- a/src/utils/monitor.lisp +++ b/src/utils/monitor.lisp @@ -214,7 +214,8 @@ (start (when (start-start-logger event) (pgloader.logs:start-logger)) - (cl-log:log-message :info "Starting monitor")) + (cl-log:log-message :info "Starting monitor") + (cl-log:log-message :log "pgloader version ~s" *version-string*)) (stop (cl-log:log-message :info "Stopping monitor")