scsh-users
[Top] [All Lists]

Re: Install lib and development (solved!)

To: scsh <scsh-users@scsh.net>
Subject: Re: Install lib and development (solved!)
From: Anthony Carrico <acarrico@memebeam.org>
Date: Thu, 11 Jan 2007 12:50:40 -0500
List-id: <scsh-users.list-id.scsh.net>
On Thu, Jan 11, 2007 at 08:24:05AM +0100, Michael Sperber wrote:
> I'm still fuzzy on what you're trying to do.  What's in
> module-system/load.scm?

You suggested I use RT-MODULES, that is its load file (generated by
Michel Schinz's install library).

> There, the quoting looks as though it's responsible for the error
> you're getting.  Shouldn't you be doing something like:
> 
> (define load-location
>   '(user
>     (run
>      (find-library-file 'module-system/load.scm" (lib-dirs) #f))))
> (load load-location)

This doesn't quite work, but you have solved my problem! I didn't
realize there was a 'define' in the command language.

> Sorry if I seem dense ...

Or me. Either way we have stumbled on the answer. Now I'll show a
concrete version of what I originally proposed:

Suppose I was fixing a bug in your cml library. I might temporarily
change my library path to use the development version:

SCSH_LIB_DIR='#f "/home/acarrico/src/sunterlib/s48/"

But this doesn't work, since any application would have include:

  -lel cml/load.scm

but the development version isn't "installed", so load.scm doesn't
exist. The load file is generated by cml's pkg-def.scm:

/home/acarrico/src/sunterlib/s48/cml/pkg-def.scm:
  ...
  (define-package "cml"
    (1 1)
    ((install-lib-version (1 3 0)))
    (write-to-load-script
     `((config)
       (load ,(absolute-file-name "packages.scm"
                                  (get-directory 'scheme #f)))))
    ...)
  ...

To solve this problem, I could add a "development time" version like
this:

/home/acarrico/src/sunterlib/s48/cml/load.scm:
  (config)
  (load "/home/acarrico/src/sunterlib/s48/cml/packages.scm")

This would work for me, but if I put this file in source control, it
would fail for you since the wrong path would be hard coded.

The better solution is what we have been trying to discuss:

/home/acarrico/src/sunterlib/s48/cml/load.scm:

  (user)
  (define library-load-pathname
    (run '(find-library-file "cml/packages.scm" (lib-dirs) #f)))
  (config)
  (load library-load-pathname)

This would work for me and you and anyone else since the path is
relative.

-- 
Anthony Carrico
http://giftfile.org/

<Prev in Thread] Current Thread [Next in Thread>