From 704a2129f62a9035b46010d640ee6fd1067b2fcc Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 31 Aug 2023 17:33:36 +0100 Subject: [PATCH] refactor: hoist up [env_ocamlpath] up a scope (#8563) Signed-off-by: Rudi Grinberg --- src/dune_rules/context.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dune_rules/context.ml b/src/dune_rules/context.ml index 494b9f6379f..e71deaac952 100644 --- a/src/dune_rules/context.ml +++ b/src/dune_rules/context.ml @@ -299,11 +299,11 @@ type instance = } let ocamlpath (kind : Kind.t) ~env ~findlib_toolchain = + let env_ocamlpath = Findlib_config.ocamlpath_of_env env in match kind, findlib_toolchain with - | Default, None -> Option.value ~default:[] (Findlib_config.ocamlpath_of_env env) + | Default, None -> Option.value ~default:[] env_ocamlpath | _, _ -> let initial_ocamlpath = Findlib_config.ocamlpath_of_env Env.initial in - let env_ocamlpath = Findlib_config.ocamlpath_of_env env in (* If we are not in the default context, we can only use the OCAMLPATH variable if it is specific to this build context *) (* CR-someday diml: maybe we should actually clear OCAMLPATH in other