Commit 8ac34859 authored by Eric Timmons's avatar Eric Timmons
Browse files

Reenable logical pathnames

However, make them optional.

This should give us the benefit of better stack traces when something goes
wrong in a deployed binary.
parent df041e1d
......@@ -13,6 +13,6 @@
:version (:read-file-form "src/clpm/version.lisp" :at (2 2))
:description "A Common Lisp Package Manager"
:license "BSD-2-Clause"
:pathname "src/clpm-build/"
:pathname #+clpm-logical-pathnames #p"clpm:src;clpm-build;" #-clpm-logical-pathnames "src/clpm-build/"
:class :package-inferred-system
:depends-on (#:clpm-build/clpm-build))
......@@ -13,7 +13,7 @@
:version (:read-file-form "src/clpm/version.lisp" :at (2 2))
:description "A Common Lisp Package Manager"
:license "BSD-2-Clause"
:pathname "src/clpm/"
:pathname #+clpm-logical-pathnames #p"clpm:src;clpm;" #-clpm-logical-pathnames "src/clpm/"
:class :package-inferred-system
:defsystem-depends-on (#:clpm-build #:deploy)
:entry-point "clpm/cli/entry:main"
......
(in-package :cl-user)
;; Configure our logical pathnames.
;;
;; When using SLIME, LOAD this file (C-c C-l), not COMPILE and LOAD (C-c C-k).
(let ((clpm-root (uiop:pathname-directory-pathname (uiop:ensure-absolute-pathname *load-pathname*))))
(setf (logical-pathname-translations "clpm")
`(("clpm:src;**;*.*.*" ,(merge-pathnames "src/**/*.*" clpm-root)))))
(pushnew :clpm-logical-pathnames *features*)
......@@ -10,6 +10,8 @@
(in-package #:clpm-scripts)
(load (merge-pathnames "../logical-pathname.lisp" *load-truename*))
(setup-asdf "default")
(asdf:load-system :s-xml)
......
......@@ -11,6 +11,9 @@
;; Load in ASDF.
(require :asdf)
;; Setup logical pathnames
(load (merge-pathnames "../logical-pathname.lisp" *load-truename*))
(defvar *setup-file-pathname* *load-truename*
"The pathname to this file.")
......@@ -23,6 +26,12 @@
"The pathname to the root of the build directory. Defaults to build/ inside
*ROOT-PATHNAME*")
(defun make-asdf-logical-pathname-translator (orig-fun)
(lambda (pn)
(if (typep pn 'logical-pathname)
(funcall orig-fun (translate-logical-pathname pn))
(funcall orig-fun pn))))
(defun setup-asdf (&optional (cache-dir ""))
(let ((build-cache (uiop:ensure-directory-pathname
(merge-pathnames (concatenate 'string "cl-cache/" cache-dir)
......@@ -33,4 +42,6 @@
(:tree ,*root-pathname*)))
(asdf:initialize-output-translations `(:output-translations
:ignore-inherited-configuration
(:root (,build-cache :implementation :**/ :*.*.*))))))
(:root (,build-cache :implementation :**/ :*.*.*))))
(setf asdf::*output-translation-function*
(make-asdf-logical-pathname-translator 'asdf:apply-output-translations))))
......@@ -36,6 +36,10 @@
(deploy:runtime-directory))))
(setf deploy:*data-location* (uiop:truenamize (uiop:ensure-directory-pathname
(uiop:ensure-absolute-pathname clpm-home))))
;; Fixup the logical pathnames
(when (uiop:featurep :clpm-logical-pathnames)
(setf (logical-pathname-translations "clpm")
`(("clpm:src;**;*.*.*" ,(merge-pathnames "src/**/*.*" deploy:*data-location*)))))
(setf *clpm-groveler-asd-pathname* (merge-pathnames "src/clpm-groveler/clpm-groveler.asd"
deploy:*data-location*))
(setf *clpm-client-asd-pathname* (merge-pathnames "src/clpm-client/clpm-client.asd"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment