From 48e6f45607301add2862a1a676e4f35dcbaa2392 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 30 Apr 2019 10:57:16 -0700 Subject: [PATCH] go-fuzz-build: set GO111MODULE=off while building Updates #195 Updates google/oss-fuzz/pull#2188 --- README.md | 3 +-- go-fuzz-build/main.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a13cedc0..9642cc679 100755 --- a/README.md +++ b/README.md @@ -113,8 +113,7 @@ $ go-fuzz-build This will produce png-fuzz.zip archive. Note that go-fuzz [does not support modules yet](https://github.com/dvyukov/go-fuzz/issues/195). -You may need to disable modules by setting environment variable `GO111MODULE=off` -before executing `go-fuzz-build`. +`go-fuzz-build` disables modules by setting environment variable `GO111MODULE=off` during the build. Now we are ready to go: ``` diff --git a/go-fuzz-build/main.go b/go-fuzz-build/main.go index 70efc7bcb..7a6a34132 100644 --- a/go-fuzz-build/main.go +++ b/go-fuzz-build/main.go @@ -465,6 +465,7 @@ func (c *Context) buildInstrumentedBinary(blocks *[]CoverBlock, sonar *[]CoverBl cmd.Env = append(os.Environ(), "GOROOT="+filepath.Join(c.workdir, "goroot"), "GOPATH="+filepath.Join(c.workdir, "gopath"), + "GO111MODULE=off", // temporary measure until we have proper module support ) if out, err := cmd.CombinedOutput(); err != nil { c.failf("failed to execute go build: %v\n%v", err, string(out))