-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(cache): add
dune cache size
command
<!-- ps-id: 4b121081-bff4-484a-87fc-15e1f4648dc9 --> Signed-off-by: Ali Caglayan <alizter@gmail.com>
- Loading branch information
Showing
7 changed files
with
80 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(lang dune 3.7) | ||
(cache enabled) | ||
(cache-storage-mode copy) |
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,7 @@ | ||
(rule | ||
(targets target_a) | ||
(action | ||
(with-outputs-to | ||
target_a | ||
(echo | ||
Hello World!)))) |
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 @@ | ||
(lang dune 3.7) |
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 @@ | ||
This test checks that the dune cache size command returns the correct size of | ||
the cache. | ||
|
||
$ export DUNE_CACHE=enabled | ||
$ export DUNE_CACHE_ROOT=$PWD/.cache | ||
|
||
We build a simple file which the contents of "Hello World". | ||
|
||
$ dune build target_a --display=short | ||
|
||
Now we remove it so that we are checking the size of the file rather than the | ||
link Dune created. | ||
|
||
$ rm _build/default/target_a | ||
|
||
The size command reports the size of the file in bytes in human readable form. | ||
It correctly reports 12 bytes. | ||
|
||
$ dune cache size | ||
12B | ||
|
||
We also have a machine readable version of the command which reports the size in | ||
bytes directly without any units. | ||
|
||
$ dune cache size --machine-readable | ||
12 |
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