Skip to content

Commit

Permalink
Ignore errors while generating the .merlin file
Browse files Browse the repository at this point in the history
Fix #568
  • Loading branch information
jeremiedimino committed Mar 1, 2018
1 parent 1b279f3 commit 219253e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/merlin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/github25/root/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -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}
16 changes: 7 additions & 9 deletions test/blackbox-tests/test-cases/github568/run.t
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 219253e

Please sign in to comment.