On Fri, Feb 22, 2013 at 3:58 PM, Mark Evenson <evenson@panix.com> wrote:
On 2/22/13 4:01 PM, Xiaofeng Yang wrote:
> Hi, all
>
> I built ABCL 1.1.1 using Ant. After I built it, I found that the source
> locations of all the symbols are absolute path. For exmaple:
> [1] CL-USER(1): (symbol-plist 'defun)
> (SYSTEM::%SOURCE
> (#P"L:/abcl-src-1.1.1/src/org/armedbear/lisp/precompiler.lisp" . 44441)
> PRECOMPILER::PRECOMPILE-HANDLER PRECOMPILER::PRECOMPILE-DEFUN)
>
> I tried  using '--nosystem', setting (LOGICAL-PATHNAME-TRANSLATIONS
> "sys") by myself, and even deleting system.lisp from the jar. But the
> source location didn't change.
>
> How can I build ABCL 1.1.1 without recording the absolute path of the
> source ? Or, making the source location changable so that I can locate
> it even if I change the path of the source code ? I think I can do it
> manually by i.g.
> (dolist (pkg (list-all-packages))
>   (do-symbols (sym pkg)
>              if there exists system::%source in symbol-plist, replace it)).
> Is there any other way to do this ?

Currently, there is no way of building to not recording the physical
pathname, but there should be.  The values stored in the symbol plists
should use the SYS:SRC logical pathname.  I've recorded this as ticket
[#301][].

Make sure this works with slime. IIRC slime doesn't understand logical pathnames as source locations currently. FWIW I've used the below to adjust the source pointers in the past.

(defun fix-abcl-src-pointers () 
  (do-all-symbols (sym) 
    (let ((s (get sym 'system::%source)))
      (when (and s (consp s) (pathnamep (car s)) (search '("org" "armedbear") (pathname-directory (car s)) :test 'equal))
(let ((new-pname 
      (cond ((find #\! (namestring (car s)))
     (format nil "abcl-src:~a"
     (substitute #\; #\/ 
 (subseq (namestring (car s))
 (+ 2 (position #\! (namestring (car s))))))
     ))
    ((position "src" (pathname-directory (car s)) :test 'equal)
     (format nil "abcl-src:~{~A;~}~a.~a"
     (subseq (pathname-directory (car s))
     (1+ (position "src" (pathname-directory (car s)) :test 'equal)))
     (pathname-name (car s))
     (pathname-type (car s)))))))
 (when new-pname
   (setf (car s) (translate-logical-pathname new-pname)))
 )))))

I define the logical pathname ABCL-SRC to be wherever the src directory is, e.g
(setf (logical-pathname-translations "abcl-src")
      `(("**;*.*" "/Users/alanr/repos/abcl/src/**/*.*")))





[#301]: http://trac.common-lisp.net/armedbear/ticket/301

--

"A screaming comes across the sky.  It has happened before, but there is
nothing to compare it to now."



_______________________________________________
armedbear-devel mailing list
armedbear-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel