[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. 

Running 

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-unit.rkt:493:9
/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?
      all-collections
      (check-against-all
       (apply
        append
        (map
         (lambda (c)
           (define elems (append-map (lambda (s) 
                                       (map string->path
                                            (regexp-split #rx"/" s)))
                                     c))
           (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 "/"))))
           ccs)
         x-specific-collections)))))

… 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" :)

John

-------------- 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.