Skip to content

Commit

Permalink
feature: sandbox cinaps actions
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

ps-id: b87ebe4c-10dc-4357-a41a-942fc04ccce7
  • Loading branch information
rgrinberg committed Aug 15, 2022
1 parent 6e4cc9b commit 1226a24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 1226a24

Please sign in to comment.