Skip to content

Commit

Permalink
Fix ocaml#7344.
Browse files Browse the repository at this point in the history
This currently disables a hack previously meant at supporting absolute
file paths for [dune coq top].

Signed-off-by: Rodolphe Lepigre <[email protected]>
  • Loading branch information
Rodolphe Lepigre authored and rlepigre committed Mar 20, 2023
1 parent 6348125 commit 7260539
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions bin/coq/coqtop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ let term =
Arg.(value & pos_right 0 string [] (Arg.info [] ~docv:"ARGS"))
in
let config = Common.init common in
let root = Common.root common in
let prefix_target = Common.prefix_target common in
let coqtop, argv, env =
Scheduler.go ~common ~config (fun () ->
Expand All @@ -40,25 +39,6 @@ let term =
let* setup = Memo.run setup in
let sctx = Import.Main.find_scontext_exn setup ~name:context in
let context = Dune_rules.Super_context.context sctx in
(* Try to compute a relative path if we got an absolute path. *)
let coq_file_arg =
if Filename.is_relative coq_file_arg then
Path.relative Path.root (root.reach_from_root_prefix ^ coq_file_arg)
|> Path.to_string
else
let cwd = Path.external_ Path.External.initial_cwd in
let file =
(* Best-effort symbolic link unfolding. *)
let file = Fpath.follow_symlinks coq_file_arg in
Option.value file ~default:coq_file_arg
in
let file = Path.of_filename_relative_to_initial_cwd file in
let cwd = Path.to_string cwd in
let file = Path.to_string file in
match String.drop_prefix ~prefix:(cwd ^ "/") file with
| None -> coq_file_arg
| Some s -> s
in
let coq_file_build =
let p = prefix_target coq_file_arg in
Path.Build.relative context.build_dir p
Expand Down

0 comments on commit 7260539

Please sign in to comment.