Skip to content

Commit

Permalink
removed [may_change] option in Workflow.input
Browse files Browse the repository at this point in the history
  • Loading branch information
pveber committed Sep 21, 2018
1 parent 65d7713 commit a3271e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions lib/base/sigs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,10 @@ module type DSL = sig
- @param np maximum number of cores (could be given less at execution)
- @param version version number, used to force the rebuild of a workflow *)

val input : ?may_change:bool -> string -> 'a workflow
val input : ?version:string -> string -> 'a workflow
(** Constructs a workflow from an existing file on the
filesystem. The argument [may_change] indicates that the file
may be modified, which is detected by giving the workflow a
digest of the file as an input. *)
filesystem. The argument [version] can be used to force a
recomputation when the file was changed. *)

(** Describes the (relative) path from a ['a directory workflow]
target to some ['b workflow] target. This is useful to construct
Expand Down
6 changes: 2 additions & 4 deletions lib/base/workflow.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ let select u q =
| Plugin _
| Shell _ -> k u q

let input ?(may_change = false) path =
let hash = if may_change then Some (Md5.digest_file_blocking_without_releasing_runtime_lock path) else None in
let id = digest ("input", path, hash) in
let input ?version path =
let id = digest ("input", path, version) in
Input { id ; path }


let rec digestible_dep = function
| Shell s -> `Shell s.id
| Input { path ; _ } -> `Input path
Expand Down

0 comments on commit a3271e4

Please sign in to comment.