Skip to content

Commit

Permalink
Fix @all alias should only build enabled libraries
Browse files Browse the repository at this point in the history
 Fixes #2272

Signed-off-by: François Bobot <francois.bobot@cea.fr>
  • Loading branch information
bobot committed Jul 31, 2019
1 parent 7b37f89 commit 3f984cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/gen_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ module Gen(P : sig val sctx : Super_context.t end) = struct
| Toplevel toplevel ->
Toplevel_rules.setup ~sctx ~dir ~toplevel;
For_stanza.empty_none
| Library lib ->
| Library lib when
Lib.DB.available (Scope.libs scope) (Dune_file.Library.best_name lib)
->
let cctx, merlin =
Lib_rules.rules lib ~sctx ~dir ~scope ~dir_contents ~expander in
{ For_stanza.
Expand Down
6 changes: 0 additions & 6 deletions test/blackbox-tests/test-cases/github2272/run.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
The @all alias should only build enabled libraries
$ dune build @all --display short
ocamldep disabled/.foo.objs/foo.ml.d
ocamlc disabled/.foo.objs/byte/foo.{cmi,cmo,cmt}
ocamlc disabled/foo.cma
ocamlopt disabled/.foo.objs/native/foo.{cmx,o}
ocamlopt disabled/foo.{a,cmxa}
ocamlopt disabled/foo.cmxs
8 changes: 1 addition & 7 deletions test/blackbox-tests/test-cases/optional/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ Various tests for optional libraries
Regression test for non-wrapped optional libraries with missing
dependencies (#1281):

$ dune build
$ dune build @install

Interaction between `@all` and optional libraries:

$ dune build @all
File "dune", line 6, characters 12-34:
6 | (libraries lib_that_doesn't_exist))
^^^^^^^^^^^^^^^^^^^^^^
Error: Library "lib_that_doesn't_exist" not found.
Hint: try: dune external-lib-deps --missing @all
[1]

0 comments on commit 3f984cd

Please sign in to comment.