Skip to content

Commit 7dae611

Browse files
committed
pkg: Force breaks between depext hint and depext list
Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
1 parent a88ec65 commit 7dae611

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

src/dune_rules/run_with_path.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ let depexts_hint = function
88
; Pp.enumerate ~f:Pp.verbatim depexts
99
]
1010
|> Pp.concat_map ~sep:Pp.cut ~f:(fun pp -> Pp.box pp)
11+
|> Pp.vbox
1112
|> Option.some
1213
;;
1314

test/blackbox-tests/test-cases/pkg/depexts/error-message.t

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ error message.
4747
File "dune-project", line 1, characters 0-0:
4848
Error: Invalid first line, expected: (lang <lang> <version>)
4949

50-
Hint: You may want to verify the following depexts are installed:
50+
Hint:
51+
You may want to verify the following depexts are installed:
5152
- gnupg
5253
- unzip
5354
[1]
@@ -76,3 +77,58 @@ when the program is not found.
7677
Hint: You may want to verify the following depexts are installed:
7778
- unknown-package
7879
[1]
80+
81+
Update the foo lockfile to have a single depext names:
82+
$ make_lockpkg foo <<EOF
83+
> (version 0.0.1)
84+
> (build
85+
> (run dune build))
86+
> (depexts foo)
87+
> (source
88+
> (fetch
89+
> (url file://$PWD/foo.tar)
90+
> (checksum md5=$(md5sum foo.tar | cut -f1 -d' '))))
91+
> EOF
92+
93+
Build the project, when it fails building 'foo' package, it shows the depexts
94+
error message.
95+
$ dune build
96+
File "dune.lock/foo.pkg", line 3, characters 6-10:
97+
3 | (run dune build))
98+
^^^^
99+
Error: Logs for package foo
100+
File "dune-project", line 1, characters 0-0:
101+
Error: Invalid first line, expected: (lang <lang> <version>)
102+
103+
Hint: You may want to verify the following depexts are installed:
104+
- foo
105+
[1]
106+
107+
108+
Update the foo lockfile to have short depext names:
109+
$ make_lockpkg foo <<EOF
110+
> (version 0.0.1)
111+
> (build
112+
> (run dune build))
113+
> (depexts a b)
114+
> (source
115+
> (fetch
116+
> (url file://$PWD/foo.tar)
117+
> (checksum md5=$(md5sum foo.tar | cut -f1 -d' '))))
118+
> EOF
119+
120+
Build the project, when it fails building 'foo' package, it shows the depexts
121+
error message.
122+
$ dune build
123+
File "dune.lock/foo.pkg", line 3, characters 6-10:
124+
3 | (run dune build))
125+
^^^^
126+
Error: Logs for package foo
127+
File "dune-project", line 1, characters 0-0:
128+
Error: Invalid first line, expected: (lang <lang> <version>)
129+
130+
Hint: You may want to verify the following depexts are installed:
131+
- a
132+
- b
133+
[1]
134+

0 commit comments

Comments
 (0)