<div dir="ltr">Thanks!<div><br></div><div style>re: current-directory-for-user: I also don't see a better way. Probably the docs should say "don't set this path", roughly (with some caveats that would include things like drracket) and if only we'd written similar docs for current-directory back in the day ....</div>
<div style><br></div><div style>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 29, 2013 at 12:01 PM, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">All correct.<br>
<br>
As it happens, though, I had to tweak the module-loading handler stack<br>
to add "missing-module" exception support (for the package system).<br>
Those changes make a source location possible in many cases<br>
(intentionally), but I hadn't taken the last step of including<br>
locations in the error-message text.<br>
<br>
I've implemented the last step, now, and I think the example below will<br>
now show a source location.<br>
<br>
<br>
While I'm here, a related problem is that source location paths have<br>
been shown relative to `current-directory', but `raco setup' and other<br>
things change `current-directory' in a way that sometimes obscures the<br>
path. For example, an error might be reported for "main.rkt", in which<br>
case it may take a while to sort out which "main.rkt" is relevant.<br>
<br>
As an experiment, I've added `current-directory-for-user', which is<br>
initialized the same as `current-directory' and used to print<br>
source-location paths. Errors from `raco setup' are then reported<br>
relative to the initial directory, while DrRacket can set<br>
`current-directory-for-user' to keep paths relative to the directory of<br>
the main file. I'm not sure that adding Even More Stuff is a good idea,<br>
though.<br>
<div class="HOEnZb"><div class="h5"><br>
At Tue, 28 May 2013 11:25:50 -0500, Robby Findler wrote:<br>
> IIUC, the problem is that the source location information (for the require)<br>
> is no longer present when the filesystem access happens that turns into the<br>
> error.<br>
><br>
> It is not those particular multiple parts of the system (raco, cm, tr) but<br>
> I think it is a non-trivial change, all inside the core. Also, IIUC, the<br>
> change leaks out and requires a change to publicly visible parts of the<br>
> infrastructure (the module name resolver). I'm not sure about that, but I<br>
> think that's also an obstacle.<br>
><br>
> Robby<br>
><br>
><br>
><br>
> On Tue, May 28, 2013 at 11:15 AM, Ray Racine <<a href="mailto:ray.racine@gmail.com">ray.racine@gmail.com</a>> wrote:<br>
><br>
> > I've created a mini-collection out on Github.<br>
> > <a href="https://github.com/RayRacine/tlib.git" target="_blank">https://github.com/RayRacine/tlib.git</a><br>
> ><br>
> > Consider the single collection, c1, with 4 modules.<br>
> ><br>
> > m1.rkt -> m1a.rkt -> m1aa.rkt<br>
> > m2.rkt<br>
> ><br>
> > Where m1 depends on m1a, m1a on m1aa and m2 had no dependencies.<br>
> ><br>
> > --> raco link /code/tlib/c1<br>
> > --> raco link -l<br>
> > User links:<br>
> > collection: "c1" path: "/code/tlib/c1"<br>
> > Installation links:<br>
> ><br>
> > --> raco setup c1<br>
> > <stuff><br>
> ><br>
> > Completes without error.<br>
> ><br>
> > Now imagine one performs some amount of intra-collection module<br>
> > refactoring, module renamings, splitting and combing modules etc.<br>
> ><br>
> > We simulate this activity with a single modification to the require in<br>
> > m1.rkt to a now non-existent module.<br>
> ><br>
> > ;;Change<br>
> > (require<br>
> > (only-in "m1a.rkt"<br>
> > c1-m1a-v1))<br>
> ><br>
> > ;; to<br>
> ><br>
> > (require<br>
> > (only-in "m1x.rkt"<br>
> > c1-m1a-v1))<br>
> ><br>
> > Build the refactored collection.<br>
> ><br>
> > --> raco setup c1<br>
> > raco setup: version: 5.3.4.10 [3m]<br>
> > raco setup: variants: 3m<br>
> > raco setup: main collects: /usr/local/racket/collects<br>
> > raco setup: collects paths:<br>
> > raco setup: /home/ray/.racket/<a href="http://5.3.4.10/collects" target="_blank">5.3.4.10/collects</a><br>
> > raco setup: /usr/local/racket/collects<br>
> > raco setup: --- pre-installing collections ---<br>
> > raco setup: --- installing foreign libraries ---<br>
> > raco setup: --- compiling collections ---<br>
> > raco setup: --- parallel build using 8 processes ---<br>
> > raco setup: 7 making: /code/tlib/c1<br>
> > default-load-handler: cannot open module file<br>
> > module path: #<path:/code/tlib/c1/m1x.rkt><br>
> > path: /code/tlib/c1/m1x.rkt<br>
> > system error: No such file or directory; errno=2<br>
> > context...:<br>
> > standard-module-name-resolver<br>
> > /usr/local/racket/collects/racket/require-transform.rkt:266:2:<br>
> > expand-import<br>
> > /usr/local/racket/collects/racket/private/reqprov.rkt:375:5<br>
> > /usr/local/racket/collects/racket/require-transform.rkt:266:2:<br>
> > expand-import<br>
> > try-next<br>
> > /usr/local/racket/collects/racket/private/reqprov.rkt:242:2<br>
> > success<br>
> > /usr/local/racket/collects/typed-racket/typed-racket.rkt:53:4<br>
> > /usr/local/racket/collects/compiler/cm.rkt:372:0: compile-zo*<br>
> > /usr/local/racket/collects/compiler/cm.rkt:579:26<br>
> > /usr/local/racket/collects/compiler/cm.rkt:572:42<br>
> > /usr/local/racket/collects/compiler/cm.rkt:537:0: maybe-compile-zo<br>
> > /usr/local/racket/collects/compiler/cm.rkt:650:2: do-check<br>
> > /usr/local/racket/collects/compiler/cm.rkt:731:4<br>
> > /usr/local/racket/collects/setup/parallel-do.rkt:420:20: loop<br>
> ><br>
> > raco setup: --- updating info-domain tables ---<br>
> > raco setup: --- creating launchers ---<br>
> > raco setup: --- installing man pages ---<br>
> > raco setup: --- building documentation ---<br>
> > raco setup: --- installing collections ---<br>
> > raco setup: --- post-installing collections ---<br>
> > raco setup:<br>
> > raco setup: error: during making for /code/tlib/c1<br>
> > raco setup: default-load-handler: cannot open module file<br>
> > raco setup: module path: #<path:/code/tlib/c1/m1x.rkt><br>
> > raco setup: path: /code/tlib/c1/m1x.rkt<br>
> > raco setup: system error: No such file or directory; errno=2<br>
> > raco setup: context...:<br>
> > raco setup: standard-module-name-resolver<br>
> > raco setup:<br>
> > /usr/local/racket/collects/racket/require-transform.rkt:266:2: expand-import<br>
> > raco setup:<br>
> > /usr/local/racket/collects/racket/private/reqprov.rkt:375:5<br>
> > raco setup:<br>
> > /usr/local/racket/collects/racket/require-transform.rkt:266:2: expand-import<br>
> > raco setup: try-next<br>
> > raco setup:<br>
> > /usr/local/racket/collects/racket/private/reqprov.rkt:242:2<br>
> > raco setup: success<br>
> > raco setup:<br>
> > /usr/local/racket/collects/typed-racket/typed-racket.rkt:53:4<br>
> > raco setup: /usr/local/racket/collects/compiler/cm.rkt:372:0:<br>
> > compile-zo*<br>
> > raco setup: /usr/local/racket/collects/compiler/cm.rkt:579:26<br>
> > raco setup: /usr/local/racket/collects/compiler/cm.rkt:572:42<br>
> > raco setup: /usr/local/racket/collects/compiler/cm.rkt:537:0:<br>
> > maybe-compile-zo<br>
> > raco setup: /usr/local/racket/collects/compiler/cm.rkt:650:2: do-check<br>
> > raco setup: /usr/local/racket/collects/compiler/cm.rkt:731:4<br>
> > raco setup: /usr/local/racket/collects/setup/parallel-do.rkt:420:20:<br>
> > loop<br>
> > raco setup:<br>
> ><br>
> > Assuming co-occurrence of output happens across an N processor raco build,<br>
> > we know that during the making of collection c1, module m1x was not found.<br>
> ><br>
> > making: /code/tlib/c1<br>
> > default-load-handler: cannot open module file<br>
> > module path: #<path:/code/tlib/c1/m1x.rkt><br>
> > path: /code/tlib/c1/m1x.rkt<br>
> ><br>
> > The critical information of whom to blame is missing. In this case, the<br>
> > culprit is m1.rkt, line xxx with a bogus require.<br>
> ><br>
> > With a collection of a hundred module files or so, combined with multiple<br>
> > issues from the refactoring, one is in for an afternoon of recursive<br>
> > grepping etc.<br>
> ><br>
> > Questions:<br>
> ><br>
> > 1) Is this currently a "deep" issue, in the sense of how module resolving<br>
> > and instantiation is performed, layered with Typed Racket's mode of<br>
> > implementation, layered with CM and Raco's build system that prevents a<br>
> > more informative error message?<br>
> ><br>
> > Or<br>
> ><br>
> > 2) Is this just a simple a bug, in the sense of oops, just forgot to print<br>
> > the error message concerning the offending source module and line?<br>
> ><br>
> > If its 2) I'll work on debugging for a fix. If 1) I'm just not going to<br>
> > be able to tunnel through raco -> cm -> tr -> module expansion to run this<br>
> > down, so I'll punt.<br>
> ><br>
> ><br>
> > Thanks,<br>
> ><br>
> ><br>
> > Ray<br>
> ><br>
> > ____________________<br>
> > Racket Users list:<br>
> > <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
> ><br>
> ><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>