Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs are unable to reference IO functions sometimes #5563

Open
pchiusano opened this issue Jan 31, 2025 · 1 comment
Open

Docs are unable to reference IO functions sometimes #5563

pchiusano opened this issue Jan 31, 2025 · 1 comment

Comments

@pchiusano
Copy link
Member

x = {{ The function {printLine} is pretty cool. }}

Then display x results in:

  Attempted to use disallowed builtin in sandboxed environment: IO.stdHandle

Strangely, I tried it again and it worked, and now I can't repro anymore. Not sure what is going on.

Originally, I was thinking the issue is that the sandbox check isn't very smart. It's just checking if the transitive dependencies of x contain any forbidden functions. But why does it sometimes work then?

If it were that simple, some ideas for fixes:

  • Make the sandbox check smarter, distinguishing between transitive dependencies that are actually called as part of evaluation, vs dependencies which are unused / guarded. This seems like a static analysis that can be done accurately, though it makes me a bit nervous since we rely on these sandbox checks for Unison Cloud. Potentially this could be a separate function, used only for doc evaluation.
  • Have a way to run evaluation with all unsafe operations interpreted as calls to bug or throwing an exception.

Workaround for now is to use regular markdown style hyperlinks (relative paths should work) for linking to these

@ceedubs
Copy link
Contributor

ceedubs commented Jan 31, 2025

I think that this is a duplicate of #5506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants