Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1103 #1104

Merged
merged 2 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
next
----

- Fix `$ jbuilder --dev` (#1104, fixes #1103, @rgrinberg)


1.1.0 (06/08/2018)
------------------

Expand Down
7 changes: 4 additions & 3 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
10 changes: 10 additions & 0 deletions test/blackbox-tests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions test/blackbox-tests/test-cases/dev-flag-1103/run.t
Original file line number Diff line number Diff line change
@@ -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]