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

test(melange): missing dependency during emission with sandbox enabled #10295

Closed

Conversation

anmonteiro
Copy link
Collaborator

based on the suggestion in #10286 (comment)

enabling sandboxing confirms there's a missing dependency

Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
@anmonteiro anmonteiro force-pushed the anmonteiro/show-melange-error-sandbox branch from 2044fce to df005ab Compare March 21, 2024 02:59
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
@anmonteiro
Copy link
Collaborator Author

not sure if this is needed anymore since #10286 fixed it.

@anmonteiro anmonteiro force-pushed the anmonteiro/show-melange-error-sandbox branch from df005ab to b706d73 Compare March 21, 2024 03:24
@rgrinberg
Copy link
Member

I think it's useful. It has the potential to find many such bugs. The only cost is in performance, so it could really be enabled everywhere else in the test suite as well.

@anmonteiro
Copy link
Collaborator Author

The only cost is in performance, so it could really be enabled everywhere else in the test suite as well.

I don't understand the implication here. This PR has a performance impact? But enabling more sandboxing will have less perf impact?

@anmonteiro
Copy link
Collaborator Author

IIRC there's also something preventing us from enabling sandboxing altogether for melange.emit because of the runtime_deps stuff?

@rgrinberg
Copy link
Member

Sure, let me clarify. Sandboxing has a performance cost, but it makes the rules more reliable. For the test suite, that seems like a good trade-off because we are building trivial projects anyway.

Sandboxing works with runtime deps if the dependencies are specified correctly. I don't see any specific issues there.

I suppose one issue with sandboxing is that rules can often rely on it in a way that will make them break in non-sandboxed mode. E.g. -I in sandboxed mode is guaranteed only to observe the .cmi files you depend on. But in non sandboxed mode, it's more loose, so you need to be careful in your compiler.

@anmonteiro
Copy link
Collaborator Author

I'd love to run the test suite through sandboxing and see if it holds up for Melange. Is there a way to enable sandboxing for the entire test suite other than e.g. setting the environment variable in the dune file?

@rgrinberg
Copy link
Member

Maybe you could use the setenv field in the env stanza to turn it on for melange tests? (setenv DUNE_SANDBOX symlink)

@anmonteiro
Copy link
Collaborator Author

anmonteiro commented Mar 29, 2024

I'd rather merge #10312. Just need to disable sandboxing in that odoc test.

@anmonteiro anmonteiro closed this Mar 29, 2024
@anmonteiro anmonteiro deleted the anmonteiro/show-melange-error-sandbox branch March 29, 2024 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants