Re: [racket-dev] [plt] Push #29677: master branch updated

2015-01-31 Thread Matthew Flatt
I noticed when I made that change that the .dep format is still not
documented anywhere. I'll document it soon.

Here's a first cut at the grammar of the value that is stored in a
.dep file via `write`:

 deps = (list version-string
(cons hash-of-source hash-of-dependencies)
dep ...)
 dep = (cons 'indirect direct-dep)
   | direct-dep
 direct-dep = (cons 'ext plain-dep) ; non-module dependency
  | plain-dep ; module dependency
 plain-dep = (cons 'collects byte-string) ; a collection-relative path
 | byte-string  ; other path (not portable)
   

At Fri, 30 Jan 2015 22:29:11 -0800, Eric Dobson wrote:
 This change seemed to change the format of .dep files, likely as intended
 to add the indirect dependencies. Is there any documentation of what the
 format is supposed to be? Currently I've just been trying to read cm.rkt
 and understand how it treats them.
 
 On Thu, Jan 8, 2015 at 9:31 AM, mfl...@racket-lang.org wrote:
 
  mflatt has updated `master' from c56c9250f1 to 95e85ec5bd.
http://git.racket-lang.org/plt/c56c9250f1..95e85ec5bd
 
  =[ 2 Commits ]==
  Directory summary:
45.1% pkgs/racket-doc/scribblings/raco/
 4.7% pkgs/racket-doc/scribblings/reference/
47.5% racket/collects/compiler/
 
  ~~
 
  fe9a04d Matthew Flatt mfl...@racket-lang.org 2015-01-08 09:11
  :
  | doc tweaks for `raco {setup,make}`
  :
M pkgs/racket-doc/scribblings/raco/make.scrbl  |  4 ++--
M pkgs/racket-doc/scribblings/raco/setup.scrbl | 22
  --
 
  ~~
 
  95e85ec Matthew Flatt mfl...@racket-lang.org 2015-01-08 09:57
  :
  | add support for indirect CM dependencies; use in `lazy-require`
  |
  | If module M in package P imports module N from package Q,
  | and if N has a `lazy-require` for a module in R that is
  | triggered during the compilation of M, then P doesn't really
  | depend on R; P depends on Q, and Q depends on R, and P
  | shoudn't necessarily know anything about Q. At the same time,
  | a change to the file in R means that M must be recompiled.
  | So, continue to track the compilation dependency, but mark
  | it as indirect so that the package-dependency checker can
  | ignore the dependency.
  :
M pkgs/racket-doc/scribblings/raco/make.scrbl   | 33 -
M racket/collects/compiler/cm-accomplice.rkt| 14 +++---
M racket/collects/compiler/cm.rkt   | 49
  ++--
M racket/collects/racket/lazy-require.rkt   |  2 +-
M racket/collects/setup/private/pkg-deps.rkt|  1 +
M .../racket-doc/scribblings/reference/syntax.scrbl |  8 ++--
 
  =[ Overall Diff ]===
 
  pkgs/racket-doc/scribblings/raco/make.scrbl
  ~~~
  --- OLD/pkgs/racket-doc/scribblings/raco/make.scrbl
  +++ NEW/pkgs/racket-doc/scribblings/raco/make.scrbl
  @@ -123,7 +123,7 @@ would create only @filepath{compiled/b_rkt.zo} and
 
   @; --
 
  -@section{Dependency Files}
  +@section[#:tag Dependency Files]{Dependency Files}
 
   In addition to a bytecode file, @exec{raco make} creates a file
   @filepath{compiled/@nonterm{name}_@nonterm{ext}.dep} that records
  @@ -538,7 +538,7 @@ messages are instances of a
  @racket[parallel-compile-event] prefab structure:
 
   @racketblock[
 (struct parallel-compile-event (worker event) #:prefab)
  -].
  +]
 
   The worker field is the index of the worker that the created the event.
  The event
   field is a @racket[compile-event] as document in
  @@ -550,25 +550,36 @@ field is a @racket[compile-event] as document in
 
   @defmodule[compiler/cm-accomplice]
 
  -@defproc[(register-external-file [file (and path? complete-path?)])
  void?]{
  +@defproc[(register-external-file [file (and path? complete-path?)]
  + [#:indirect? indirect? any/c #f])
  + void?]{
 
  -Logs a message (see @racket[log-message]) at level @racket['info] to
  -a logger named @racket['cm-accomplice]. The
  -message data is a @racketidfont{file-dependency} prefab structure type
  -with two fields; the first field's value is @racket[file] and the second
  -field's value is @racket[#f] (to indicate a non-module dependency).
  +Logs a message (see @racket[log-message]) at level @racket['info] to a
  +logger named @racket['cm-accomplice]. The message data is a
  +@racketidfont{file-dependency} prefab structure type with two fields;
  +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
  

Re: [racket-dev] [plt] Push #29677: master branch updated

2015-01-30 Thread Eric Dobson
This change seemed to change the format of .dep files, likely as intended
to add the indirect dependencies. Is there any documentation of what the
format is supposed to be? Currently I've just been trying to read cm.rkt
and understand how it treats them.

On Thu, Jan 8, 2015 at 9:31 AM, mfl...@racket-lang.org wrote:

 mflatt has updated `master' from c56c9250f1 to 95e85ec5bd.
   http://git.racket-lang.org/plt/c56c9250f1..95e85ec5bd

 =[ 2 Commits ]==
 Directory summary:
   45.1% pkgs/racket-doc/scribblings/raco/
4.7% pkgs/racket-doc/scribblings/reference/
   47.5% racket/collects/compiler/

 ~~

 fe9a04d Matthew Flatt mfl...@racket-lang.org 2015-01-08 09:11
 :
 | doc tweaks for `raco {setup,make}`
 :
   M pkgs/racket-doc/scribblings/raco/make.scrbl  |  4 ++--
   M pkgs/racket-doc/scribblings/raco/setup.scrbl | 22
 --

 ~~

 95e85ec Matthew Flatt mfl...@racket-lang.org 2015-01-08 09:57
 :
 | add support for indirect CM dependencies; use in `lazy-require`
 |
 | If module M in package P imports module N from package Q,
 | and if N has a `lazy-require` for a module in R that is
 | triggered during the compilation of M, then P doesn't really
 | depend on R; P depends on Q, and Q depends on R, and P
 | shoudn't necessarily know anything about Q. At the same time,
 | a change to the file in R means that M must be recompiled.
 | So, continue to track the compilation dependency, but mark
 | it as indirect so that the package-dependency checker can
 | ignore the dependency.
 :
   M pkgs/racket-doc/scribblings/raco/make.scrbl   | 33 -
   M racket/collects/compiler/cm-accomplice.rkt| 14 +++---
   M racket/collects/compiler/cm.rkt   | 49
 ++--
   M racket/collects/racket/lazy-require.rkt   |  2 +-
   M racket/collects/setup/private/pkg-deps.rkt|  1 +
   M .../racket-doc/scribblings/reference/syntax.scrbl |  8 ++--

 =[ Overall Diff ]===

 pkgs/racket-doc/scribblings/raco/make.scrbl
 ~~~
 --- OLD/pkgs/racket-doc/scribblings/raco/make.scrbl
 +++ NEW/pkgs/racket-doc/scribblings/raco/make.scrbl
 @@ -123,7 +123,7 @@ would create only @filepath{compiled/b_rkt.zo} and

  @; --

 -@section{Dependency Files}
 +@section[#:tag Dependency Files]{Dependency Files}

  In addition to a bytecode file, @exec{raco make} creates a file
  @filepath{compiled/@nonterm{name}_@nonterm{ext}.dep} that records
 @@ -538,7 +538,7 @@ messages are instances of a
 @racket[parallel-compile-event] prefab structure:

  @racketblock[
(struct parallel-compile-event (worker event) #:prefab)
 -].
 +]

  The worker field is the index of the worker that the created the event.
 The event
  field is a @racket[compile-event] as document in
 @@ -550,25 +550,36 @@ field is a @racket[compile-event] as document in

  @defmodule[compiler/cm-accomplice]

 -@defproc[(register-external-file [file (and path? complete-path?)])
 void?]{
 +@defproc[(register-external-file [file (and path? complete-path?)]
 + [#:indirect? indirect? any/c #f])
 + void?]{

 -Logs a message (see @racket[log-message]) at level @racket['info] to
 -a logger named @racket['cm-accomplice]. The
 -message data is a @racketidfont{file-dependency} prefab structure type
 -with two fields; the first field's value is @racket[file] and the second
 -field's value is @racket[#f] (to indicate a non-module dependency).
 +Logs a message (see @racket[log-message]) at level @racket['info] to a
 +logger named @racket['cm-accomplice]. The message data is a
 +@racketidfont{file-dependency} prefab structure type with two fields;
 +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.

  A compilation manager implemented by @racketmodname[compiler/cm] looks
 -for such messages to register an external dependency. The compilation
 -manager records (in a @filepath{.dep} file) the path as contributing
 -to the implementation of the module currently being
 +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.
 +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