-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg: add support for opam
depexts
(#10900)
* pkg: add support for opam depexts `dune` will just print a warning message whenever a package fails to build. Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
- Loading branch information
1 parent
cc26034
commit 4f86203
Showing
7 changed files
with
189 additions
and
43 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
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
53 changes: 53 additions & 0 deletions
53
test/blackbox-tests/test-cases/pkg/depexts/error-message.t
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,53 @@ | ||
When a package fails to build, dune will print opam depexts warning. | ||
|
||
$ . ../helpers.sh | ||
$ mkrepo | ||
$ add_mock_repo_if_needed | ||
|
||
Make a library that would fail when building it: | ||
$ mkdir foo | ||
$ cat > foo/dune-project <<EOF | ||
> EOF | ||
$ tar -czf foo.tar.gz foo | ||
$ rm -rf foo | ||
|
||
Make a project that uses the foo library: | ||
$ cat > dune-project <<EOF | ||
> (lang dune 3.13) | ||
> (package | ||
> (name bar) | ||
> (depends foo)) | ||
> EOF | ||
$ cat > dune <<EOF | ||
> (executable | ||
> (public_name bar) | ||
> (libraries foo)) | ||
> EOF | ||
|
||
Make dune.lock files | ||
$ make_lockdir | ||
$ cat > dune.lock/foo.pkg <<EOF | ||
> (version 0.0.1) | ||
> (build | ||
> (run dune build)) | ||
> (depexts unzip gnupg) | ||
> (source | ||
> (fetch | ||
> (url file://$PWD/foo.tar.gz) | ||
> (checksum md5=$(md5sum foo.tar.gz | 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 <lang> <version>) | ||
|
||
You may want to verify the following depexts are installed: | ||
- unzip | ||
- gnupg | ||
[1] |
Oops, something went wrong.