-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/go/internal/cache: provide GOFUZZCACHE environment variable #48901
Comments
This comment has been minimized.
This comment has been minimized.
We had a
Cached test results are also stored in the build cache and are also cleaned with a different flag.
The cache eviction code will be able to tell the files apart. Cached fuzz inputs go in a separate subdirectory.
We're considering a longer cache lifetime because of this. The linked issue above suggests removing fuzz inputs after 30 days without use. We do want some automatic eviction. If a fuzz target is removed or its input types are changed incompatibly, there's no reason to keep the cached files around. It's always possible to copy these files into |
For what it's worth, this is the main reason I follow this feature request. If I spend a full hour burning CPU to get a nice corpus, I don't want that to just vanish because I haven't worked on the project for a few weeks. I guess the answer should be "manually make a copy of the relevant corpus" whether GOFUZZCACHE exists or not. What I mainly want is an easy way to make a copy of the corpuses (corpora?) for a module, and I imagined that |
I totally agree with "right next to it". But then that location should be configurable.
Well, that's not entirely true:
Those environment variables are for advanced use-cases and users only. For example, I want to cache those caches separately on the CI. And you already expose this complexity via |
This isn't something that we can dedicate time for in 1.18, but let's re-visit for 1.19. I'm hopeful that 1.18 will provide some good user experience stories and help us better understand which features are most important. The extra context you provided here will be helpful it making that decision too. |
CC @golang/fuzzing Moving to Backlog. Please recategorize as appropriate. |
Go provides
GOCACHE
andGOMODCACHE
environment variables to control build and modules cache locations. There is no environment variable to control fuzz corpus cache location; it is hard-coded to be$GOCACHE/fuzz
.I think that fuzz cache is significantly different from the build (and test) cache:
go clean
flags;For that reason, I think it would be helpful to provide
GOFUZZCACHE
environment variable to control fuzz cache location. That would help people building automation around sharing that cache between machines.(I'm also not really sure that fuzz cache directory should be a subdirectory of the build cache by default, but that might be too late to change that.)
/cc @katiehockman @jayconrod
The text was updated successfully, but these errors were encountered: