1# Allow directories as sources. 2startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1 3build --incompatible_strict_action_env 4build --sandbox_tmpfs_path=/tmp 5build --enable_platform_specific_config 6build -c opt 7# Ensure that paths of files printed by our examples are valid. 8build --nozip_undeclared_test_outputs 9 10# C/C++ 11# GCC is supported on a best-effort basis. 12common --repo_env=CC=clang 13build --incompatible_enable_cc_toolchain_resolution 14# Required by abseil-cpp. 15build --cxxopt=-std=c++14 16# Requires a relatively modern clang. 17build:ci --features=layering_check 18build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain 19build:macos --crosstool_top=@local_config_apple_cc//:toolchain 20build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain 21 22# Java 23# Always build for Java 8, even with a newer JDK. This ensures that all 24# artifacts we release are compatible with Java 8 runtimes. 25# Note: We would like to use --release, but can't due to 26# https://bugs.openjdk.org/browse/JDK-8214165. 27build --javacopt=-target --javacopt=8 28build --java_language_version=8 29build --tool_java_language_version=8 30# Use a hermetic JDK to compile Java code, which also means that contributors 31# don't need to install a JDK to compile Jazzer. 32build --java_runtime_version=remotejdk_17 33build --tool_java_runtime_version=remotejdk_17 34# Speed up Java compilation by removing indirect deps from the compile classpath. 35build --experimental_java_classpath=bazel 36 37# Android 38build:android_arm --incompatible_enable_android_toolchain_resolution 39build:android_arm --android_platforms=//:android_arm64 40build:android_arm --copt=-D_ANDROID 41build:android_arm --java_runtime_version=local_jdk 42 43# Windows 44# Only compiles with clang on Windows. 45build:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl 46build:windows --extra_execution_platforms=//bazel/platforms:x64_windows-clang-cl 47build:windows --features=static_link_msvcrt 48# Required as PATH doubles as the shared library search path on Windows and the 49# Java agent functionality depends on system-provided shared libraries. 50test:windows --noincompatible_strict_action_env 51run:windows --noincompatible_strict_action_env 52 53# macOS 54# Workaround for https://github.com/bazelbuild/bazel/issues/13944, which breaks external Java 55# dependencies on M1 Macs without Rosetta. 56build:macos --extra_toolchains=//bazel/toolchains:java_non_prebuilt_definition 57 58# Toolchain 59# Since the toolchain is conditional on OS and architecture, set it on the particular GitHub Action. 60common:toolchain --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 61 62# Forward debug variables to tests 63build --test_env=JAZZER_AUTOFUZZ_DEBUG 64build --test_env=JAZZER_REFLECTION_DEBUG 65 66# Interactively debug Jazzer integration tests by passing --config=debug and attaching to port 5005. 67# This is different from --java_debug: It affects the actual inner Jazzer process rather than the 68# outer FuzzTargetTestWrapper. 69test:debug --test_env=JAZZER_DEBUG=1 70test:debug --test_output=streamed 71test:debug --test_strategy=exclusive 72test:debug --test_timeout=9999 73test:debug --nocache_test_results 74 75# CI tests (not using the toolchain to test OSS-Fuzz & local compatibility) 76build:ci --bes_results_url=https://app.buildbuddy.io/invocation/ 77build:ci --bes_backend=grpcs://remote.buildbuddy.io 78build:ci --remote_cache=grpcs://remote.buildbuddy.io 79build:ci --remote_timeout=3600 80# Fail if Bazel can't find Xcode. This improves error messages as the fallback toolchain will only 81# fail when requested to cross-compile. 82build:ci --repo_env=BAZEL_USE_XCODE_TOOLCHAIN=1 83# Suggested by BuildBuddy 84build:ci --noslim_profile 85build:ci --experimental_profile_include_target_label 86build:ci --experimental_profile_include_primary_output 87build:ci --nolegacy_important_outputs 88 89# Docker images 90common:docker --config=toolchain 91common:docker --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux 92 93# Generic coverage configuration taken from https://github.com/fmeum/rules_jni 94coverage --combined_report=lcov 95coverage --experimental_use_llvm_covmap 96coverage --experimental_generate_llvm_lcov 97coverage --repo_env=CC=clang 98coverage --repo_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1 99coverage --repo_env=GCOV=llvm-profdata 100 101# Instrument all source files of non-test targets matching at least one of these regexes. 102coverage --instrumentation_filter=^//src/main[:/],^//sanitizers/src/main[:/] 103coverage --test_tag_filters=-no-coverage 104 105# Hide all non-structured output in scripts. 106# https://github.com/bazelbuild/bazel/issues/4867#issuecomment-830402410 107common:quiet --ui_event_filters=-info,-stderr 108common:quiet --noshow_progress 109