test: Reproducer for refetching packages with symlinks#14429
test: Reproducer for refetching packages with symlinks#14429punchagan wants to merge 1 commit intoocaml:mainfrom
Conversation
0b68354 to
3bd10a6
Compare
This commit adds a test demonstrating the fact that even with the cache packages which contain file symlinks are refetched on fresh builds. The bug was discovered via a project that depends on the `menhir` project. Signed-off-by: Puneeth Chaganti <punchagan@muse-amuse.in>
3bd10a6 to
e4bbfcf
Compare
|
|
||
| The file that was fetched is in the cache. The symlink would have the same contents, so wouldn't appear separately in the cache. | ||
|
|
||
| $ find $DUNE_CACHE_ROOT/db/files -type f -exec md5sum {} \; | grep --quiet $CONTENT_CHECKSUM |
There was a problem hiding this comment.
I think you should use DUNE_TRACE=+cache and then check that there are cache store events that you expect. See test-cases/dune-cache for examples.
There was a problem hiding this comment.
What you would expect is that the source directory target gets (rightly) rejected from the cache here.
| cache, it will fail, as the source is 404 now: | ||
|
|
||
| $ dune clean | ||
| $ export DUNE_CACHE=disabled |
There was a problem hiding this comment.
This invalidates the digests of all the targets so not particularly important to test. Can be removed.
| Enabling the cache again also attempts to re-download the source, since it contains a symlink: | ||
|
|
||
| $ dune clean | ||
| $ export DUNE_CACHE=enabled |
There was a problem hiding this comment.
Best set the cache as enabled at the beginning and not change it since that will just change the digest of all the targets and rebuild anyway.
|
As we've discussed before: The caching of the downloaded mehhir sources are rejected because menhir sources contain a symlink. That's fine, but it means rerunning the entire action results in a download. A better solution would be to factor the rules so that downloading and extracting are separate. This would allow the downloading step to be cached while the extracting step would continue to be rerun, however should continue to not invalidate the rest of the build. |
This commit adds a test demonstrating the fact that packages which contain symlinks are refetched on fresh builds. The bug was discovered via a project that depends on the
menhirproject.