How to make a sandboxed evaluator in Scribble

29 views
Skip to first unread message

David Storrs

unread,
Apr 1, 2021, 3:41:45 PM4/1/21
to Racket Users
I cargo-culted this chunk of code and, predictably, it is now failing
for reasons I don't understand. This is in the value-evt scribble
file; it works fine when I build the file manually but it's failing in
the package server build:

@(define eval
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit 50])
[make-evaluator #:requires (list "main.rkt") 'racket]))))

Clearly the issue is with 'main.rkt' as opposed to '../main.rkt'. I
had that originally and it worked when I did 'scribble
value-evt.scrbl' while in the scribblings directory but it failed or
misgenerated the files when I was in a different directory or I used
raco setup.

Weirdly, this is being reported as a failing test, which surprised me.
Why is that?

What should I do instead?

Sam Tobin-Hochstadt

unread,
Apr 1, 2021, 3:58:37 PM4/1/21
to David Storrs, Racket Users
You might use `(list 'value-evt)` if that's the require you want.

Sam
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAE8gKofQXNm%2Bsfkk-07NYZw0drQmw92oqJBZkyq5fQrGBWA9TQ%40mail.gmail.com.

David Storrs

unread,
Apr 1, 2021, 5:50:29 PM4/1/21
to Sam Tobin-Hochstadt, Racket Users
On Thu, Apr 1, 2021 at 3:58 PM Sam Tobin-Hochstadt <sa...@cs.indiana.edu> wrote:
>
> You might use `(list 'value-evt)` if that's the require you want.
>
> Sam

...
Blarg.

Yes, thank you. Should have realized.
Reply all
Reply to author
Forward
0 new messages