-
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
[infra] Update base-builder image to support go-fuzz (#2714). #2735
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,27 @@ RUN apt-get install -y git \ | |
libblocksruntime-dev \ | ||
libc6-dev-i386 | ||
|
||
# Download and install the latest stable Go. | ||
ADD https://storage.googleapis.com/golang/getgo/installer_linux $SRC/ | ||
|
||
# $SHELL is needed for the installer. | ||
ENV SHELL "bash" | ||
RUN chmod +x $SRC/installer_linux && \ | ||
$SRC/installer_linux && \ | ||
rm $SRC/installer_linux | ||
ENV SHELL "" | ||
|
||
# Set up Golang environment variables (copied from /root/.bash_profile). | ||
ENV PATH $PATH:/root/.go/bin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this block can be shortened to Also, why do we have /root/go and /root/.go ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Also added a comment to clarify:
|
||
ENV GOPATH /root/go | ||
ENV PATH $PATH:$GOPATH/bin | ||
|
||
# Dependency of go-fuzz | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: end with period. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
RUN go get golang.org/x/tools/go/packages | ||
|
||
# go-fuzz-build is the tool that instruments Go files. | ||
RUN go get github.com/dvyukov/go-fuzz/go-fuzz-build | ||
|
||
# Default build flags for various sanitizers. | ||
ENV SANITIZER_FLAGS_address "-fsanitize=address -fsanitize-address-use-after-scope" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,19 +16,9 @@ | |
|
||
FROM gcr.io/oss-fuzz-base/base-builder | ||
MAINTAINER [email protected] | ||
ADD https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz go.tar.gz | ||
RUN tar xzf go.tar.gz -C $SRC/ | ||
ENV GOPATH $SRC | ||
ENV PATH $SRC/go/bin:$GOPATH/bin:$PATH | ||
|
||
RUN go get -u -d github.com/google/syzkaller/... | ||
|
||
# Dependency of go-fuzz | ||
RUN go get golang.org/x/tools/go/packages | ||
|
||
# go-fuzz-build is the tool that instruments Go files. | ||
RUN go get github.com/dvyukov/go-fuzz/go-fuzz-build | ||
|
||
# Dependency for one of the fuzz targets. | ||
RUN go get github.com/ianlancetaylor/demangle | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why not add SHELL="bash" when calling the command itself, this removes lines 34 and 38.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, didn't know it was possible this way. Thanks!