From 88bbe366b377b21dbecda46aa6dd63a323bb0c5e Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 25 Jul 2019 17:31:30 +0700 Subject: [PATCH] Change the default target to `@all` Signed-off-by: Rudi Grinberg --- CHANGES.md | 4 ++- src/build_system.ml | 2 +- .../test-cases/byte-code-only/run.t | 1 + .../test-cases/dune-project-edition/run.t | 2 +- .../test-cases/github1529/run.t | 2 +- .../test-cases/github1549/run.t | 2 +- .../test-cases/github2033/run.t | 2 +- test/blackbox-tests/test-cases/optional/run.t | 2 +- .../test-cases/private-public-overlap/run.t | 25 ++++++++++++++++++- test/blackbox-tests/test-cases/use-meta/run.t | 2 +- test/blackbox-tests/test-cases/variants/run.t | 2 +- 11 files changed, 36 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 06d5ecf28d01..06c601e594e9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,7 +17,7 @@ - Enable `(explicit_js_mode)` by default. (#1941, @nojb) -- Add an option to clear the console in-between builds with +- Add an option to clear the console in-between builds with `--terminal-persistence=clear-on-rebuild` - Stop symlinking object files to main directory for stanzas defined `jbuild` @@ -43,6 +43,8 @@ - Define (paths ...) fields in (context ...) definitions in order to set or extend any PATH-like variable in the context environment. (#2426, @nojb) +- Change default target from `@install` to `@all`. (#2449, @rgrinberg) + 1.11.0 (23/07/2019) ------------------- diff --git a/src/build_system.ml b/src/build_system.ml index 43e9b3090718..4aed5b3727c8 100644 --- a/src/build_system.ml +++ b/src/build_system.ml @@ -736,7 +736,7 @@ end = struct String.Map.set aliases "default" { deps = Path.Set.empty ; dyn_deps = - (Alias0.dep_rec_internal ~name:"install" ~dir ~ctx_dir + (Alias0.dep_rec_internal ~name:"all" ~dir ~ctx_dir >>^ fun (_ : bool) -> Path.Set.empty) ; actions = Appendable_list.empty diff --git a/test/blackbox-tests/test-cases/byte-code-only/run.t b/test/blackbox-tests/test-cases/byte-code-only/run.t index 49d0adaf44c4..6ab633c4b5a7 100644 --- a/test/blackbox-tests/test-cases/byte-code-only/run.t +++ b/test/blackbox-tests/test-cases/byte-code-only/run.t @@ -5,6 +5,7 @@ ocamldep src/.foo.objs/foo.ml.d ocamlc src/.foo.objs/byte/foo.{cmi,cmo,cmt} ocamlc src/foo.cma + ocamlc bin/toto.bc Check that building a native only executable fails $ env ORIG_PATH="$PATH" PATH="$PWD/ocaml-bin:$PATH" dune build --display short native-only/foo.exe diff --git a/test/blackbox-tests/test-cases/dune-project-edition/run.t b/test/blackbox-tests/test-cases/dune-project-edition/run.t index 3da59ccb13e1..6db66e56cc19 100644 --- a/test/blackbox-tests/test-cases/dune-project-edition/run.t +++ b/test/blackbox-tests/test-cases/dune-project-edition/run.t @@ -11,7 +11,7 @@ Test that using menhir automatically update the dune-project file $ echo '(library (name x)) (menhir (modules x))' >> src/dune - $ dune build + $ dune build @install Info: Appending this line to dune-project: (using menhir 2.0) $ cat dune-project (lang dune 2.0) diff --git a/test/blackbox-tests/test-cases/github1529/run.t b/test/blackbox-tests/test-cases/github1529/run.t index 40e0494e3c81..7503ebeeec3c 100644 --- a/test/blackbox-tests/test-cases/github1529/run.t +++ b/test/blackbox-tests/test-cases/github1529/run.t @@ -1,7 +1,7 @@ Reproduction case for #1529: using an extension when no dune-project file is present. - $ dune build + $ dune build @install Info: Creating file dune-project with this contents: | (lang dune 2.0) Info: Appending this line to dune-project: (using menhir 2.0) diff --git a/test/blackbox-tests/test-cases/github1549/run.t b/test/blackbox-tests/test-cases/github1549/run.t index 62a21f45a44b..ed89de4e414d 100644 --- a/test/blackbox-tests/test-cases/github1549/run.t +++ b/test/blackbox-tests/test-cases/github1549/run.t @@ -1,6 +1,6 @@ Reproduction case for #1549: too many parentheses in installed .dune files - $ dune build --root backend + $ dune build @install --root backend Entering directory 'backend' $ cat backend/_build/install/default/lib/dune_inline_tests/dune-package diff --git a/test/blackbox-tests/test-cases/github2033/run.t b/test/blackbox-tests/test-cases/github2033/run.t index 869c0edafa41..6400635fdc19 100644 --- a/test/blackbox-tests/test-cases/github2033/run.t +++ b/test/blackbox-tests/test-cases/github2033/run.t @@ -1,2 +1,2 @@ . should be allowed in c names - $ dune build + $ dune build @install diff --git a/test/blackbox-tests/test-cases/optional/run.t b/test/blackbox-tests/test-cases/optional/run.t index 7750d0d411be..0b1025aad198 100644 --- a/test/blackbox-tests/test-cases/optional/run.t +++ b/test/blackbox-tests/test-cases/optional/run.t @@ -4,7 +4,7 @@ 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: diff --git a/test/blackbox-tests/test-cases/private-public-overlap/run.t b/test/blackbox-tests/test-cases/private-public-overlap/run.t index 87fc040696e8..da02a9217995 100644 --- a/test/blackbox-tests/test-cases/private-public-overlap/run.t +++ b/test/blackbox-tests/test-cases/private-public-overlap/run.t @@ -8,15 +8,23 @@ public libraries may not have private dependencies Error: Library "privatelib" is private, it cannot be a dependency of a public library. You need to give "privatelib" a public name. + ocamldep .privatelib.objs/privatelib.ml.d + ocamlc .privatelib.objs/byte/privatelib.{cmi,cmo,cmt} + ocamlc privatelib.cma ocamldep .publiclib.objs/publiclib.ml.d + ocamlopt .privatelib.objs/native/privatelib.{cmx,o} + ocamlopt privatelib.{a,cmxa} + ocamlopt privatelib.cmxs [1] On the other hand, public libraries may have private preprocessors $ dune build --display short --root private-rewriter Entering directory 'private-rewriter' ocamlc .ppx_internal.objs/byte/ppx_internal.{cmi,cmo,cmt} + ocamlc ppx_internal.cma ocamlopt .ppx_internal.objs/native/ppx_internal.{cmx,o} ocamlopt ppx_internal.{a,cmxa} + ocamlopt ppx_internal.cmxs ocamlopt .ppx/56104176c8a6db31b669b5ba60470694/ppx.exe ppx mylib.pp.ml ocamldep .mylib.objs/mylib.pp.ml.d @@ -36,8 +44,16 @@ Unless they introduce private runtime dependencies: a public library. You need to give "private_runtime_dep" a public name. ocamlc .private_ppx.objs/byte/private_ppx.{cmi,cmo,cmt} + ocamlc private_ppx.cma + ocamldep .private_runtime_dep.objs/private_runtime_dep.ml.d + ocamlc .private_runtime_dep.objs/byte/private_runtime_dep.{cmi,cmo,cmt} + ocamlc private_runtime_dep.cma ocamlopt .private_ppx.objs/native/private_ppx.{cmx,o} ocamlopt private_ppx.{a,cmxa} + ocamlopt private_ppx.cmxs + ocamlopt .private_runtime_dep.objs/native/private_runtime_dep.{cmx,o} + ocamlopt private_runtime_dep.{a,cmxa} + ocamlopt private_runtime_dep.cmxs ocamlopt .ppx/6100aaab21a64480982f84e67ccfce18/ppx.exe ppx mylib.pp.ml ocamldep .mylib.objs/mylib.pp.ml.d @@ -50,7 +66,14 @@ However, public binaries may accept private dependencies ocamlc .publicbin.eobjs/byte/publicbin.{cmi,cmo,cmt} ocamlopt .publicbin.eobjs/native/publicbin.{cmx,o} ocamlopt publicbin.exe + ocamldep .privatelib.objs/privatelib.ml.d + ocamlc .privatelib.objs/byte/privatelib.{cmi,cmo,cmt} + ocamlc privatelib.cma + ocamlc publicbin.bc + ocamlopt .privatelib.objs/native/privatelib.{cmx,o} + ocamlopt privatelib.{a,cmxa} + ocamlopt privatelib.cmxs Private dependencies shouldn't make the library optional - $ dune build --display short --root optional + $ dune build @install --display short --root optional Entering directory 'optional' diff --git a/test/blackbox-tests/test-cases/use-meta/run.t b/test/blackbox-tests/test-cases/use-meta/run.t index da00f8014ed9..4f4c5fd15b3f 100644 --- a/test/blackbox-tests/test-cases/use-meta/run.t +++ b/test/blackbox-tests/test-cases/use-meta/run.t @@ -1,2 +1,2 @@ - $ dune build && dune exec -- ocamlfind opt -package foobarlib -linkpkg main.ml -o main.exe && ./main.exe + $ dune build @install && dune exec -- ocamlfind opt -package foobarlib -linkpkg main.ml -o main.exe && ./main.exe foobarlib diff --git a/test/blackbox-tests/test-cases/variants/run.t b/test/blackbox-tests/test-cases/variants/run.t index a04d7f37fba9..fb6d9819d2de 100644 --- a/test/blackbox-tests/test-cases/variants/run.t +++ b/test/blackbox-tests/test-cases/variants/run.t @@ -38,7 +38,7 @@ variants and finally default implementation. Check that variant data is installed in the dune package file. - $ dune build --root dune-package + $ dune build @install --root dune-package Entering directory 'dune-package' $ cat dune-package/_build/install/default/lib/a/dune-package (lang dune 2.0)