Integrating CodeIntelligenceTesting Go (#7191)

Integrating *CodeIntelligenceTesting* `Go` to support more informative instrumentation (for [this issue](https://github.com/google/oss-fuzz/issues/7164)):
1. A script to install the new `Go`
    * Bootstrap from the existing `Go`
    * Install `Go` from [CodeIntelligenceTesting](https://github.com/CodeIntelligenceTesting/go/tree/dev.libfuzzer.18)
    * Skip the built-in test case in CodeIntelligenceTesting because they take too long and one of them erroneously fails.
2. Create a new directory & `Dockerfile` dedicated to the new Go 
3. Add the new base directory name to [base_images.py](https://github.com/google/oss-fuzz/blob/master/infra/build/functions/base_images.py)
This commit is contained in:
Dongge Liu 2022-01-31 11:47:36 +11:00 committed by GitHub
parent 1f7c15061f
commit 3ad503f001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
FROM gcr.io/oss-fuzz-base/base-builder-go
RUN install_go_CodeIntelligenceTesting.sh

View File

@ -154,6 +154,7 @@ COPY cargo compile compile_afl compile_dataflow compile_libfuzzer compile_honggf
write_labels.py bazel_build_fuzz_tests \ write_labels.py bazel_build_fuzz_tests \
# Go, java, and swift installation scripts. # Go, java, and swift installation scripts.
install_go.sh \ install_go.sh \
install_go_CodeIntelligenceTesting.sh \
install_java.sh \ install_java.sh \
install_python.sh \ install_python.sh \
install_rust.sh \ install_rust.sh \

View File

@ -0,0 +1,36 @@
#!/bin/bash -eux
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
# Install CodeIntelligenceTesting Go.
## Require at least Go1.4 to boostrap.
cd /tmp
git clone --depth=1 -b dev.libfuzzer.18 https://github.com/CodeIntelligenceTesting/go.git .go-CodeIntelligenceTesting
cd .go-CodeIntelligenceTesting/src
# Disable tests, at least one of which erroneously fails.
sed -i '/^exec .* tool dist test -rebuild "$@"/ s/./#&/' run.bash
./all.bash
# Replace original Go with the one from CodeIntelligenceTesting.
rm -rf /root/.go
mv -f /tmp/.go-CodeIntelligenceTesting /root/.go
# Install go114-fuzz-build with the new Go.
rm -rf "$GOPATH/"
mkdir -p "$GOPATH/"
go install github.com/mdempsky/go114-fuzz-build@latest
ln -s "$GOPATH/bin/go114-fuzz-build" "$GOPATH/bin/go-fuzz"

View File

@ -25,6 +25,7 @@ BASE_IMAGES = [
'base-clang', 'base-clang',
'base-builder', 'base-builder',
'base-builder-go', 'base-builder-go',
'base-builder-go-codeintelligencetesting',
'base-builder-jvm', 'base-builder-jvm',
'base-builder-python', 'base-builder-python',
'base-builder-rust', 'base-builder-rust',