[racket] Problem with scribble examples written in linked language

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Dec 5 14:33:51 EST 2012

At Wed, 05 Dec 2012 14:24:09 -0500, David Van Horn wrote:
> I am trying to scribble some examples using a custom evaluator.  if I 
> use the example from the documentation, things work:
> 
> @(require racket/sandbox
>            scribble/eval)
> @(define my-evaluator
>     (parameterize ([sandbox-output 'string]
>                    [sandbox-error-output 'string])
>       (make-evaluator 'typed/racket/base)))
> @interaction[#:eval my-evaluator
> 
>               (: my-sqr (Real -> Real))
>               (define (my-sqr x)
>                 (* x x))
>               (my-sqr 42)]
> 
> But when I change the language from 'typed/racket/base to 'pcf/lang (a 
> collection that I've added with raco link).  Then I get a sandbox error:
> 
> file-exists?: `exists' access denied for 
> /Users/dvanhorn/Documents/git/racket/bin/racket
>    context...:
>     find-executable-path
>  
> /Users/dvanhorn/Documents/git/racket/collects/setup/private/main-collects.rkt:19
> :4: 
> find-main-collects
>  
> /Users/dvanhorn/Documents/git/racket/collects/racket/private/promise.rkt:104:10
>  
> /Users/dvanhorn/Documents/git/racket/collects/racket/private/more-scheme.rkt:263
> :2: 
> call-with-exception-handler
>     /Users/dvanhorn/Documents/git/racket/collects/racket/private
> ...
> 
> Am I doing something wrong, or is this a buggy interaction between the 
> sandbox and raco link?

The sandbox's default settings probably don't interact nicely with
`raco link', and if not, we should improve that.

Use `call-with-trusted-sandbox-configuration' while creating the
evaluator to avoid the problem. That's probably the right thing to do,
anyway.


Posted on the users mailing list.