Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverchang committed Nov 6, 2024
1 parent 321a3fe commit 475c185
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 64 deletions.
6 changes: 0 additions & 6 deletions infra/base-images/base-builder/compile
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,6 @@ else
fi
fi

if [[ ! -z "${STORE_CCACHE-}" ]]; then
# Cleanup existing cache.
rm -rf $WORK/ccache
cp -rf /ccache/cache $WORK/ccache
fi

if [ "$SANITIZER" = "introspector" ]; then
unset CXXFLAGS
unset CFLAGS
Expand Down
7 changes: 2 additions & 5 deletions infra/experimental/chronos/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ projs=$(echo $c_project_yaml | xargs dirname | xargs basename -a | sort)
cd infra/experimental/chronos

for proj in $projs; do
fuzz_target=$(curl -s "https://introspector.oss-fuzz.com/api/harness-source-and-executable?project=$proj" | jq --raw-output '.pairs[0].executable')
if [ "$fuzz_target" != null ]; then
echo ./build_on_cloudbuild.sh $proj $fuzz_target c
./build_on_cloudbuild.sh $proj $fuzz_target c
fi
echo ./build_on_cloudbuild.sh $proj c
./build_on_cloudbuild.sh $proj c
done
7 changes: 3 additions & 4 deletions infra/experimental/chronos/build_on_cloudbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
#
################################################################################
PROJECT=$1
FUZZ_TARGET=$2
FUZZING_LANGUAGE=$3
FUZZING_LANGUAGE=$2

gcloud builds submit "https://github.com/google/oss-fuzz" \
--async \
--git-source-revision=master \
--git-source-revision=add-replay-capture-1 \
--config=cloudbuild.yaml \
--substitutions=_PROJECT=$PROJECT,_FUZZ_TARGET=$FUZZ_TARGET,_FUZZING_LANGUAGE=$FUZZING_LANGUAGE \
--substitutions=_PROJECT=$PROJECT,_FUZZING_LANGUAGE=$FUZZING_LANGUAGE \
--project=oss-fuzz \
--region=us-central1
25 changes: 16 additions & 9 deletions infra/experimental/chronos/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,22 @@ steps:
- gcr.io/oss-fuzz/${_PROJECT}
- .
dir: projects/${_PROJECT}
- name: ubuntu
args:
- mkdir
- /workspace/ccache
- name: 'gcr.io/cloud-builders/docker'
args:
- run
- --entrypoint=/bin/sh
- --env=SANITIZER=address
- --env=STORE_CCACHE=1
- --env=COMPILE_USING_CCACHE=1
- --env=CCACHE_DIR=/workspace/ccache
- --env=FUZZING_LANGUAGE=${_FUZZING_LANGUAGE}
- --name=${_PROJECT}-origin-asan
- --volume=/workspace/ccache:/workspace/ccache
- gcr.io/oss-fuzz/${_PROJECT}
- -c
- "compile && rm -rf /out/*"
- "export PATH=/ccache/bin:$$PATH && compile && rm -rf /out/*"
- name: ubuntu
args:
- cp
Expand All @@ -52,7 +57,7 @@ steps:
# Prepare for ccache environment
- name: ubuntu
args:
- infra/experimental/chronos/prepare-ccache
- /workspace/infra/experimental/chronos/prepare-ccache
- ${_PROJECT}
# Build the ccached instance
- name: 'gcr.io/cloud-builders/docker'
Expand All @@ -67,19 +72,21 @@ steps:
args:
- rm
- -rf
- projects/${_PROJECT}/ccache
- projects/${_PROJECT}/ccache-cache
- /workspace/ccache
# Build coverage image
- name: 'gcr.io/cloud-builders/docker'
args:
- run
- --entrypoint=/bin/sh
- --env=SANITIZER=coverage
- --env=STORE_CCACHE=1
- --env=COMPILE_USING_CCACHE=1
- --env=CCACHE_DIR=/workspace/ccache
- --env=FUZZING_LANGUAGE=${_FUZZING_LANGUAGE}
- --name=${_PROJECT}-origin-cov
- --volume=/workspace/ccache:/workspace/ccache
- gcr.io/oss-fuzz/${_PROJECT}
- -c
- "compile && rm -rf /out/*"
- "export PATH=/ccache/bin:$$PATH && compile && rm -rf /out/*"
- name: ubuntu
args:
- cp
Expand All @@ -89,7 +96,7 @@ steps:
# Prepare for ccache environment
- name: ubuntu
args:
- infra/experimental/chronos/prepare-ccache
- /workspace/infra/experimental/chronos/prepare-ccache
- ${_PROJECT}
# Build the ccached instance
- name: 'gcr.io/cloud-builders/docker'
Expand Down
40 changes: 0 additions & 40 deletions infra/experimental/chronos/prepare-recompile

This file was deleted.

0 comments on commit 475c185

Please sign in to comment.