From 8c91d664ac210323008f7f8159bf55ea18357999 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sun, 22 Oct 2023 13:39:16 -0600 Subject: [PATCH] fix(pkg): require copying sandbox for build rules (#8923) Signed-off-by: Rudi Grinberg --- src/dune_rules/pkg_rules.ml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/dune_rules/pkg_rules.ml b/src/dune_rules/pkg_rules.ml index 734e5aab873..72750d46412 100644 --- a/src/dune_rules/pkg_rules.ml +++ b/src/dune_rules/pkg_rules.ml @@ -805,15 +805,18 @@ module Action_expander = struct } ;; - let expand context (pkg : Pkg.t) action = - let* expander = expander context pkg in - let+ action = - expand action ~expander >>| Action.chdir (Path.build pkg.paths.source_dir) - in - (* TODO copying is needed because patch/substitute might be present *) - Action.Full.make ~sandbox:Sandbox_config.needs_sandboxing action - |> Action_builder.return - |> Action_builder.with_no_targets + let expand = + let sandbox = Sandbox_mode.Set.singleton Sandbox_mode.copy in + fun context (pkg : Pkg.t) action -> + let+ action = + let* expander = expander context pkg in + expand action ~expander >>| Action.chdir (Path.build pkg.paths.source_dir) + in + (* TODO copying is needed for build systems that aren't dune and those + with an explicit install step *) + Action.Full.make ~sandbox action + |> Action_builder.return + |> Action_builder.with_no_targets ;; let build_command context (pkg : Pkg.t) =