[xcvb-devel] Requirement for SB-SPROF

Samium Gromoff _deepfire at feelingofgreen.ru
Wed Oct 14 00:36:01 UTC 2009


From: Faré <fahree at gmail.com>
> while I would certainly recommend that you should build the very
> useful sb-sprof into your sbcl, it is very possible to disable the use
> of sb-sprof in XCVB, that is only useful to XCVB developers anyway
> (i.e. me). Happily for you, references to sb-sprof are restricted to
> 1- xcvb.asd, and 2- profiling.lisp.
>
> You can just comment out the references to sb-sprof in xcvb.asd and
> profiling.lisp, and making sure the code there that is currently
> #+sbcl be disabled instead (e.g. in #| ... |#) and
> the code that is currently #-sbcl be always enabled (e.g. #| #-sbcl
> |#). Don't forget to also comment out the (:when (:featurep :sbcl)
> (:require :sb-sprof)).

Yes, I'm very well aware this can be sidestepped. What I was worrying
about, chiefly, was how it affects other prospective users.

Upon a closer inspection I realised that I did, indeed, have sb-sprof
built and properly installed, but also that two factors were at play,
preventing it from being loaded:

  1. SBCL_HOME was unset (the typical default), and
  2. I was running a manually produced core

This resulted in (sb-int:sbcl-homedir-pathname) returning a location
which didn't contain the fasls for extensions.
 
> If you know a good test of whether the sb-sprof feature is available,
> I'm interested.

Having polluted the list with a non-problem, I felt an obligation
to offset the damage with something useful, and looked that question up.

So, SB-IMPL::MODULE-PROVIDE-CONTRIB, modulo the load-the-thing part
is, currently, the proper check for contrib availability on SBCL.

That is:

(defun module-contrib-available-p (name)
  "Stringify and downcase NAME, then attempt to load the file
   $SBCL_HOME/name/name"
  (let* ((filesys-name (string-downcase (string name)))
         (unadorned-path
          (merge-pathnames
           (make-pathname :directory (list :relative filesys-name)
                          :name filesys-name)
           (truename (or (sbcl-homedir-pathname)
                         (return-from module-provide-contrib nil)))))
         (fasl-path (merge-pathnames
                     (make-pathname :type *fasl-file-type*)
                     unadorned-path))
         (lisp-path (merge-pathnames (make-pathname :type "lisp")
                                     unadorned-path)))
    (or (probe-file unadorned-path)
        (probe-file fasl-path)
        (probe-file lisp-path))))


regards,
  Samium Gromoff
--
                                 _deepfire-at-feelingofgreen.ru
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org


More information about the xcvb-devel mailing list