raco setup: don't completely ignore a collection without compilation

A collection's "info.rkt" might have `(define compile-omit-paths
'all)` but also other setup actions, so don't completely ignore
a collection directory just because there's nothing to compile.
This commit is contained in:
Matthew Flatt 2015-12-17 07:55:39 -07:00
parent ad1fe0c529
commit 074202bdd2

View File

@ -293,8 +293,6 @@
(setup-printf "WARNING" (setup-printf "WARNING"
"ignoring `compile-subcollections' entry in info ~a" "ignoring `compile-subcollections' entry in info ~a"
path-name)) path-name))
;; this check is also done in compiler/compiler, in compile-directory
(and (not (eq? 'all (omitted-paths path getinfo omit-root)))
(make-cc collection path (make-cc collection path
(if name (if name
(format "~a (~a)" path-name name) (format "~a (~a)" path-name name)
@ -304,7 +302,7 @@
omit-root omit-root
info-root info-path info-path-mode info-root info-path info-path-mode
shadowing-policy shadowing-policy
main?))) main?))
(define ((warning-handler v) exn) (define ((warning-handler v) exn)
(setup-printf "WARNING" "~a" (exn->string exn)) (setup-printf "WARNING" "~a" (exn->string exn))
@ -525,11 +523,14 @@
;; note: omit can be 'all, if this happens then this collection ;; note: omit can be 'all, if this happens then this collection
;; should not have been included, but we might jump in if a ;; should not have been included, but we might jump in if a
;; command-line argument specified a coll/subcoll ;; command-line argument specified a coll/subcoll
(define omit (append (define omit (let ([omit (omitted-paths ccp getinfo (cc-omit-root cc))])
(if (eq? omit 'all)
'all
(append
(if make-docs? (if make-docs?
null null
(list (string->path "scribblings"))) (list (string->path "scribblings")))
(omitted-paths ccp getinfo (cc-omit-root cc)))) omit))))
(define-values [dirs files] (define-values [dirs files]
(if (eq? 'all omit) (if (eq? 'all omit)
(values null null) (values null null)
@ -542,7 +543,8 @@
(define srcs (define srcs
(append (append
(filter has-module-suffix? files) (filter has-module-suffix? files)
(if make-docs? (if (and make-docs?
(not (eq? omit 'all)))
(filter (lambda (p) (not (member p omit))) (filter (lambda (p) (not (member p omit)))
(map (lambda (s) (if (string? s) (string->path s) s)) (map (lambda (s) (if (string? s) (string->path s) s))
(map car (call-info info 'scribblings (map car (call-info info 'scribblings
@ -663,9 +665,9 @@
;; let `collection-path' complain about the name, if that's the problem: ;; let `collection-path' complain about the name, if that's the problem:
(with-handlers ([exn? (compose1 raise-user-error exn-message)]) (with-handlers ([exn? (compose1 raise-user-error exn-message)])
(apply collection-path elems)) (apply collection-path elems))
;; otherwise, it's probably a collection with nothing to compile ;; otherwise, it's probably a collection with nothing to compile;
;; spell the name ;; spell the name
(setup-printf "WARNING" (setup-printf "warning"
"nothing to compile in a given collection path: \"~a\"" "nothing to compile in a given collection path: \"~a\""
(string-join sc "/"))) (string-join sc "/")))
ccs) ccs)