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

feature: sandbox cinaps actions #6062

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
- Do not ignore rules marked `(promote (until-clean))` when
`--ignore-promoted-rules` (or `-p`) is passed. (#6010, fixes #4401, @emillon)

- Cinaps actions are now sandboxed by default (#6062, @rgrinberg)

3.4.1 (26-07-2022)
------------------

Expand Down
8 changes: 7 additions & 1 deletion src/dune_rules/cinaps.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ let gen_rules sctx t ~dir ~scope =
let cinaps_exe = Path.Build.relative cinaps_dir (name ^ ".exe") in
let* () =
(* Ask cinaps to produce a .ml file to build *)
let sandbox =
let project = Scope.project scope in
if Dune_project.dune_version project >= (3, 5) then
Sandbox_config.needs_sandboxing
else Sandbox_config.default
in
Super_context.add_rule sctx ~loc:t.loc ~dir
(Command.run ~dir:(Path.build dir) prog
(Command.run ~dir:(Path.build dir) prog ~sandbox
[ A "-staged"
; Target cinaps_ml
; Deps (List.map cinapsed_files ~f:Path.build)
Expand Down