diff options
| author | Emilio Jesus Gallego Arias | 2018-09-05 20:12:23 +0200 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2018-09-05 20:46:12 +0200 |
| commit | 340088bbc08d5a3f55110dc2d287a83866ad2740 (patch) | |
| tree | 1b0124815bcd48867557b8a5d046782501666306 /ide | |
| parent | 579f30a53809f9cf73aa3d7c69960b50fc51c7fc (diff) | |
[bin] Fix binary location procedure to work with symlinks.
In #7860 `Sys.executable_name` was introduced to locate coq private
binaries; however, this breaks use cases with symlinks, such as Dune.
In order to fix this, we adopt a simpler strategy; we will always
adapt the name originally provided by the user, and only add a
directory if it was originally present.
This should work (hopefully) in all cases.
This fixes `coqide` not working on Dune builds.
Diffstat (limited to 'ide')
| -rw-r--r-- | ide/ideutils.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ide/ideutils.ml b/ide/ideutils.ml index 960beb8455..e84779d26d 100644 --- a/ide/ideutils.ml +++ b/ide/ideutils.ml @@ -328,15 +328,18 @@ let coqtop_path () = | None -> try let new_prog = System.get_toplevel_path "coqidetop" in - if Sys.file_exists new_prog then new_prog + (* The file exists or it is to be found by path *) + if Sys.file_exists new_prog || + CString.equal Filename.(basename new_prog) new_prog + then new_prog else let in_macos_bundle = Filename.concat (Filename.dirname new_prog) (Filename.concat "../Resources/bin" (Filename.basename new_prog)) in if Sys.file_exists in_macos_bundle then in_macos_bundle - else "coqidetop" - with Not_found -> "coqidetop" + else "coqidetop.opt" + with Not_found -> "coqidetop.opt" in file (* In win32, when a command-line is to be executed via cmd.exe |
