Skip to content

Commit

Permalink
fix light
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski committed Jan 27, 2025
1 parent 2d66f87 commit 56bdf30
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
47 changes: 25 additions & 22 deletions infra/base-images/base-builder/compile
Original file line number Diff line number Diff line change
Expand Up @@ -234,40 +234,43 @@ if [ "$SANITIZER" = "introspector" ] || [ "$RUST_SANITIZER" = "introspector" ];

if [ "$FUZZING_LANGUAGE" = "python" ]; then
python3 /fuzz-introspector/src/main.py light --language=python
cp -rf $SRC/inspector/ /tmp/inspector-saved
elif [ "$FUZZING_LANGUAGE" = "jvm" ]; then
python3 /fuzz-introspector/src/main.py light --language=jvm
cp -rf $SRC/inspector/ /tmp/inspector-saved
elif [ "$FUZZING_LANGUAGE" = "rust" ]; then
python3 /fuzz-introspector/src/main.py light --language=rust
cp -rf $SRC/inspector/ /tmp/inspector-saved
else
python3 /fuzz-introspector/src/main.py light
fi

# Make a copy of the light. This is needed because we run two versions of
# introspector: one based on pure statis analysis and one based on
# regular LTO.
cp -rf $SRC/inspector/ /tmp/inspector-saved
# Make a copy of the light. This is needed because we run two versions of
# introspector: one based on pure statis analysis and one based on
# regular LTO.
cp -rf $SRC/inspector/ /tmp/inspector-saved


# Move coverage report.
if [ -d "$OUT/textcov_reports" ]
then
find $OUT/textcov_reports/ -name "*.covreport" -exec cp {} $SRC/inspector/ \;
find $OUT/textcov_reports/ -name "*.json" -exec cp {} $SRC/inspector/ \;
fi
# Move coverage report.
if [ -d "$OUT/textcov_reports" ]
then
find $OUT/textcov_reports/ -name "*.covreport" -exec cp {} $SRC/inspector/ \;
find $OUT/textcov_reports/ -name "*.json" -exec cp {} $SRC/inspector/ \;
fi

# Make fuzz-introspector HTML report using light approach.
REPORT_ARGS="--name=$PROJECT_NAME"
# Make fuzz-introspector HTML report using light approach.
REPORT_ARGS="--name=$PROJECT_NAME"

# Only pass coverage_url when COVERAGE_URL is set (in cloud builds)
if [[ ! -z "${COVERAGE_URL+x}" ]]; then
REPORT_ARGS="$REPORT_ARGS --coverage-url=${COVERAGE_URL}"
fi
# Only pass coverage_url when COVERAGE_URL is set (in cloud builds)
if [[ ! -z "${COVERAGE_URL+x}" ]]; then
REPORT_ARGS="$REPORT_ARGS --coverage-url=${COVERAGE_URL}"
fi

# Run pure static analysis fuzz introspector
fuzz-introspector full --target-dir=$SRC \
--language=${FUZZING_LANGUAGE} \
--out-dir=$SRC/inspector \
${REPORT_ARGS}
# Run pure static analysis fuzz introspector
fuzz-introspector full --target-dir=$SRC \
--language=${FUZZING_LANGUAGE} \
--out-dir=$SRC/inspector \
${REPORT_ARGS}
fi

rsync -avu --delete "$SRC/inspector/" "$OUT/inspector"
fi
Expand Down
2 changes: 1 addition & 1 deletion infra/base-images/base-clang/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y wget sudo && \
RUN apt-get update && apt-get install -y git && \
git clone https://github.com/ossf/fuzz-introspector.git fuzz-introspector && \
cd fuzz-introspector && \
git checkout d0e433ca1cc8a1a04b48ff1dfdb3507d9752f81b && \
git checkout b661b3d669cf56fbc3742e56b760af5e2b2ce1d2 && \
git submodule init && \
git submodule update && \
apt-get autoremove --purge -y git && \
Expand Down

0 comments on commit 56bdf30

Please sign in to comment.