[racket-dev] race setup tests gives wrong error message, best way to fix?

From: John Clements (clements at brinckerhoff.org)
Date: Thu May 10 12:59:03 EDT 2012

Apologies in advance if this is a known or fixed issue. 


raco setup tests

gives the following error message:

raco setup: given collection path: "tests" is not in canonical form (e.g., wrong case on a case-insensitive filesystem)

 === context ===
/Users/clements/plt/collects/setup/setup-go.rkt: [running body]
/Users/clements/plt/collects/setup/main.rkt: [running body]
/Users/clements/plt/collects/raco/main.rkt: [running body]

This seemed crazy, so I grepped for the error message, and sure enough, I got this :

 (define top-level-plt-collects
    (if no-specific-collections?
         (lambda (c)
           (define elems (append-map (lambda (s) 
                                       (map string->path
                                            (regexp-split #rx"/" s)))
           (define ccs
             (collection->ccs elems))
           (when (null? ccs)
             ;; let `collection-path' complain about the name, if that's the problem:
             (apply collection-path elems)
             ;; otherwise, it must be an issue with different ways to
             ;; spell the name
             (error name-sym
                    (error name-sym
                     "given collection path: \"~a\" is not in canonical form (e.g., wrong case on a case-insensitive filesystem)"
                     (string-join c "/"))))

… Note that the error message I saw is a fall-through case, when the given names don't appear in the hash table.  I'm guessing that "tests" is explicitly excluded from this table some where (though it doesn't seem to be in this file). I see a couple of possible fixes.

1) Add a new table representing collections that aren't normally compiled but can be explicitly chosen,
2) provide a better error message by special-casing it here,
3) go back to automatically compiling "tests" :)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120510/df9b0c0d/attachment.p7s>

Posted on the dev mailing list.