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