Pass FuzzIntrospector environment variables to bazel builds (#7367)

* Using bazelrc to pass env vars

* place bazelrc in /root/.bazelrc

* Setting spawn strategy to standalone

* undo changes in Dockerfile
This commit is contained in:
Navidem 2022-03-07 18:15:47 -08:00 committed by GitHub
parent 99f913ee76
commit 8b6a553a12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View File

@ -161,5 +161,6 @@ COPY cargo compile compile_afl compile_dataflow compile_libfuzzer compile_honggf
COPY llvmsymbol.diff $SRC
COPY detect_repo.py /opt/cifuzz/
COPY bazel.bazelrc /root/.bazelrc
CMD ["compile"]

View File

@ -0,0 +1,20 @@
# Copyright 2022 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.
#
################################################################################
# pass variables from environment
build --action_env=FUZZ_INTROSPECTOR
build --action_env=FUZZINTRO_OUTDIR

View File

@ -54,6 +54,8 @@ declare -r BAZEL_BUILD_FLAGS=(
"--@rules_fuzzing//fuzzing:cc_engine_sanitizer=none" \
"--cxxopt=-stdlib=libc++" \
"--linkopt=-lc++" \
"--verbose_failures" \
"--spawn_strategy=standalone" \
"--action_env=CC=${CC}" "--action_env=CXX=${CXX}" \
${BAZEL_EXTRA_BUILD_FLAGS[*]}
)