File tree 3 files changed +18
-25
lines changed
3 files changed +18
-25
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,20 @@ let add_binaries t ~dir l =
60
60
{ t with local_bins }
61
61
;;
62
62
63
- module Local = struct
64
- type t = Path.Build .t Filename.Map .t
65
-
66
- let create =
67
- Path.Build.Set. fold ~init: Filename.Map. empty ~f: (fun path acc ->
68
- let name = Path.Build. basename path in
69
- let key =
70
- if Sys. win32
71
- then Option. value ~default: name (String. drop_suffix name ~suffix: " .exe" )
72
- else name
73
- in
74
- Filename.Map. set acc key path)
75
- ;;
76
- end
77
-
78
- let create (context : Context.t ) ~local_bins = { context; local_bins }
63
+ let create =
64
+ let drop_suffix name =
65
+ if Sys. win32
66
+ then Option. value ~default: name (String. drop_suffix name ~suffix: " .exe" )
67
+ else name
68
+ in
69
+ fun (context : Context.t ) ~local_bins ->
70
+ let local_bins =
71
+ Memo. lazy_ (fun () ->
72
+ let + local_bins = Memo.Lazy. force local_bins in
73
+ Path.Build.Set. fold local_bins ~init: Filename.Map. empty ~f: (fun path acc ->
74
+ let name = Path.Build. basename path in
75
+ let key = drop_suffix name in
76
+ Filename.Map. set acc key path))
77
+ in
78
+ { context; local_bins }
79
+ ;;
Original file line number Diff line number Diff line change @@ -18,12 +18,5 @@ val local_bin : Path.Build.t -> Path.Build.t
18
18
val binary : t -> ?hint : string -> loc :Loc .t option -> string -> Action.Prog .t Memo .t
19
19
20
20
val binary_available : t -> string -> bool Memo .t
21
-
22
- module Local : sig
23
- type t
24
-
25
- val create : Path.Build.Set .t -> t
26
- end
27
-
28
21
val add_binaries : t -> dir :Path .Build .t -> File_binding.Expanded .t list -> t
29
- val create : Context .t -> local_bins :Local .t Memo.Lazy .t -> t
22
+ val create : Context .t -> local_bins :Path . Build . Set .t Memo.Lazy .t -> t
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ let get_installed_binaries ~(context : Context.t) stanzas =
88
88
| _ -> Memo. return Path.Build.Set. empty)
89
89
>> | Path.Build.Set. union_all)
90
90
>> | Path.Build.Set. union_all
91
- >> | Artifacts.Local. create
92
91
;;
93
92
94
93
let all =
You can’t perform that action at this time.
0 commit comments