You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caching the module directory: basically you want to invalidate this when go.mod or go.sum changes. However, as currently constructed the manifest/hash_files function make this impossible
Caching intermediate build/test artifacts: I want to invalidate this when any file ending in .go changes anywhere in the repo. Also difficult to do as currently constructed - I don't want to grab everything in a folder (and e.g. cache the contents of a .git directory, random .md files). But would be possible with e.g. a **/*.go wildcard.
I can't really use the plugin as currently designed without support for these two use cases.
The text was updated successfully, but these errors were encountered:
kevinburkesegment
changed the title
More complicated cache use cases
More options for invalidating caches using the manifest
Jan 6, 2025
toote
linked a pull request
Feb 1, 2025
that will
close
this issue
@kevinburkesegment thanks a lot for the use-case. They are quite eye-opening and I have implemented the option to specify multiple manifests in #63 which should take care of the first item.
Implementing the second one is a lot more cumbersome due to the way the recursive hashing of the files and folders is done. The multi-folder traversal in path globs (i.e. **) in bash is not implemented everywhere and even if it is, it depends on the globstar option that is turned off by default . But I may have a workaround: create a repository-level post-checkout hook with something like find . -name '*.go' -exec shasum \{\} \; > gofiles, which means that you can now use this gofiles file as your manifest file option. When the checksum of any of them changes the cache should get invalidated. What do you think?
For Go, two come to mind:
Caching the module directory: basically you want to invalidate this when go.mod or go.sum changes. However, as currently constructed the manifest/
hash_files
function make this impossibleCaching intermediate build/test artifacts: I want to invalidate this when any file ending in .go changes anywhere in the repo. Also difficult to do as currently constructed - I don't want to grab everything in a folder (and e.g. cache the contents of a .git directory, random .md files). But would be possible with e.g. a
**/*.go
wildcard.I can't really use the plugin as currently designed without support for these two use cases.
The text was updated successfully, but these errors were encountered: