Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Sep 3, 2020
1 parent 80a3adb commit a43692c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/dune_engine/artifact_substitution.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type hardcoded_ocaml_path =
type conf =
{ get_vcs : Path.Source.t -> Vcs.t option
; get_location : Section.t -> Package.Name.t -> Path.t
; get_configPath : configpath -> Path.t option
; get_config_path : configpath -> Path.t option
; hardcoded_ocaml_path : hardcoded_ocaml_path
}

Expand All @@ -56,12 +56,12 @@ let conf_of_context (context : Build_context.t option) =
| None ->
{ get_vcs
; get_location = (fun _ _ -> Code_error.raise "no context available" [])
; get_configPath = (fun _ -> Code_error.raise "no context available" [])
; get_config_path = (fun _ -> Code_error.raise "no context available" [])
; hardcoded_ocaml_path = Hardcoded []
}
| Some context ->
let get_location = Install.Section.Paths.get_local_location context.name in
let get_configPath = function
let get_config_path = function
| Sourceroot -> Some (Path.source Path.Source.root)
| Stdlib -> Some context.stdlib_dir
in
Expand All @@ -72,7 +72,7 @@ let conf_of_context (context : Build_context.t option) =
in
{ get_vcs = File_tree.nearest_vcs
; get_location
; get_configPath
; get_config_path
; hardcoded_ocaml_path
}

Expand All @@ -91,16 +91,16 @@ let conf_for_install ~relocatable ~default_ocamlpath ~stdlib_dir ~prefix ~libdir
in
Install.Section.Paths.get paths section
in
let get_configPath = function
let get_config_path = function
| Sourceroot -> None
| Stdlib -> Some stdlib_dir
in
{ get_location; get_vcs; get_configPath; hardcoded_ocaml_path }
{ get_location; get_vcs; get_config_path; hardcoded_ocaml_path }

let conf_dummy =
{ get_vcs = (fun _ -> None)
; get_location = (fun _ _ -> Path.root)
; get_configPath = (fun _ -> None)
; get_config_path = (fun _ -> None)
; hardcoded_ocaml_path = Hardcoded []
}

Expand Down Expand Up @@ -140,7 +140,7 @@ let eval t ~conf =
Fiber.return
(Option.value ~default:""
(let open Option.O in
let+ dir = conf.get_configPath d in
let+ dir = conf.get_config_path d in
relocatable dir))
| Hardcoded_ocaml_path ->
Fiber.return
Expand Down
2 changes: 1 addition & 1 deletion src/dune_engine/artifact_substitution.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type hardcoded_ocaml_path =
type conf = private
{ get_vcs : Path.Source.t -> Vcs.t option
; get_location : Section.t -> Package.Name.t -> Path.t
; get_configPath : configpath -> Path.t option
; get_config_path : configpath -> Path.t option
; hardcoded_ocaml_path : hardcoded_ocaml_path
(** Initial prefix of installation when relocatable chosen *)
}
Expand Down

0 comments on commit a43692c

Please sign in to comment.