It works for Scriblogify as well as Scribble. Thanks, Matthew.<br><br><div class="gmail_quote">On Sat, Oct 27, 2012 at 11:15 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">You're running into sandbox filesystem-protection rules.<br>
<br>
When you include a path in #:requires for `make-evaluator', then read<br>
access is granted for that file in the sandbox, so that's why the extra<br>
#:require path changes the document's behavior.<br>
<br>
Outside of DrRacket... well, I'm not excatly sure. Something in<br>
DrRacket's configuration of various path and module parameters enables<br>
access to the directory containing "my-scribble-doc.scrbl", while the<br>
configuration of raw `racket', `scribble', or `raco scribblogify'<br>
doesn't allow access to the directory.<br>
<br>
Assuming that you trust the code that you run in documentation --- at<br>
least as much as you trust the document itself --- the best approach is<br>
probably to use `call-with-trusted-sandbox-configuration':<br>
<br>
@(interaction<br>
#:eval (call-with-trusted-sandbox-configuration<br>
(lambda ()<br>
<div class="im"> (make-evaluator<br>
'racket/base<br>
(sandbox-output 'string)<br>
(sandbox-error-output 'string)<br>
</div> #:requires '("../Private/my-racket-mod.rkt"))))<br>
(f 1 2))<br>
<br>
I didn't actually try that with `raco scribblogify', but I got the<br>
errors that you report when using `raco scribble', and using<br>
`call-with-trusted-sandbox-configuration' solves the problem with `raco<br>
scribble'.<br>
<div><div class="h5"><br>
At Fri, 26 Oct 2012 22:38:25 -0400, Patrick King wrote:<br>
> When last I wrote on my problems with Scriblogify, I attributed them to<br>
> Windows 7 security... I was way too optimistic, and way too ashamed to<br>
> bother the community again. I have found a couple smoking guns since then,<br>
> and found that they, too, had nothing to do with my problem. The following<br>
> is repeatable in Racket 5.3 and Windows 7:<br>
><br>
> The following are all part of a project "ScriblogifyBug", which contains<br>
> folders "Private", where I hide implementation details, and "Blog", where I<br>
> boast about my implementation. Like a good little programmer, I use<br>
> rackunit to create custom tests relevant to my code, and use submodules to<br>
> implement tests. Like an enthusiastic Racketeer, I blog via<br>
> Scribble and Scriblogify.<br>
><br>
> #lang racket/base<br>
> ;; begin Private/my-test-mod.rkt<br>
> (require rackunit)<br>
> (provide (all-defined-out)<br>
> (all-from-out rackunit))<br>
><br>
> (define-simple-check<br>
> (check-my-func f)<br>
> (procedure? f))<br>
> ;; end Private/my-test-mod.rkt<br>
><br>
> #lang racket/base<br>
> ;; begin Private/my-racket-mod.rkt<br>
> (provide f)<br>
><br>
> (module+ test<br>
> (require "my-test-mod.rkt"))<br>
><br>
> (define (f x y)<br>
> (+ x y))<br>
><br>
> (module+ test<br>
> (printf "Tests running.~n")<br>
> (check-eq? 1 1)<br>
> (check-my-func f))<br>
> ;; end Private/my-racket-mod.rkt<br>
><br>
> #lang scribble/manual<br>
> @; begin Blog/my-scribble-doc.scrbl<br>
> @(require racket/sandbox scribble/eval)<br>
> @title{Trapping the Scriblogify Bug}<br>
> @author{Pat}<br>
><br>
> I expect this file to render fine via the @italic{Scribble HTML} button<br>
> within DrRacket,<br>
> and it does. However, I am curious why I must explicitly require<br>
> "my-test-mod.rkt", which<br>
> is only called from within the test submodule of "my-racket-mod.rkt".<br>
><br>
> Let's demonstate my nifty new function, @racket[f].<br>
><br>
> @(interaction #:eval(make-evaluator 'racket/base<br>
> (sandbox-output 'string)<br>
> (sandbox-error-output 'string)<br>
> #:requires<br>
> '("../Private/my-racket-mod.rkt"<br>
><br>
> "../Private/my-test-mod.rkt"))<br>
> ; ^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
> ; Why must I explicitly require<br>
> this?<br>
> (f 1 2))<br>
><br>
><br>
> I also expect this file to fail to render via @italic{raco scriblogify<br>
> "my-scribble-doc.scrbl"},<br>
> and it does, yielding the error<br>
> @italic{"current-directory: `exists' access denied for<br>
> ~\ScriblogifyBug\Blog\"}. With different<br>
> tweaks, I've gotten<br>
> similar 'exists' errors for the files in ../Private, involving<br>
> current-directory or similar<br>
> functions described in @bold{14.2 Filesystem} in the documentation, so I<br>
> suspect a Windows<br>
> specific path quirk. For instance, if I put all three files in the same<br>
> directory (modifying<br>
> the @racket{require}s in "my-scribble-doc.scrbl" accordingly), I get the<br>
> error<br>
> @italic{"file-exists?: `exists' access denied for C:\Program<br>
> Files\Racket\.\racket.exe"}. I<br>
> am not sure how to interpret "\.\", and C:\Program Files\Racket certainly<br>
> exists on my system,<br>
> as does C:\Program Files\Racket\Racket.exe (so there's the path issue and<br>
> the case issue).<br>
> @; end Blog/my-scribble-doc.scrbl<br>
><br>
> So, in summary, two issues:<br>
><br>
> a) Scribble needs help finding and interpreting files found within<br>
> submodules that I would expect to be both findable and irrelevant. When<br>
> explicitly told every potentially relevant file, it can figure out that it<br>
> can ignore it, when rendered within DrRacket.<br>
><br>
> 2) Scriblogify doesn't find the help sufficient, when run from the command<br>
> line.<br>
><br>
> c) One common clue, various path related errors that might be Windows<br>
> Weirdness.<br>
><br>
> Ok, me sticking with Windows is an issue, one that I hope to rectify in the<br>
> next six months as certain work-related constraints are relaxed.<br>
><br>
> All thoughts appreciated.<br>
><br>
> Pat<br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br>