diff --git a/CHANGES.md b/CHANGES.md index 3b4bdd3938d..e4b4238d8bb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,9 @@ +next +---- + +- Fix `$ jbuilder --dev` (#1104, fixes #1103, @rgrinberg) + + 1.1.0 (06/08/2018) ------------------ diff --git a/bin/main.ml b/bin/main.ml index 6f9e6009e75..d9a8f494807 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -399,9 +399,10 @@ let common = & info ["dev"] ~docs ~doc:{|Same as $(b,--profile dev)|}) in - match dev with - | false -> `Ok false - | true -> + match dev, Which_program.t with + | false, (Dune | Jbuilder) -> `Ok false + | true, Jbuilder -> `Ok true + | true, Dune -> `Error (true, "--dev is no longer accepted as it is now the default.") and profile = diff --git a/test/blackbox-tests/dune.inc b/test/blackbox-tests/dune.inc index c41db9a7dd7..af7c5ab8e32 100644 --- a/test/blackbox-tests/dune.inc +++ b/test/blackbox-tests/dune.inc @@ -95,6 +95,14 @@ test-cases/depend-on-the-universe (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) +(alias + (name dev-flag-1103) + (deps (package dune) (source_tree test-cases/dev-flag-1103)) + (action + (chdir + test-cases/dev-flag-1103 + (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) + (alias (name dune-jbuild-var-case) (deps (package dune) (source_tree test-cases/dune-jbuild-var-case)) @@ -755,6 +763,7 @@ (alias custom-build-dir) (alias dep-vars) (alias depend-on-the-universe) + (alias dev-flag-1103) (alias dune-jbuild-var-case) (alias dune-ppx-driver-system) (alias dune-project-edition) @@ -848,6 +857,7 @@ (alias custom-build-dir) (alias dep-vars) (alias depend-on-the-universe) + (alias dev-flag-1103) (alias dune-jbuild-var-case) (alias dune-ppx-driver-system) (alias dune-project-edition) diff --git a/test/blackbox-tests/test-cases/dev-flag-1103/run.t b/test/blackbox-tests/test-cases/dev-flag-1103/run.t new file mode 100644 index 00000000000..42eb527e8f8 --- /dev/null +++ b/test/blackbox-tests/test-cases/dev-flag-1103/run.t @@ -0,0 +1,11 @@ +jbuilder --dev flag is accepted + + $ jbuilder build --dev + +dune --dev flag is rejected + + $ dune build --dev + dune: --dev is no longer accepted as it is now the default. + Usage: dune build [OPTION]... [TARGET]... + Try `dune build --help' or `dune --help' for more information. + [1]