Skip to content

Commit

Permalink
fix: allow overriding "ocaml" with findlib
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: 1c8e6e5d-cd70-4cbc-881d-51cc033b7c91 -->
  • Loading branch information
rgrinberg committed Apr 27, 2023
1 parent fc24457 commit 6048ea3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/dune_rules/context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ let create ~(kind : Kind.t) ~path ~env ~env_nodes ~name ~merlin ~targets
stdlib_dir :: default_ocamlpath
else default_ocamlpath
in
let findlib_paths = ocamlpath @ default_ocamlpath in
let env =
context_env env name ocfg findlib env_nodes version ~profile ~host
~default_ocamlpath
Expand Down Expand Up @@ -499,11 +498,7 @@ let create ~(kind : Kind.t) ~path ~env ~env_nodes ~name ~merlin ~targets
in
if Option.is_some fdo_target_exe then
check_fdo_support lib_config.has_native ocfg ~name;
let* ocaml =
let program = "ocaml" in
which program >>| function
| Some s -> Ok s
| None -> Error (not_found program)
let* ocaml = get_ocaml_tool "ocaml"
and* ocamldep = get_ocaml_tool "ocamldep"
and* ocamlmklib = get_ocaml_tool "ocamlmklib"
and* ocamlobjinfo = get_ocaml_tool "ocamlobjinfo" in
Expand Down Expand Up @@ -547,7 +542,7 @@ let create ~(kind : Kind.t) ~path ~env ~env_nodes ~name ~merlin ~targets
; ocamlmklib
; ocamlobjinfo
; env
; findlib_paths
; findlib_paths = ocamlpath @ default_ocamlpath
; findlib_toolchain
; default_ocamlpath
; ocaml_config = ocfg
Expand Down

0 comments on commit 6048ea3

Please sign in to comment.