[plt-scheme] Problems and Questions converting to PLaneT

From: Williams, M. Douglas (M.DOUGLAS.WILLIAMS at saic.com)
Date: Thu Dec 29 10:16:21 EST 2005

I tested the PLaneT changes under Linux and they work there also.

 

  _____  

From: plt-scheme-bounces at list.cs.brown.edu
[mailto:plt-scheme-bounces at list.cs.brown.edu] On Behalf Of Williams, M.
Douglas
Sent: Wednesday, December 28, 2005 9:18 AM
To: plt-scheme
Subject: RE: [plt-scheme] Problems and Questions converting to PLaneT

 

There is also a problem in removing collections from the PLaneT cache.
Trying to remove the science.plt collection gives the following:

 

C:\Documents and Settings\williamsm\My Documents\Scheme\collects\300>planet
--re

move williams science.plt 2 0

with-input-from-file: cannot open input file: "C:\Documents and
Settings\william

sm\Application Data\PLT Scheme\cache.ss" (The system cannot find the file
specif

ied.; errno=2)

 

It seems the wrong path is being used for the cache.ss file.  Assuming it is
supposed to be in the planet directory, the following one-line change to
remove-infodomain-entries in the util.ss file in the planet collection seems
to fix it for me.  The old line (defining cache-file) is commented out and
the replacement inserted after it.  Once again, Jacob needs to look it over
and make sure this is correct and doesn't break anything else.

 

  ;; this really should go somewhere else. But what should setup's behavior
be

  ;; when a package is cleaned? should it clear info-domain entries out? I
think

  ;; no; an uncompiled package isn't necessarily not to be indexed and so
on.

  ;; remove-infodomain-entries : path -> void

  (define (remove-infodomain-entries path)

    (let* ([pathbytes (path->bytes path)]

           ;[cache-file (build-path (find-system-path 'addon-dir)
"cache.ss")]

           [cache-file (build-path (PLANET-DIR) "cache.ss")]

           [cache-lines (with-input-from-file cache-file read)])

      (with-output-to-file cache-file

       (lambda ()

         (if (pair? cache-lines)

             (write (filter (lambda (line) (not (and (pair? line) (equal?
(car line) pathbytes)))) cache-lines))

             (printf "\n")))

        'truncate/replace)))

 

No I can install (locally) and remove a collection with subcollections on
this particular machine, which happens to be running XP.  I will test it on
Linux this evening at home and make sure it works there.

 

Doug

 

  _____  

From: plt-scheme-bounces at list.cs.brown.edu
[mailto:plt-scheme-bounces at list.cs.brown.edu] On Behalf Of Williams, M.
Douglas
Sent: Tuesday, December 27, 2005 9:35 PM
To: plt-scheme
Subject: RE: [plt-scheme] Problems and Questions converting to PLaneT

 

I have a fix that, at least, works for my planet collection.  Jacob needs to
look it over and make sure it doesn't break anything else.  It also
addresses Eli's concern about not changing the info.ss language.  My info.ss
file is back to the original with compile-subcollections being a list of
list of strings:

 

(module info (lib "infotab.ss" "setup")

  (define name "PLT Scheme Science Collection")

  (define blurb

    (list "A collection of modules that provide functions for "

          "numerical computing."))

  (define categories '(scientific))

  (define doc.txt "doc.txt")

  (define primary-file "science-with-graphics.ss")

  (define version "2.0")

  (define compile-subcollections

    (list (list "special-functions")

          (list "random-distributions")))

)

 

The changes are limited to one routine (planet-cc->sub-cc) in the
setup-unit.ss file in the setup collection.  The new definition (with
replaced statements commented out and the replacement following it):

 

      ;; this is an awful hack

      (define (planet-cc->sub-cc cc subdir)

        (match-let ([(('planet owner pkg-file extra-path ...) maj min)
(cc-shadowing-policy cc)])

          (planet->cc 

           ;(build-path (cc-path cc) subdir)

           (apply build-path (cc-path cc) subdir)

           owner

           pkg-file

           ;(append extra-path (list (path->string subdir)))

           (append extra-path (list subdir))

           maj

           min)))

 

I guess I should suspect code that starts with such an ominous comment. :-)

 

With that change, the collection (and subcollections) correctly compiles
when it is installed using 'planet --file science.plt williams 2 0'.

 

Doug

 

  _____  

From: plt-scheme-bounces at list.cs.brown.edu
[mailto:plt-scheme-bounces at list.cs.brown.edu] On Behalf Of Williams, M.
Douglas
Sent: Tuesday, December 27, 2005 3:08 PM
To: plt-scheme
Subject: RE: [plt-scheme] Problems and Questions converting to PLaneT

 

Actually, I looked at the log file and now I have the following error
message related to the compilation:

setup-plt: Warning: ...tings\williamsm\Application Data\PLT
Scheme\planet\300\300\cache\williams\science.plt\2\0\info.ss:11:17: compile:
unbound variable in module in: string->path

 

Using the string->path fixed one problem and seems to have caused another.

 

Doug

 

  _____  

From: plt-scheme-bounces at list.cs.brown.edu
[mailto:plt-scheme-bounces at list.cs.brown.edu] On Behalf Of Williams, M.
Douglas
Sent: Tuesday, December 27, 2005 2:59 PM
To: plt-scheme
Subject: RE: [plt-scheme] Problems and Questions converting to PLaneT

 

Jacob, thanks for the answers.

 

One more question based on your answers.

>Now I just need to know if there is a convenient way to compile it - i.e.
something similar to compile-collection-zos when >something isn't actually
in the collection path.

>PLaneT for v300 automatically compiles .plt files when it installs them
(this is in contrast to PLaneT for v20x).

 

 

Shouldn't it also them compile the package when it's is installed using the
command line?  It doesn't in this case.

 

Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20051229/aaba9a61/attachment.html>

Posted on the users mailing list.