diff --git a/src/dune_rules/run_with_path.ml b/src/dune_rules/run_with_path.ml index e08afd84e00..1d45fdc778e 100644 --- a/src/dune_rules/run_with_path.ml +++ b/src/dune_rules/run_with_path.ml @@ -8,6 +8,7 @@ let depexts_hint = function ; Pp.enumerate ~f:Pp.verbatim depexts ] |> Pp.concat_map ~sep:Pp.cut ~f:(fun pp -> Pp.box pp) + |> Pp.vbox |> Option.some ;; diff --git a/test/blackbox-tests/test-cases/pkg/depexts/error-message.t b/test/blackbox-tests/test-cases/pkg/depexts/error-message.t index 54bd8e10abb..e5c5e67a4f2 100644 --- a/test/blackbox-tests/test-cases/pkg/depexts/error-message.t +++ b/test/blackbox-tests/test-cases/pkg/depexts/error-message.t @@ -47,7 +47,8 @@ error message. File "dune-project", line 1, characters 0-0: Error: Invalid first line, expected: (lang ) - Hint: You may want to verify the following depexts are installed: + Hint: + You may want to verify the following depexts are installed: - gnupg - unzip [1] @@ -76,3 +77,58 @@ when the program is not found. Hint: You may want to verify the following depexts are installed: - unknown-package [1] + +Update the foo lockfile to have a single depext name: + $ make_lockpkg foo < (version 0.0.1) + > (build + > (run dune build)) + > (depexts foo) + > (source + > (fetch + > (url file://$PWD/foo.tar) + > (checksum md5=$(md5sum foo.tar | cut -f1 -d' ')))) + > EOF + +Build the project, when it fails building 'foo' package, it shows the depexts +error message. + $ dune build + File "dune.lock/foo.pkg", line 3, characters 6-10: + 3 | (run dune build)) + ^^^^ + Error: Logs for package foo + File "dune-project", line 1, characters 0-0: + Error: Invalid first line, expected: (lang ) + + Hint: You may want to verify the following depexts are installed: + - foo + [1] + + +Update the foo lockfile to have short depext names: + $ make_lockpkg foo < (version 0.0.1) + > (build + > (run dune build)) + > (depexts a b) + > (source + > (fetch + > (url file://$PWD/foo.tar) + > (checksum md5=$(md5sum foo.tar | cut -f1 -d' ')))) + > EOF + +Build the project, when it fails building 'foo' package, it shows the depexts +error message. + $ dune build + File "dune.lock/foo.pkg", line 3, characters 6-10: + 3 | (run dune build)) + ^^^^ + Error: Logs for package foo + File "dune-project", line 1, characters 0-0: + Error: Invalid first line, expected: (lang ) + + Hint: You may want to verify the following depexts are installed: + - a + - b + [1] +