diff --git a/pkgs/racket-doc/scribblings/raco/make.scrbl b/pkgs/racket-doc/scribblings/raco/make.scrbl index 5c0c895b90..b98b4dc483 100644 --- a/pkgs/racket-doc/scribblings/raco/make.scrbl +++ b/pkgs/racket-doc/scribblings/raco/make.scrbl @@ -560,16 +560,16 @@ logger named @racket['cm-accomplice]. The message data is a the first field's value is @racket[file] and the second field's value is @racket[#f] (to indicate a non-module dependency). If the @racket[indirect?] argument is true, the data is more specifically an -instance of a @racketidfont{file-dependency/indirect} prefab structure -type that is a subtype of @racketidfont{file-dependency} with no new -fields. +instance of a @racketidfont{file-dependency/options} prefab structure +type that is a subtype of @racketidfont{file-dependency} with one extra +field: a hash table mapping @racket['indirect] to @racket[#t]. A compilation manager implemented by @racketmodname[compiler/cm] looks for such messages to register an external dependency. In response, the compilation manager records (in a @filepath{.dep} file) the path as contributing to the implementation of the module currently being compiled. Afterward, if the registered file is modified, the -compilation manager will know to recompile the module. An ``indirect'' +compilation manager will know to recompile the module. An indirect dependency has no effect on recompilation, but it can signal to other tools, such as a package-dependency checker, that the dependency is indirect (and should not imply a direct package dependency). diff --git a/racket/collects/compiler/cm-accomplice.rkt b/racket/collects/compiler/cm-accomplice.rkt index 4278472059..7cc80e9d29 100644 --- a/racket/collects/compiler/cm-accomplice.rkt +++ b/racket/collects/compiler/cm-accomplice.rkt @@ -16,5 +16,6 @@ 'cm-accomplice (format "file dependency: ~s" f) (if indirect? - `#s((file-dependency/indirect file-dependency 2) ,f ,module?) + `#s((file-dependency/options file-dependency 2) ,f ,module? + #hasheq((indirect . #t))) `#s(file-dependency ,f ,module?)))) diff --git a/racket/collects/compiler/cm.rkt b/racket/collects/compiler/cm.rkt index 6526845e16..de97ea30ea 100644 --- a/racket/collects/compiler/cm.rkt +++ b/racket/collects/compiler/cm.rkt @@ -317,7 +317,7 @@ (define-struct ext-reader-guard (proc top) #:property prop:procedure (struct-field-index proc)) (define-struct file-dependency (path module?) #:prefab) -(define-struct (file-dependency/indirect file-dependency) () #:prefab) +(define-struct (file-dependency/options file-dependency) (table) #:prefab) (define (compile-zo* mode roots path src-sha1 read-src-syntax zo-name up-to-date collection-cache) ;; The `path' argument has been converted to .rkt or .ss form, @@ -398,7 +398,10 @@ (path? (file-dependency-path (vector-ref l 2)))) (external-dep! (file-dependency-path (vector-ref l 2)) (file-dependency-module? (vector-ref l 2)) - (file-dependency/indirect? (vector-ref l 2)))) + (and (file-dependency/options? (vector-ref l 2)) + (hash-ref (file-dependency/options-table (vector-ref l 2)) + 'indirect + #f)))) (loop)))) ;; Write the code and dependencies: