From f6c67f56aa6daa8911caaa590e90d3caefe135f8 Mon Sep 17 00:00:00 2001 From: Michael Dales Date: Sat, 27 Jul 2024 15:26:57 +0100 Subject: [PATCH 1/2] Remove duplicate dependancies when workout out block inputs --- src/lib/ast/ast.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/ast/ast.ml b/src/lib/ast/ast.ml index 9e4f71e5..cd188d0b 100644 --- a/src/lib/ast/ast.ml +++ b/src/lib/ast/ast.ml @@ -357,6 +357,7 @@ let find_dependencies ast id = let from, too = edge in if too = id then Some from else None) ast.edges + |> List.sort_uniq (fun a b -> a - b) (* remove duplicates if we take more than one output from a block *) |> List.map (fun id -> List.assoc id ast.nodes) let default_container_path ast = Frontmatter.default_container_path ast.metadata From c913ec603b957ab46f97028866730ee876f4f4b7 Mon Sep 17 00:00:00 2001 From: Michael Dales Date: Sat, 27 Jul 2024 15:45:06 +0100 Subject: [PATCH 2/2] Initial join implementation --- src/bin/main.ml | 5 +- src/lib/ast/ast.ml | 29 +++---- src/lib/ast/ast.mli | 10 +-- src/lib/dotrenderer.ml | 14 ++-- src/lib/md.ml | 183 +++++++++++++++++++++++++++++++---------- src/lib/md.mli | 4 +- src/lib/run_block.ml | 6 +- src/lib/run_block.mli | 2 + src/test/ast.ml | 21 ++--- src/test/run_block.ml | 22 ++--- 10 files changed, 196 insertions(+), 100 deletions(-) diff --git a/src/bin/main.ml b/src/bin/main.ml index 60708e89..aa1b7f66 100644 --- a/src/bin/main.ml +++ b/src/bin/main.ml @@ -164,12 +164,11 @@ let md ~fs ~net ~domain_mgr ~proc () no_run store conf file port fetcher jobs (* Now we build the block *) (* Import block digests need to be mapped to this build hash *) let hb = - match Shark.Ast.find_hyperblock_from_block ast block with + match Shark.Ast.find_ast_block_from_shark_block ast block with | Some hb -> hb | None -> Logs.info (fun f -> - f "Failed to find the hyperblock for %a" Shark.Block.pp - block); + f "Failed to find the astblock for %a" Shark.Block.pp block); failwith "Block not found" in let res = diff --git a/src/lib/ast/ast.ml b/src/lib/ast/ast.ml index cd188d0b..39e55810 100644 --- a/src/lib/ast/ast.ml +++ b/src/lib/ast/ast.ml @@ -2,7 +2,7 @@ open Astring open Sexplib.Conv module DatafileSet = Set.Make (Datafile) -module Hyperblock = struct +module Astblock = struct type t = { hash : string list ref; context : string; @@ -37,7 +37,7 @@ module Hyperblock = struct end module Section = struct - type t = { name : string; blocks : Hyperblock.t list } + type t = { name : string; blocks : Astblock.t list } let v name blocks = { name; blocks } let name s = s.name @@ -47,7 +47,7 @@ end type block_id = int [@@deriving sexp] type t = { - nodes : (block_id * Hyperblock.t) list; + nodes : (block_id * Astblock.t) list; edges : (block_id * block_id) list; metadata : Frontmatter.t; } @@ -205,7 +205,7 @@ let pass_one_on_list inputs section_list = pass_one_process_commands_loop counter superblock.commands input_map in - (updated_map, Hyperblock.v name superblock.block leaves)) + (updated_map, Astblock.v name superblock.block leaves)) input_map superblocks in (updated_map, Section.v name processed_section)) @@ -304,34 +304,34 @@ let of_sharkdown ?concrete_paths template_markdown = let pass1 = pass_one_on_list [] expanded_sections in (* Now I have the global graph implicitly, turn the list into a graph of blocks *) - let all_hyperblocks = List.concat_map Section.blocks pass1 in - let id_all_hyperblocks = List.mapi (fun i h -> (i, h)) all_hyperblocks in + let all_astblocks = List.concat_map Section.blocks pass1 in + let id_all_astblocks = List.mapi (fun i h -> (i, h)) all_astblocks in (* All files will have one writer and zero or more readers *) let writers = List.concat (List.map (fun (hbid, h) -> - let _, outputs = Hyperblock.io h in + let _, outputs = Astblock.io h in List.map (fun o -> (Datafile.id o, (o, hbid))) outputs) - id_all_hyperblocks) + id_all_astblocks) in let edges = List.concat (List.map (fun (hbid, h) -> - let inputs, _ = Hyperblock.io h in + let inputs, _ = Astblock.io h in List.filter_map (fun i -> match List.assoc_opt (Datafile.id i) writers with | None -> None | Some (_, writerid) -> Some (writerid, hbid)) inputs) - id_all_hyperblocks) + id_all_astblocks) in - ({ nodes = id_all_hyperblocks; edges; metadata }, expanded_markdown) + ({ nodes = id_all_astblocks; edges; metadata }, expanded_markdown) let find_id_of_block ast ib = let d = Block.digest ib in @@ -340,14 +340,14 @@ let find_id_of_block ast ib = | [] -> None | hd :: tl -> let id, hb = hd in - let b = Hyperblock.block hb in + let b = Astblock.block hb in if Block.digest b = d then Some id else loop tl in loop ast.nodes let block_by_id ast id = List.assoc_opt id ast.nodes -let find_hyperblock_from_block ast block = +let find_ast_block_from_shark_block ast block = let id = find_id_of_block ast block in Option.bind id (block_by_id ast) @@ -357,7 +357,8 @@ let find_dependencies ast id = let from, too = edge in if too = id then Some from else None) ast.edges - |> List.sort_uniq (fun a b -> a - b) (* remove duplicates if we take more than one output from a block *) + |> List.sort_uniq (fun a b -> a - b) + (* remove duplicates if we take more than one output from a block *) |> List.map (fun id -> List.assoc id ast.nodes) let default_container_path ast = Frontmatter.default_container_path ast.metadata diff --git a/src/lib/ast/ast.mli b/src/lib/ast/ast.mli index 12823ead..831824f7 100644 --- a/src/lib/ast/ast.mli +++ b/src/lib/ast/ast.mli @@ -4,7 +4,7 @@ The AST is the logical representation of the workflow described in a sharkdown file, including the structure of groups (aka basic blocks in PL, but block is an overloaded term in this context). *) -module Hyperblock : sig +module Astblock : sig type t [@@deriving sexp] val block : t -> Block.t @@ -39,10 +39,10 @@ val of_sharkdown : being updated for any autogenerated blocks. *) val find_id_of_block : t -> Block.t -> block_id option -val block_by_id : t -> block_id -> Hyperblock.t option -val find_hyperblock_from_block : t -> Block.t -> Hyperblock.t option -val find_dependencies : t -> block_id -> Hyperblock.t list +val block_by_id : t -> block_id -> Astblock.t option +val find_ast_block_from_shark_block : t -> Block.t -> Astblock.t option +val find_dependencies : t -> block_id -> Astblock.t list val default_container_path : t -> Fpath.t -val to_list : t -> Hyperblock.t list +val to_list : t -> Astblock.t list (** Convert the AST to a list of command blocks. *) diff --git a/src/lib/dotrenderer.ml b/src/lib/dotrenderer.ml index 184e2634..488918a1 100644 --- a/src/lib/dotrenderer.ml +++ b/src/lib/dotrenderer.ml @@ -69,28 +69,28 @@ let datafile_to_dot ppf datafile = (Datafile.id datafile) shape (Fpath.to_string (Datafile.path datafile)) -let render_ast_to_dot ppf hyperblocks : unit = +let render_ast_to_dot ppf astblocks : unit = Format.fprintf ppf "digraph{\n"; List.concat_map (fun hb -> - let commands = Ast.Hyperblock.commands hb in + let commands = Ast.Astblock.commands hb in List.concat_map (fun command -> let inputs = Leaf.inputs command and outputs = Leaf.outputs command in List.concat [ inputs; outputs ]) commands) - hyperblocks + astblocks |> DatafileSet.of_list |> DatafileSet.iter (datafile_to_dot ppf); List.iteri (fun i hb -> - let kind = Block.kind (Ast.Hyperblock.block hb) in + let kind = Block.kind (Ast.Astblock.block hb) in let name, style = match kind with | `Publish -> ("Publish", "bold") - | _ -> (Ast.Hyperblock.context hb, "solid") - and commands = Ast.Hyperblock.commands hb in + | _ -> (Ast.Astblock.context hb, "solid") + and commands = Ast.Astblock.commands hb in Format.fprintf ppf "subgraph \"cluster_%d\" {\n" i; Format.fprintf ppf "\tstyle = %s\n" style; Format.fprintf ppf "\tlabel = \"%s\"\n" name; @@ -115,7 +115,7 @@ let render_ast_to_dot ppf hyperblocks : unit = List.iter (renderer ppf) filtered_commands; Format.fprintf ppf "}\n") - hyperblocks; + astblocks; Format.fprintf ppf "}\n" let render ~template_markdown = diff --git a/src/lib/md.ml b/src/lib/md.ml index 801138e9..4cb16e45 100644 --- a/src/lib/md.ml +++ b/src/lib/md.ml @@ -61,15 +61,15 @@ let process_build_block ?(src_dir = ".") ?hb (cb, block, `Stop (Printf.sprintf "%s: %s" id msg)) | Ok id -> let block_with_hash = Block.with_hash block id in - (* Update hyperblock hash *) + (* Update astblock hash *) let hb = match hb with | Some hb -> hb | None -> - Ast.find_hyperblock_from_block ast block - |> Option.get ~err:"No hyperblock for build block" + Ast.find_ast_block_from_shark_block ast block + |> Option.get ~err:"No astblock for build block" in - Ast.Hyperblock.update_hash hb id; + Ast.Astblock.update_hash hb id; let new_code_block = let info_string = Block.to_info_string block_with_hash in Cmarkit.Block.Code_block.make @@ -89,7 +89,7 @@ let input_hashes ast block = (* The input Datafile has the wildcard flag, which won't be set on the output flag, so we need to swap them over *) let input_map = - Ast.Hyperblock.io + Ast.Astblock.io (Option.get ~err:"No block ID for input map" (Ast.block_by_id ast block_id)) |> fst @@ -97,9 +97,9 @@ let input_hashes ast block = in let map_to_inputs hb = - let hashes = Ast.Hyperblock.hashes hb in + let hashes = Ast.Astblock.hashes hb in let inputs = - Ast.Hyperblock.io hb |> snd |> List.map Datafile.id + Ast.Astblock.io hb |> snd |> List.map Datafile.id |> List.filter_map (fun o -> List.assoc_opt o input_map) in List.map (fun h -> (h, inputs)) hashes @@ -154,14 +154,15 @@ let get_paths ~fs (Obuilder.Store_spec.Store ((module Store), store)) hash let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store ast (Builder ((module Builder), builder)) (_code_block, block) = - let hyperblock = - Ast.find_hyperblock_from_block ast block - |> Option.get ~err:"No hyperblock for run block" - in match Block.kind block with | `Run -> - let commands = Ast.Hyperblock.commands hyperblock in + let astblock = + Ast.find_ast_block_from_shark_block ast block + |> Option.get ~err:"No astblock for run block" + in + let inputs = input_hashes ast block in + let build = Build_cache.find_exn build_cache (Block.alias block) in let rom = @@ -172,14 +173,27 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store inputs in - let input_map = - List.map - (fun (hash, dfs) -> List.map (fun df -> (Datafile.id df, hash)) dfs) - inputs + let expanded_inputs = + List.map (fun (hash, dfs) -> List.map (fun df -> (hash, df)) dfs) inputs |> List.concat in - let spec_for_command previous_state leaf cmdstr = + let rec loop acc input_list = + match input_list with + | [] -> acc + | (hash, df) :: tl -> + let df_id = Datafile.id df in + let updated_acc = + match List.assoc_opt df_id acc with + | None -> (df_id, (df, [ hash ])) :: acc + | Some (df, hashes) -> + (df_id, (df, hash :: hashes)) :: List.remove_assoc df_id acc + in + loop updated_acc tl + in + let input_map = loop [] expanded_inputs in + + let spec_for_command previous_state leaf merges cmdstr = let target_dirs l = List.map (fun d -> @@ -194,6 +208,22 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store (Leaf.outputs l) in + let build_file_joins l = + List.map + (fun (target_dir, hashes) -> + let open Obuilder_spec in + let source_dir = String.sub ~start:5 target_dir in + [ run "mkdir -p %s" target_dir ] + @ List.map + (fun hash -> + run ~rom "cp -rs /shark/%s/%s/* %s" hash + (String.Sub.to_string source_dir) + target_dir) + hashes) + l + |> List.concat + in + let build_hash = Run_block.ExecutionState.build_hash previous_state and workdir = Run_block.ExecutionState.workdir previous_state and environment = Run_block.ExecutionState.env previous_state in @@ -203,12 +233,14 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store Obuilder_spec.workdir workdir; ] @ List.map (fun (k, v) -> Obuilder_spec.env k v) environment - @ target_dirs leaf + @ target_dirs leaf @ build_file_joins merges @ [ Obuilder_spec.run ~network:[ "host" ] ~rom "%s" cmdstr ]) in - let obuilder_command_runner previous_state leaf cmdstr buf = - let spec = spec_for_command previous_state leaf cmdstr in + (* This is a function passed to the block executure that abstracts out + the obuilder world *) + let obuilder_command_runner previous_state leaf file_joins cmdstr buf = + let spec = spec_for_command previous_state leaf file_joins cmdstr in Eio.Pool.use pool @@ fun () -> let log = log `Run buf in let context = Obuilder.Context.v ~log ~src_dir:"." () in @@ -222,6 +254,8 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store | Error (`Failed (id, msg)) -> Error (Some id, msg) in + (* This is an internal function that runs one command - it's + internal so as to pick up all the caller params, which is a bit cheaty *) let process_single_command command_history command_leaf = let previous_states = List.hd command_history in let previous_state = @@ -234,37 +268,75 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store match Run_block.ExecutionState.success previous_state with | false -> command_history | true -> + (* Generate the input mapping that links the file paths for the command's arguments with + any previously generated inputs. This needs to handle the following cases: + * Simple one-to-one file replacement + * Simple one-to-one directory name replacement + * If a directory is consumed with an * indicating a wildcard we need to gneerate a set + list of replacements for expansion to a list of parallel execituting versions of the command + * If the directory is an input and has been wildcarded then we need to + *) let inputs = Leaf.inputs command_leaf in let input_and_hashes = List.map - (fun i -> (i, List.assoc_opt (Datafile.id i) input_map)) - (* match List.assoc_opt (Datafile.id i) input_map with - | None -> Some (i, (Run_block.ExecutionState.build_hash prev_state)) - | Some hash -> Some (i, hash)) *) + (fun i -> + match List.assoc_opt (Datafile.id i) input_map with + | None -> (i, None) + | Some (_, hashes) -> (i, Some hashes)) inputs in - let hash_to_input_map = + let hashes_to_input_map = List.fold_left - (fun a (df, hash) -> - match List.assoc_opt hash a with - | None -> (hash, ref [ df ]) :: a + (fun a (df, hashes) -> + match List.assoc_opt hashes a with + | None -> (hashes, ref [ df ]) :: a | Some l -> l := df :: !l; a) [] input_and_hashes in + + let current_hash = + Run_block.ExecutionState.build_hash previous_state + in let paths = List.map - (fun (hash_opt, ref_fd_list) -> - match hash_opt with - | Some hash -> get_paths ~fs store hash true !ref_fd_list - | None -> - let current_hash = - Run_block.ExecutionState.build_hash previous_state - in - get_paths ~fs store current_hash false !ref_fd_list) - hash_to_input_map + (fun (hashes_opt, ref_df_list) -> + let df_list = !ref_df_list in + match hashes_opt with + | Some hashes -> ( + (* If we have multiple hashes, then this was a wildcard. In theory we could need to consume + this as a whild card, but we don't handle that case yet, so we fail if that's so *) + match List.length hashes with + | 1 -> get_paths ~fs store (List.hd hashes) true df_list + | _ -> ( + match List.length df_list with + | 1 -> get_paths ~fs store current_hash false df_list + | _ -> + Fmt.failwith + "We have multiple hashes mapped to multiple or \ + no files")) + | None -> get_paths ~fs store current_hash false df_list) + hashes_to_input_map in + + let merges = + List.filter_map + (fun (hashes_opt, ref_df_list) -> + match hashes_opt with + | None -> None + | Some hashes -> ( + match hashes with + | [] | [ _ ] -> None + | _ -> ( + match !ref_df_list with + | [ df ] -> + Some + (Fpath.to_string (Datafile.fullpath df), hashes) + | _ -> None))) + hashes_to_input_map + in + let l = List.fold_left (fun a v -> @@ -278,22 +350,44 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store s @ a) [] paths in + + (* Filter out any maps that are now merges *) + let l = + List.filter_map + (fun (p, targets) -> + match targets with + | [] -> ( + match List.assoc_opt p merges with + | Some _ -> None + | None -> Some (p, targets)) + | _ -> Some (p, targets)) + l + in + (* Sanity check whether we found the matching inputs *) List.iter (fun (i, s) -> match s with - | [] -> - Fmt.failwith - "Failed to find source files for input %s of %s" i - (Command.name (Leaf.command command_leaf)) + | [] -> ( + (* If this is a join, then it'll not be here *) + match List.assoc_opt i merges with + | Some _ -> () + | None -> + Fmt.failwith + "Failed to find source files for input %s of %s" i + (Command.name (Leaf.command command_leaf))) | _ -> ()) l; + + (* For each input(s) generate the actual command(s) with the paths + from the disk images mapped into place *) let inputs = Leaf.to_string_for_inputs command_leaf l in + let processed_blocks = Fiber.List.map (Run_block.process_single_command_execution ~previous_state - ~environment_override ~command_leaf ~file_subs_map:l - ~run_f:obuilder_command_runner) + ~environment_override ~command_leaf ~file_joins:merges + ~file_subs_map:l ~run_f:obuilder_command_runner) inputs in processed_blocks :: command_history @@ -304,6 +398,7 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store ~workdir:(Fpath.to_string (Ast.default_container_path ast)) ~environment:[] in + let commands = Ast.Astblock.commands astblock in let ids_and_output_and_cmd = List.fold_left process_single_command [ [ initial_state ] ] commands in @@ -330,7 +425,7 @@ let process_run_block ?(environment_override = []) ~fs ~build_cache ~pool store List.iter (fun es -> - Ast.Hyperblock.update_hash hyperblock + Ast.Astblock.update_hash astblock (Run_block.ExecutionState.build_hash es)) last; let block = Block.with_hash block id in diff --git a/src/lib/md.mli b/src/lib/md.mli index 24d3df71..0d61cdcc 100644 --- a/src/lib/md.mli +++ b/src/lib/md.mli @@ -24,7 +24,7 @@ type builder = val process_build_block : ?src_dir:string -> - ?hb:Ast.Hyperblock.t -> + ?hb:Ast.Astblock.t -> builder -> Ast.t -> Cmarkit.Block.Code_block.t * Block.t -> @@ -49,5 +49,5 @@ val process_publish_block : val translate_import_block : uid:string -> Block.t -> Cmarkit.Block.Code_block.t * Block.t -(** [translate_import_block uid block] will generate an expanded code block that contains a shark-build spec that +(** [translate_import_block uid block] will generate an expanded code block that contains a shark-build spec that carries out the actual import when evaluated. *) diff --git a/src/lib/run_block.ml b/src/lib/run_block.ml index 47aeedfd..dcbdaae7 100644 --- a/src/lib/run_block.ml +++ b/src/lib/run_block.ml @@ -59,7 +59,7 @@ module ExecutionState = struct end let process_single_command_execution ~previous_state ~environment_override - ~command_leaf ~file_subs_map ~run_f expanded_command_string = + ~command_leaf ~file_joins ~file_subs_map ~run_f expanded_command_string = let command = Leaf.command command_leaf in match Command.name command with | "cd" -> @@ -102,7 +102,9 @@ let process_single_command_execution ~previous_state ~environment_override | _ -> ( (* Otherwise we run a command using obuilder or such *) let buf = Buffer.create 128 in - let res = run_f previous_state command_leaf expanded_command_string buf in + let res = + run_f previous_state command_leaf file_joins expanded_command_string buf + in match res with | Ok id -> ExecutionState.v diff --git a/src/lib/run_block.mli b/src/lib/run_block.mli index 013f11e2..0c756881 100644 --- a/src/lib/run_block.mli +++ b/src/lib/run_block.mli @@ -37,10 +37,12 @@ val process_single_command_execution : previous_state:ExecutionState.t -> environment_override:(string * string) list -> command_leaf:Leaf.t -> + file_joins:(string * string list) list -> file_subs_map:(string * string list) list -> run_f: (ExecutionState.t -> Leaf.t -> + (string * string list) list -> string -> Buffer.t -> (string, string option * string) result) -> diff --git a/src/test/ast.ml b/src/test/ast.ml index 6f92d54e..8118e4a6 100644 --- a/src/test/ast.ml +++ b/src/test/ast.ml @@ -9,10 +9,9 @@ $ python3 something.py /data/something.txt |} in let test, _ = Shark.Ast.of_sharkdown template_markdown in - let hyperblocks = Shark.Ast.to_list test in - Alcotest.(check int) - "Single command group expected" 1 (List.length hyperblocks); - let leaves = Shark.Ast.Hyperblock.commands (List.nth hyperblocks 0) in + let astblocks = Shark.Ast.to_list test in + Alcotest.(check int) "Single command group expected" 1 (List.length astblocks); + let leaves = Shark.Ast.Astblock.commands (List.nth astblocks 0) in Alcotest.(check int) "Single command expected" 1 (List.length leaves) let test_multicommand_block () = @@ -25,10 +24,9 @@ $ python3 else.py /data/something.txt |} in let test, _ = Shark.Ast.of_sharkdown template_markdown in - let hyperblocks = Shark.Ast.to_list test in - Alcotest.(check int) - "Single command group expected" 1 (List.length hyperblocks); - let leaves = Shark.Ast.Hyperblock.commands (List.nth hyperblocks 0) in + let astblocks = Shark.Ast.to_list test in + Alcotest.(check int) "Single command group expected" 1 (List.length astblocks); + let leaves = Shark.Ast.Astblock.commands (List.nth astblocks 0) in Alcotest.(check int) "Single command expected" 2 (List.length leaves) let test_single_block_no_obvious_side_effects () = @@ -40,10 +38,9 @@ $ python3 something.py |} in let test, _ = Shark.Ast.of_sharkdown template_markdown in - let hyperblocks = Shark.Ast.to_list test in - Alcotest.(check int) - "Single command group expected" 1 (List.length hyperblocks); - let leaves = Shark.Ast.Hyperblock.commands (List.nth hyperblocks 0) in + let astblocks = Shark.Ast.to_list test in + Alcotest.(check int) "Single command group expected" 1 (List.length astblocks); + let leaves = Shark.Ast.Astblock.commands (List.nth astblocks 0) in Alcotest.(check int) "Single command expected" 1 (List.length leaves) let tests = diff --git a/src/test/run_block.ml b/src/test/run_block.ml index 27e91ae5..ebb125ce 100644 --- a/src/test/run_block.ml +++ b/src/test/run_block.ml @@ -13,7 +13,7 @@ let test_initial_block () = "Check env" [] (Shark.Run_block.ExecutionState.env es) -let null_runner _es _l _s _b = Ok "null runner" +let null_runner _es _l _m _s _b = Ok "null runner" let test_simple_change_dir () = let raw_command = "cd /data/arg1" in @@ -33,7 +33,7 @@ let test_simple_change_dir () = let updated = Shark.Run_block.process_single_command_execution ~previous_state:es - ~environment_override:[] ~command_leaf ~file_subs_map:[] + ~environment_override:[] ~command_leaf ~file_joins:[] ~file_subs_map:[] ~run_f:null_runner raw_command in Alcotest.(check string) @@ -63,7 +63,7 @@ let test_simple_env_udpate () = let updated = Shark.Run_block.process_single_command_execution ~previous_state:es - ~environment_override:[] ~command_leaf ~file_subs_map:[] + ~environment_override:[] ~command_leaf ~file_joins:[] ~file_subs_map:[] ~run_f:null_runner raw_command in Alcotest.(check string) @@ -96,8 +96,8 @@ let test_override_env_udpate () = let updated = Shark.Run_block.process_single_command_execution ~previous_state:es - ~environment_override ~command_leaf ~file_subs_map:[] ~run_f:null_runner - raw_command + ~environment_override ~command_leaf ~file_joins:[] ~file_subs_map:[] + ~run_f:null_runner raw_command in Alcotest.(check string) "Check id" "id" @@ -123,15 +123,15 @@ let test_simple_command_execute () = in let runner_called = ref false in - let runner _es _l _s _b = + let runner _es _l _m _s _b = runner_called := true; Ok "otherid" in let updated = Shark.Run_block.process_single_command_execution ~previous_state:es - ~environment_override:[] ~command_leaf ~file_subs_map:[] ~run_f:runner - raw_command + ~environment_override:[] ~command_leaf ~file_joins:[] ~file_subs_map:[] + ~run_f:runner raw_command in Alcotest.(check bool) "Check success" true @@ -160,15 +160,15 @@ let test_simple_failed_command_execute () = in let runner_called = ref false in - let runner _es _l _s _b = + let runner _es _l _m _s _b = runner_called := true; Error (None, "error") in let updated = Shark.Run_block.process_single_command_execution ~previous_state:es - ~environment_override:[] ~command_leaf ~file_subs_map:[] ~run_f:runner - raw_command + ~environment_override:[] ~command_leaf ~file_joins:[] ~file_subs_map:[] + ~run_f:runner raw_command in Alcotest.(check bool) "Check success" false