parent
cf2f6c03ba
commit
d1feb062b6
|
@ -3,6 +3,10 @@ next
|
|||
|
||||
- Ignore errors during the generation of the .merlin (#569, fixes #568 and #51)
|
||||
|
||||
- Add a workaround for when a library normally installed by the
|
||||
compiler is not installed but still has a META file (#574, fixes
|
||||
#563)
|
||||
|
||||
1.0+beta18 (25/02/2018)
|
||||
-----------------------
|
||||
|
||||
|
|
|
@ -189,15 +189,10 @@ let parse_package t ~meta_file ~name ~parent_dir ~vars =
|
|||
Path.relative t.stdlib_dir
|
||||
(String.sub pkg_dir ~pos:1 ~len:(String.length pkg_dir - 1))
|
||||
else if Filename.is_relative pkg_dir then
|
||||
Path.relative parent_dir pkg_dir
|
||||
Path.relative parent_dir pkg_dir
|
||||
else
|
||||
Path.absolute pkg_dir
|
||||
in
|
||||
let exists_if = Vars.get_words vars "exists_if" Ps.empty in
|
||||
let exists =
|
||||
List.for_all exists_if ~f:(fun fn ->
|
||||
Path.exists (Path.relative dir fn))
|
||||
in
|
||||
let pkg =
|
||||
{ Package.
|
||||
meta_file
|
||||
|
@ -206,6 +201,28 @@ let parse_package t ~meta_file ~name ~parent_dir ~vars =
|
|||
; vars
|
||||
}
|
||||
in
|
||||
let exists_if = Vars.get_words vars "exists_if" Ps.empty in
|
||||
let exists =
|
||||
match exists_if with
|
||||
| _ :: _ ->
|
||||
List.for_all exists_if ~f:(fun fn ->
|
||||
Path.exists (Path.relative dir fn))
|
||||
| [] ->
|
||||
if not (String_map.mem t.builtins (root_package_name name)) then
|
||||
true
|
||||
else
|
||||
(* The META files for installed packages are sometimes broken,
|
||||
i.e. META files for libraries that were not installed by
|
||||
the compiler are still present:
|
||||
|
||||
https://github.com/ocaml/dune/issues/563
|
||||
|
||||
To workaround this problem, for builtin packages we check
|
||||
that at least one of the archive is present. *)
|
||||
match Package.archives pkg with
|
||||
| { byte = []; native = [] } -> true
|
||||
| { byte; native } -> List.exists (byte @ native) ~f:Path.exists
|
||||
in
|
||||
let res =
|
||||
if exists then
|
||||
Ok pkg
|
||||
|
|
Loading…
Reference in New Issue