-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Explicitly disable Go modules via GO111MODULE=off for go-fuzz corpus #2878
Comments
I’m +1 on explicitly setting |
Should we set it inside the base-builder image (it is used for building all OSS-Fuzz projects), so that every project will have it automatically? |
Probably not. go-fuzz-corpus is unusual in that it is fuzzing the standard library. For regular Go projects, the right approach is to leave it unset. IIUC, @thepudds is in the process of making go-fuzz work correctly by default for normal projects...which will break go-fuzz-corpus without the explicit override, thus this issue. |
FWIW, I agree with @josharian's comments. One other data point is the cryptofuzz project on oss-fuzz sets oss-fuzz/projects/cryptofuzz/build.sh Line 34 in 2b13d85
I mentioned that mainly in support of explicitly setting (And I don't really have any opinion on using the build.sh vs. the docker file within the project). |
Hello @Dor1s, wanted to briefly check if this generally makes sense or not, and whether or not you have any open questions? The short version:
|
This will prevent breaking go-fuzz when it will support go modules dvyukov/go-fuzz#195 and addressing this issue: google#2878
This will prevent breaking go-fuzz when it will support go modules dvyukov/go-fuzz#195 and addressing this issue: #2878
Fixed by #2914. Thanks @yevgenypats! |
Background
Go modules are currently an opt-in feature of the go command. The GO111MODULE env var controls when module-mode is enabled for the go command.
go-fuzz does not currently support module-mode, but that might change soon.
Suggested change
It would be helpful to explicitly set
GO111MODULE=off
within oss-fuzz for projects/golang.The oss-fuzz change could look something like this.
The history is a bit confusing, but in short, it is likely better for oss-fuzz to be explicitly in control over whether or not module-mode is enabled by setting
GO111MODULE
explicitly, rather than being surprised on a random day by one or more upstream changes that are likely to happen.Additional details
This might be more detail than is interesting, but a bit more about the history here, as well as more on the rationale for this change:
GO111MODULE
did change twice during Go 1.13 dev cycle — first the default was changed fromauto
toon
, and then later that was reversed. The first time it changed to default toon
, that caused breakage for oss-fuzz (for example in Golang internal library fuzzers #2188 (comment)).GO111MODULE=off
within go-fuzz itself.GO111MODULE=off
(and most likely go-fuzz will start respecting the user's setting forGO111MODULE
at least to some degree).GO111MODULE
is planned to be changed again to default toon
during the Go 1.14 development cycle (which is a second try at the same change that broke oss-fuzz in Golang internal library fuzzers #2188 (comment)).Alternatives
Two alternatives to consider:
GO111MODULE=off
in the build.sh, set it in the docker file. That could be a reasonable choice as well. My guess is it makes more sense in build.sh, but the right answer here is probably dependent on the oss-fuzz philosophy.GO111MODULE=off
, setGO111MODULE=auto
. That could be a reasonable choice currently, but I think from oss-fuzz perspective, it is probably a more conservative change to doGO111MODULE=off
, including because go-fuzz currently setsGO111MODULE=off
(and notGO111MODULE=auto
), and also the meaning ofauto
changed during the Go 1.13 dev cycle and some small-ish chance the meaning ofauto
might change again on a random day during the Go 1.14 dev cycle, and hence slightly more future proof to not useauto
.CC @dvyukov @josharian @Dor1s @guidovranken @mvdan
The text was updated successfully, but these errors were encountered: