Skip to content

Commit

Permalink
Fix building for 3.6.1.
Browse files Browse the repository at this point in the history
The pgloader-image feature must be added in the lisp image before
reading/compiling the pgloader sources for it to be useful.
  • Loading branch information
dimitri committed Jan 21, 2019
1 parent dae5dec commit 25c9378
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)'
Expand Down Expand Up @@ -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) \
Expand Down
5 changes: 4 additions & 1 deletion bundle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
10 changes: 7 additions & 3 deletions src/hooks.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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*)

Expand All @@ -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))
Expand All @@ -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)))
Expand All @@ -64,3 +67,4 @@
(asdf:find-system system-name)))
when (typep o 'asdf:load-source-op)
append (asdf:input-files o c)))
|#
5 changes: 5 additions & 0 deletions src/main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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*)
Expand Down
6 changes: 3 additions & 3 deletions src/params.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
3 changes: 2 additions & 1 deletion src/utils/monitor.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 25c9378

Please sign in to comment.