Ignore errors while generating the .merlin file

Fix #568
Fix #51
This commit is contained in:
Jeremie Dimino 2018-03-01 23:29:14 +00:00
parent 1b279f30bf
commit de99d84f73
3 changed files with 11 additions and 12 deletions

View File

@ -21,8 +21,9 @@ let make
?(source_dirs=Path.Set.empty)
?(objs_dirs=Path.Set.empty)
() =
{ requires
; flags
(* Merlin shouldn't cause the build to fail, so we just ignore errors *)
{ requires = Build.catch requires ~on_error:(fun _ -> [])
; flags = Build.catch flags ~on_error:(fun _ -> [])
; preprocess
; libname
; source_dirs

View File

@ -14,11 +14,11 @@ We need ocamlfind to run this test
ocamlopt hello.cmxs
$ $JBUILDER build -j1 @install --display short --root . --only pas-de-bol 2>&1 | sed 's/[^ "]*findlib-packages/.../'
ocamldep a.ml.d
File ".../plop/META", line 1, characters 0-0:
Error: Library "une-lib-qui-nexiste-pas" not found.
-> required by library "plop.ca-marche-pas" in .../plop
Hint: try: jbuilder external-lib-deps --missing --root . --only-packages pas-de-bol @install
ocamldep a.ml.d
ocamldep b.ml.d
ocamlc .pas_de_bol.objs/pas_de_bol.{cmi,cmo,cmt}
ocamlopt .pas_de_bol.objs/pas_de_bol.{cmx,o}

View File

@ -1,12 +1,10 @@
$ $JBUILDER runtest --display short -j1 -p lib1 --debug-dependency-path
File "jbuild", line 1, characters 0-464:
Error: Library "lib2" not found.
-> required by .merlin
-> required by .merlin-exists
-> required by test1.exe
-> required by alias runtest
-> required by alias runtest
Hint: try: jbuilder external-lib-deps --missing -p lib1 @runtest
ocamldep test1.ml.d
ocamldep lib1.ml.d
[1]
ocamlc .lib1.objs/lib1.{cmi,cmo,cmt}
ocamlc .test1.eobjs/test1.{cmi,cmo,cmt}
ocamlopt .lib1.objs/lib1.{cmx,o}
ocamlopt .test1.eobjs/test1.{cmx,o}
ocamlopt lib1.{a,cmxa}
ocamlopt test1.exe
test1 alias runtest