Skip to content

Commit

Permalink
bugfix: Respect OPAMROOT in dkml init
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahbeckford committed Dec 9, 2023
1 parent c9d1038 commit 92228f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dkml-exe/cmd_init.ml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ let create_local_switch ~system_cfg ~ocaml_home_fp ~scripts_dir_fp ~yes
~non_system_compiler ~localdir_fp =
(* Assemble command line arguments *)
let open Dkml_runtimelib.SystemConfig in
let ( let* ) = Result.bind in
Fpath.of_string "vendor/drd/src/unix/create-opam-switch.sh" >>= fun rel_fp ->
let* opamroot_dir_fp = Lazy.force Dkml_runtimelib.get_opam_root in
let create_switch_fp = Fpath.(scripts_dir_fp // rel_fp) in
let cmd =
Cmd.of_list
Expand All @@ -90,6 +92,8 @@ let create_local_switch ~system_cfg ~ocaml_home_fp ~scripts_dir_fp ~yes
Fpath.to_string localdir_fp;
"-o";
Fpath.to_string system_cfg.opam_home_fp;
"-r";
Fpath.to_string opamroot_dir_fp;
"-m";
"conf-withdkml";
]
Expand Down
1 change: 1 addition & 0 deletions src/runtimelib/dkml_runtimelib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ val get_msys2_dir_opt : (Fpath.t option, Rresult.R.msg) result lazy_t
val get_dkmlhome_dir_opt : (Fpath.t option, Rresult.R.msg) result lazy_t
val get_dkmlhome_dir_or_default : (Fpath.t, Rresult.R.msg) result lazy_t
val get_dkmlversion_or_default : (string, Rresult.R.msg) result lazy_t
val get_opam_root : (Fpath.t, [> Rresult.R.msg ]) result lazy_t

type dkmlmode = Nativecode | Bytecode

Expand Down

0 comments on commit 92228f1

Please sign in to comment.