Skip to content
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

[CFL] Set CLUSTERFUZZLITE variable when building and running #7186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonathanmetzman
Copy link
Contributor

@jonathanmetzman jonathanmetzman commented Jan 26, 2022

@jonathanmetzman
Copy link
Contributor Author

CC @evverx

@evverx
Copy link
Contributor

evverx commented Jan 26, 2022

@jonathanmetzman thanks! I think the commit message should point to google/clusterfuzzlite#77 instead of #77.

FWIW Not that it matters but I think it would be better if CIFUZZ wasn't set when it's run on CFLite to make it possible for build scripts to really tell CIFuzz and CFLite apart. For example, CIFuzz automatically downloads public OSS-Fuzz corpora so build scripts don't have to do that but when they are run on CFLite it would probably make sense to download them manually. Then again, it covers that "weird" usecase where both CIFuzz and CFLite are used together to cover "main" branches and forks.

@jonathanmetzman
Copy link
Contributor Author

@jonathanmetzman thanks! I think the commit message should point to google/clusterfuzzlite#77 instead of #77.

FWIW Not that it matters but I think it would be better if CIFUZZ wasn't set when it's run on CFLite to make it possible for build scripts to really tell CIFuzz and CFLite apart. For example, CIFuzz automatically downloads public OSS-Fuzz corpora so build scripts don't have to do that but when they are run on CFLite it would probably make sense to download them manually. Then again, it covers that "weird" usecase where both CIFuzz and CFLite are used together to cover "main" branches and forks.

I was hoping this wouldn't be an issue. Lemme try and change this.

@evverx
Copy link
Contributor

evverx commented Jan 29, 2022

systemd has started using both CIFuzz and CFLite so issues like that are no longer theoretical :-)

@evverx
Copy link
Contributor

evverx commented Jan 29, 2022

I tried to get it around in systemd/systemd#22302 but apparently I can't easily pass environment variables to my build script because it doesn't seems to be possible to pass them on to docker with -e

@evverx
Copy link
Contributor

evverx commented Jan 29, 2022

I passed that environment variable using .clusterfuzzlite/Dockerfile

diff --git a/.clusterfuzzlite/Dockerfile b/.clusterfuzzlite/Dockerfile
index bdb0378ebc..a69d8bfb70 100644
--- a/.clusterfuzzlite/Dockerfile
+++ b/.clusterfuzzlite/Dockerfile
@@ -1,4 +1,5 @@
 FROM gcr.io/oss-fuzz-base/base-builder@sha256:14b332de0e18683f37386eaedbf735bc6e8d81f9c0e1138d620f2178e20cd30a
+ENV MERGE_WITH_OSS_FUZZ_CORPORA yes
 COPY . $SRC/systemd
 WORKDIR $SRC/systemd
 COPY tools/oss-fuzz.sh $SRC/build.sh

@evverx
Copy link
Contributor

evverx commented Jan 30, 2022

I think CFLite should pass UPLOAD_BUILD to build_fuzzers to make it possible to exclude those large corpora from artifacts. Without that environment variable I can't skip that step with something like

if [[ "$MERGE_WITH_OSS_FUZZ_CORPORA" == "yes" ]]; then

    # When the latest builds are uploaded by CFLite the large OSS-Fuzz corpora
    # should be excluded regardless of whether MERGE_WITH_OSS_FUZZ_CORPORA
    # is set to "yes" or not.
    [[ "$UPLOAD_BUILD" == "true" ]] && exit 0
    ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cflite ClusterFuzzLite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants