Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules: add mod clean -modcache or similar #3131

Open
myitcv opened this issue May 8, 2024 · 2 comments
Open

modules: add mod clean -modcache or similar #3131

myitcv opened this issue May 8, 2024 · 2 comments
Labels
FeatureRequest New feature or request modules Issues related to CUE modules and the experimental implementation

Comments

@myitcv
Copy link
Member

myitcv commented May 8, 2024

In the spirit of go clean -modcache: https://go.dev/ref/mod#go-clean-modcache

More detail to follow

@myitcv myitcv added FeatureRequest New feature or request modules Issues related to CUE modules and the experimental implementation labels May 8, 2024
@mvdan
Copy link
Member

mvdan commented May 10, 2024

My 2c: the only reason Go ended up with flags like -cache and -modcache is that go clean used to be for cleaning build artifacts from packages. Nowadays, almost noone uses it for that purpose anymore:

Clean removes object files from package source directories.
The go command builds most objects in a temporary directory,
so go clean is mainly concerned with object files left by other
tools or by manual invocations of go build.

I don't think we will ever have a need for such a "clean package build files" command. Even if evaluating a CUE package or building its e.g. wasm artifacts were to produce some sort of build output, that would be in the cache, not in the very same package directory.

For that reason, I think we should go for something like cue clean modcache, i.e. an argument instead of a flag. Given that all of our caches live under the same directory, we could also provide cue clean allcaches to delete all of it.

It's also worth noting that "modcache" is an artifact from Go's GOMODCACHE env var, which we do not have, so we can likely come up with a better name like go clean modulecache or, as a hierarchy, go clean cache/modules.

@mvdan
Copy link
Member

mvdan commented May 11, 2024

or, as a hierarchy, go clean cache/modules.

note that this prompted me to file #3139.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest New feature or request modules Issues related to CUE modules and the experimental implementation
Projects
Status: Backlog
Development

No branches or pull requests

2 participants