Skip to content

Commit

Permalink
fix(install): respect display options
Browse files Browse the repository at this point in the history
<!-- ps-id: e2cecc12-1609-4398-97d1-1d56cdbcfd8d -->

Signed-off-by: Ali Caglayan <alizter@gmail.com>
  • Loading branch information
Alizter committed Feb 19, 2023
1 parent 4a9d0db commit 6d11bc3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------

- dune install now respects --display=quiet mode (#7116, fixes #7106, @Alizter)

3.7.0 (2023-02-17)
------------------

Expand Down
7 changes: 5 additions & 2 deletions bin/install_uninstall.ml
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,11 @@ let install_uninstall ~what =
| true ->
Ops.remove_dir_if_exists ~if_non_empty:Fail dst
| false -> Ops.remove_file_if_exists dst);
print_line "%s %s" msg
(Path.to_string_maybe_quoted dst);
(match config.display.verbosity with
| Quiet -> ()
| _ ->
print_line "%s %s" msg
(Path.to_string_maybe_quoted dst));
Ops.mkdir_p dir;
let executable =
Section.should_set_executable_bit entry.section
Expand Down
34 changes: 34 additions & 0 deletions test/blackbox-tests/test-cases/install/display.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Test installation display output

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (package (name foo))
> EOF
$ cat >dune <<EOF
> (library
> (public_name foo))
> EOF

$ cat >foo.ml <<EOF
> let x = "foo"
> EOF

$ dune build @install

dune install should not output any "Installing" messages:

$ dune install --display=quiet --prefix prefix

and for comparison here is the output normally:

$ dune install --prefix prefix
Deleting prefix/lib/foo/META
Deleting prefix/lib/foo/dune-package
Deleting prefix/lib/foo/foo.a
Deleting prefix/lib/foo/foo.cma
Deleting prefix/lib/foo/foo.cmi
Deleting prefix/lib/foo/foo.cmt
Deleting prefix/lib/foo/foo.cmx
Deleting prefix/lib/foo/foo.cmxa
Deleting prefix/lib/foo/foo.ml
Deleting prefix/lib/foo/foo.cmxs

0 comments on commit 6d11bc3

Please sign in to comment.