Skip to content

Commit

Permalink
Merge branch 'master' into project/pypdf
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarco authored Jul 10, 2023
2 parents c585f43 + 479cd26 commit 36f502d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
16 changes: 13 additions & 3 deletions infra/build/functions/build_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
'GCB_BUILDPOOL_NAME', 'projects/oss-fuzz/locations/us-central1/'
'workerPools/buildpool')

OSS_FUZZ_EXPERIMENTS_BUILDPOOL_NAME = os.getenv(
'GCB_BUILDPOOL_NAME', 'projects/oss-fuzz/locations/us-central1/'
'workerPools/buildpool-experiments')

US_CENTRAL_CLIENT_OPTIONS = google.api_core.client_options.ClientOptions(
api_endpoint='https://us-central1-cloudbuild.googleapis.com/')

Expand Down Expand Up @@ -514,15 +518,20 @@ def get_build_body(steps,
timeout,
body_overrides,
build_tags,
use_build_pool=True):
use_build_pool=True,
experiment=False):
"""Helper function to create a build from |steps|."""
if 'GCB_OPTIONS' in os.environ:
options = yaml.safe_load(os.environ['GCB_OPTIONS'])
else:
options = {}

if use_build_pool:
options['pool'] = {'name': OSS_FUZZ_BUILDPOOL_NAME}
if experiment:
options['pool'] = {'name': OSS_FUZZ_EXPERIMENTS_BUILDPOOL_NAME}
else:
options['pool'] = {'name': OSS_FUZZ_BUILDPOOL_NAME}

build_body = {
'steps': steps,
'timeout': str(timeout) + 's',
Expand Down Expand Up @@ -554,7 +563,8 @@ def run_build( # pylint: disable=too-many-arguments
timeout,
body_overrides,
tags,
use_build_pool=use_build_pool)
use_build_pool=use_build_pool,
experiment=experiment)
if experiment:
with tempfile.NamedTemporaryFile(suffix='build.json') as config_file:
config_file.write(bytes(json.dumps(build_body), 'utf-8'))
Expand Down
2 changes: 1 addition & 1 deletion projects/brotli-java/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sed -i 's/1.6</1.7</g' ./pom.xml

MAVEN_ARGS="-Dmaven.test.skip=true -Djavac.src.version=11 -Djavac.target.version=11 -X"
$MVN package
find ./dec -name "dec-*.jar" -exec mv {} $OUT/dec.jar \;
find ./dec -name "org.brotli.dec-*.jar" -exec mv {} $OUT/dec.jar \;

ALL_JARS="dec.jar"
BUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- "$OUT/%s:"):$JAZZER_API_PATH
Expand Down
11 changes: 5 additions & 6 deletions projects/geos/patch.diff
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 14506516..2e236476 100644
index 3401775c8..70af383b4 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -11,4 +11,5 @@
@@ -10,3 +10,4 @@
################################################################################
add_subdirectory(unit)
add_subdirectory(xmltester)
add_subdirectory(bigtest)
+add_subdirectory(fuzz)

diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt
new file mode 100644
index 00000000..d0bd7a02
index 000000000..d0bd7a020
--- /dev/null
+++ b/tests/fuzz/CMakeLists.txt
@@ -0,0 +1,15 @@
Expand All @@ -31,7 +30,7 @@ index 00000000..d0bd7a02
+endif()
diff --git a/tests/fuzz/fuzz_geo2.c b/tests/fuzz/fuzz_geo2.c
new file mode 100644
index 00000000..ceee7ea6
index 000000000..ceee7ea6b
--- /dev/null
+++ b/tests/fuzz/fuzz_geo2.c
@@ -0,0 +1,69 @@
Expand Down
1 change: 1 addition & 0 deletions projects/quic-go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oss-fuzz.sh
15 changes: 10 additions & 5 deletions projects/quic-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@

FROM gcr.io/oss-fuzz-base/base-builder-go

RUN git clone --depth 1 https://github.com/quic-go/qpack/
RUN git clone --depth 1 https://github.com/quic-go/quic-go/
RUN git clone --depth 1 https://github.com/quic-go/qpack/ $GOPATH/src/github.com/quic-go/qpack
RUN git clone --depth 1 https://github.com/quic-go/quic-go/ $GOPATH/src/github.com/quic-go/quic-go

RUN cp quic-go/oss-fuzz.sh build.sh
# Enable this for easier local testing / repro
# COPY build.sh .
RUN cp $GOPATH/src/github.com/quic-go/quic-go/oss-fuzz.sh $SRC/build.sh
# Local testing:
# 1. copy oss-fuzz.sh from quic-go repo to projects/quic-go
# 2. uncomment this line
# 3. run infra/helper.py build_image quic-go
# COPY oss-fuzz.sh $SRC/build.sh

RUN chmod +x $SRC/build.sh

0 comments on commit 36f502d

Please sign in to comment.