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

Fix locks in rules without targets #3366

Merged
merged 3 commits into from
Apr 15, 2020
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
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- [coq] Fix install path for theory names with level greater than 1
(#3358 , @ejgallego)

- Fix a bug introduced in 2.0.0 where the [locks] field in rules with no targets had
no effect. (@aalekseyev, report by @craigfe)

2.5.0 (09/04/2020)
------------------

Expand Down
7 changes: 4 additions & 3 deletions src/dune/simple_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ module Alias_rules = struct
, Option.map ~f:Action_unexpanded.remove_locs action
, Option.map extra_bindings ~f:Pform.Map.to_stamp )

let add sctx ~alias ~stamp ~loc ?(locks = []) build =
let add sctx ~alias ~stamp ~loc ~locks build =
let dir = Alias.dir alias in
SC.add_alias_action sctx alias ~dir ~loc ~locks ~stamp build

let add_empty sctx ~loc ~alias ~stamp =
let action = Build.With_targets.return Action.empty in
add sctx ~loc ~alias ~stamp action
add sctx ~loc ~alias ~stamp action ~locks:[]
end

let interpret_locks ~expander = List.map ~f:(Expander.expand_path expander)
Expand Down Expand Up @@ -124,7 +124,8 @@ let user_rule sctx ?extra_bindings ~dir ~expander (rule : Rule.t) =
let action = Some (snd rule.action) in
Alias_rules.stamp ~deps:rule.deps ~extra_bindings ~action
in
Alias_rules.add sctx ~alias ~stamp ~loc:(Some rule.loc) action;
let locks = interpret_locks ~expander rule.locks in
Alias_rules.add sctx ~alias ~stamp ~loc:(Some rule.loc) action ~locks;
Path.Build.Set.empty )

let copy_files sctx ~dir ~expander ~src_dir (def : Copy_files.t) =
Expand Down