-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only logs the standard output when the command fails or the user explicitly requests it. Add new flag `--debug-package-logs`, which force dune to display the stdout logs when dealing with package management. Signed-off-by: Etienne Marais <[email protected]> Signed-off-by: Christine Rose <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
- Loading branch information
Showing
8 changed files
with
170 additions
and
23 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,3 @@ | ||
- pkg: only logs the standard output when the command fails or the user explicitly requests it. | ||
Add new flag `--debug-package-logs`, which force dune to display the stdout logs when dealing | ||
with package management (#10662, @maiste) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Test the error message when installing package that fails. | ||
|
||
$ . ./helpers.sh | ||
$ make_lockdir | ||
$ export DUNE_DEBUG_PACKAGE_LOGS=0 | ||
|
||
Make a project with two packages, one successful and one that fails: | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.12) | ||
> EOF | ||
|
||
Create a package with a failing command that throws an error: | ||
|
||
$ make_lockpkg x << EOF | ||
> (version 0.0.1) | ||
> (build | ||
> (progn | ||
> (run cat i_dont_exist))) | ||
> EOF | ||
|
||
Building the package should fail and print an error: | ||
|
||
$ build_pkg x 2>&1 | sed -E 's#/.*/cat#cat#g' | ||
File "dune.lock/x.pkg", line 4, characters 11-14: | ||
4 | (run cat i_dont_exist))) | ||
^^^ | ||
Error: Logs for package x | ||
cat: i_dont_exist: No such file or directory | ||
|
||
|
||
Create a package with a succeeding command that displays some text: | ||
|
||
$ make_lockpkg y << EOF | ||
> (version 0.0.1) | ||
> (build | ||
> (progn | ||
> (run echo "Success!"))) | ||
> EOF | ||
|
||
Building the package should succeed and print no output: | ||
|
||
$ build_pkg y | ||
|
||
Checks the package is installed: | ||
|
||
$ show_pkg_cookie y | ||
{ files = map {}; variables = [] } |
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