Skip to content
Draft
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
15 changes: 7 additions & 8 deletions src/dune_rules/action_unexpanded.ml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ end = struct
end
end

let project_dune_version expander =
let open Memo.O in
Dune_load.find_project ~dir:(Expander.dir expander) >>| Dune_project.dune_version
;;

let rec expand (t : Dune_lang.Action.t) : Action.t Action_expander.t =
let module A = Action_expander in
let module E = Action_expander.E in
Expand Down Expand Up @@ -539,10 +544,7 @@ let rec expand (t : Dune_lang.Action.t) : Action.t Action_expander.t =
| Cat xs ->
A.with_expander (fun expander ->
let open Memo.O in
let+ version =
let dir = Expander.dir expander in
Dune_load.find_project ~dir >>| Dune_project.dune_version
in
let+ version = project_dune_version expander in
let open Action_expander.O in
if version >= (3, 10)
then
Expand Down Expand Up @@ -617,10 +619,7 @@ let rec expand (t : Dune_lang.Action.t) : Action.t Action_expander.t =
| Format_dune_file (src, dst) ->
A.with_expander (fun expander ->
let open Memo.O in
let+ version =
let dir = Expander.dir expander in
Dune_load.find_project ~dir >>| Dune_project.dune_version
in
let+ version = project_dune_version expander in
let open Action_expander.O in
let+ src = E.dep src
and+ dst = E.target dst in
Expand Down
Loading