forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg: improve error message when curl not installed (ocaml#10403)
Adds a hint and some details to the error message when curl is needed by dune but not installed. Also changes the formatting of "curl" in the error message to not use dune's formatting for commands, as it is the name of a program and not a command. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information
Showing
2 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Test the error message when curl is needed but not installed. | ||
|
||
$ . ./helpers.sh | ||
$ make_lockdir | ||
|
||
$ makepkg() { | ||
> make_lockpkg $1 <<EOF | ||
> (source | ||
> (fetch | ||
> (url "http://0.0.0.0:8000"))) | ||
> (version dev) | ||
> EOF | ||
> } | ||
|
||
$ makepkg foo | ||
|
||
Build the package in an environment without curl. | ||
$ PATH=$(dirname $(which dune)) build_pkg foo | ||
File "dune.lock/foo.pkg", line 3, characters 7-28: | ||
3 | (url "http://0.0.0.0:8000"))) | ||
^^^^^^^^^^^^^^^^^^^^^ | ||
Error: The program "curl" does not appear to be installed. Dune uses curl to | ||
download packages. Dune requires that the "curl" executable be located in one | ||
of the directories listed in the PATH variable. | ||
Hint: Install curl with your system package manager. | ||
[1] |