Skip to content

Commit

Permalink
install_rules: call dir_contents only when necessary
Browse files Browse the repository at this point in the history
This prevents path_expander to expand the artifacts too early

Signed-off-by: Marcello Seri <marcello.seri@gmail.com>
  • Loading branch information
mseri committed Oct 9, 2018
1 parent bd8ebea commit d85f166
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/install_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ module Gen(P : Params) = struct
let entries_per_package =
List.concat_map (SC.stanzas_to_consider_for_install sctx)
~f:(fun { SC.Installable. dir; stanza; kind = dir_kind; scope } ->
let dir_contents = Dir_contents.get sctx ~dir in
match stanza with
| Library ({ public = Some { package; sub_dir; name = _}
; _ } as lib) ->
let dir_contents = Dir_contents.get sctx ~dir in
List.map (lib_install_files ~dir ~sub_dir lib ~scope
~dir_kind ~dir_contents)
~f:(fun x -> package.name, x)
Expand All @@ -328,6 +328,7 @@ module Gen(P : Params) = struct
in
List.map ~f files
| Documentation ({ package; _ } as d) ->
let dir_contents = Dir_contents.get sctx ~dir in
List.map ~f:(fun mld ->
(package.name,
(Install.Entry.make
Expand Down

0 comments on commit d85f166

Please sign in to comment.