kythe.io@v0.0.68-0.20240422202219-7225dbc01741/.bazelrc (about)

     1  # Remote Build Execution requires a strong hash function, such as SHA256.
     2  startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
     3  # Bazel commands in the GCB (google-cloud-build) configuration as remote
     4  common:gcb --config=remote
     5  # An no-op "remote" configuration for GCB-run commands which otherwise lack the config.
     6  common:remote --color=auto
     7  
     8  # Disable persistent workers for Typescript (#3816)
     9  common --strategy=TsProject=remote,sandboxed,local
    10  
    11  # Compatibility flags to avoid regressions.
    12  common --incompatible_disallow_empty_glob
    13  # TODO: https://github.com/aspect-build/rules_js/issues/1256 - reenable when fixed
    14  #build --incompatible_config_setting_private_default_visibility  --incompatible_enforce_config_setting_visibility
    15  
    16  # We can't support bzlmod until (at least) protobuf does
    17  # https://github.com/kythe/kythe/issues/5893
    18  common --noenable_bzlmod
    19  
    20  common --workspace_status_command tools/buildstamp/get_workspace_status
    21  
    22  # Ensure clang is used, by default, over any other C++ installation (e.g. gcc).
    23  common --client_env=CC=clang
    24  # We require C++17, but bazel defaults to C++0x (pre-C++11).
    25  common --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17
    26  # Enable -Wmissing-prototypes for Kythe code, but not external repositories.
    27  common --per_file_copt=//...@-Wmissing-prototypes
    28  # Disable diagnostics when compiling protobufs.
    29  common --per_file_copt=.*\.pb\.cc@-w
    30  # Disable diagnostics on external repositories as we don't control them.
    31  common --per_file_copt=external/.*@-w
    32  # Disable diagnostics in host mode. There is no host_per_file_copt and
    33  # everything we build in the host configuration we either also build in the
    34  # target configuration or is external, so we can't control it.
    35  # If/when Bazel supports --host_per_file_copt, we could use that instead:
    36  # https://github.com/bazelbuild/bazel/issues/12406.
    37  common --host_copt=-w
    38  
    39  # Ensure environment variables are static across machines; allows for cross-user caching.
    40  common --experimental_strict_action_env
    41  
    42  # aspect_rules_js configuration
    43  build --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
    44  fetch --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
    45  query --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
    46  build --@aspect_rules_ts//ts:default_to_tsc_transpiler
    47  fetch --@aspect_rules_ts//ts:default_to_tsc_transpiler
    48  query --@aspect_rules_ts//ts:default_to_tsc_transpiler
    49  
    50  # Older versions of HotSpot get really crabby when they can't write
    51  # to /tmp/hsperfdata_{user}/{pid} and sandboxing+persistent workers
    52  # means all tasks share a PID. This failure is then logged this to stdout,
    53  # which breaks verifier tests that expect stdout to contain only entry data.
    54  # See: https://github.com/bazelbuild/bazel/issues/3236
    55  common --incompatible_sandbox_hermetic_tmp
    56  
    57  # By default, compile for Java 11, run on Java 11
    58  common --java_language_version=11
    59  common --tool_java_language_version=11
    60  common --java_runtime_version=remotejdk_11
    61  common --tool_java_runtime_version=remotejdk_11
    62  
    63  build:java11 --java_language_version=11
    64  build:java11 --tool_java_language_version=11
    65  build:java11 --java_runtime_version=remotejdk_11
    66  build:java11 --tool_java_runtime_version=remotejdk_11
    67  
    68  build:java17 --java_language_version=17
    69  build:java17 --tool_java_language_version=17
    70  build:java17 --java_runtime_version=remotejdk_17
    71  build:java17 --tool_java_runtime_version=remotejdk_17
    72  
    73  build:java19 --java_language_version=19
    74  build:java19 --tool_java_language_version=19
    75  build:java19 --java_runtime_version=remotejdk_19
    76  build:java19 --tool_java_runtime_version=remotejdk_19
    77  
    78  build:java20 --java_language_version=20
    79  build:java20 --tool_java_language_version=20
    80  build:java20 --java_runtime_version=remotejdk_20
    81  build:java20 --tool_java_runtime_version=remotejdk_20
    82  
    83  build:java21 --java_language_version=21
    84  build:java21 --tool_java_language_version=21
    85  build:java21 --java_runtime_version=remotejdk_21
    86  build:java21 --tool_java_runtime_version=remotejdk_21
    87  
    88  # Import default javacopts
    89  import %workspace%/tools/javacopts.bazelrc
    90  
    91  # For release, stamp binaries, use optimized mode w/ minimum line table debugging.
    92  build:release --stamp -c opt --copt=-gmlt
    93  
    94  # Use the RBE instance in the kythe-repo project
    95  build:remote --remote_instance_name=projects/kythe-repo/instances/default_instance --bes_instance_name=kythe-repo
    96  
    97  build:remote --google_default_credentials=true
    98  build:remote --jobs=50
    99  build:remote --remote_timeout=3600
   100  build:remote --remote_cache=grpcs://remotebuildexecution.googleapis.com
   101  build:remote --remote_executor=grpcs://remotebuildexecution.googleapis.com
   102  # Avoid fetching unnecessary intermediate files locally.
   103  build:remote --remote_download_toplevel
   104  
   105  # TODO(schroederc): add buildeventservice
   106  # build:remote --bes_backend="buildeventservice.googleapis.com"
   107  # build:remote --bes_timeout=60s
   108  # build:remote --bes_results_url="https://source.cloud.google.com/results/invocations/"
   109  
   110  # Starting with Bazel 0.27.0 strategies do not need to be explicitly
   111  # # defined. See https://github.com/bazelbuild/bazel/issues/7480
   112  build:remote --define=EXECUTOR=remote
   113  
   114  build:remote --java_runtime_version=rbe_jdk
   115  build:remote --tool_java_runtime_version=rbe_jdk
   116  build:remote --extra_toolchains=//tools/platforms/configs/rbe_default/java:all
   117  
   118  build:remote --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
   119  build:remote --crosstool_top=//tools/platforms/configs/rbe_default/cc:toolchain
   120  build:remote --extra_toolchains=//tools/platforms/configs/rbe_default/config:cc-toolchain
   121  
   122  build:remote --extra_execution_platforms=//tools/platforms:rbe
   123  build:remote --host_platform=//tools/platforms:rbe
   124  build:remote --platforms=//tools/platforms:rbe
   125  
   126  build:remote --repo_env=KYTHE_DO_NOT_DETECT_BAZEL_TOOLCHAINS=1
   127  build:remote --extra_toolchains=//tools/build_rules/lexyacc:lexyacc_remote_toolchain
   128  build:remote --extra_toolchains=//tools/build_rules/external_tools:external_tools_remote_toolchain
   129  
   130  build:remote --action_env=LEIN_JAVA_CMD=
   131  
   132  build:prepush --verbose_failures --noshow_loading_progress --noshow_progress
   133  test:prepush --test_summary=terse --test_output=errors
   134  test:prepush --test_tag_filters=-manual,-broken,-arc-ignore,-docker
   135  
   136  # Include additional flags for use in compile_commands.json
   137  build:compile-commands --features=-layering_check --features=-use_header_modules
   138  build:compile-commands --copt=-Wno-everything --copt=-Wno-error
   139  build:compile-commands --copt=-Wdeprecated-declarations --copt=-D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
   140  build:compile-commands --copt=-Wdeprecated-register --copt=-Wexpansion-to-defined
   141  build:compile-commands --copt=-Wignored-attributes --copt=-Wnon-pod-varargs --copt=-Wshadow-field
   142  build:compile-commands --copt=-Wshift-sign-overflow --copt=-Wtautological-undefined-compare
   143  build:compile-commands --copt=-Wthread-safety-analysis --copt=-Wthread-safety-beta --copt=-Wthread-safety-reference
   144  build:compile-commands --copt=-Wundefined-bool-conversion --copt=-Wunreachable-code --copt=-Wunused-const-variable
   145  build:compile-commands --copt=-Wunused-function --copt=-Wunused-lambda-capture --copt=-Wunused-local-typedef
   146  build:compile-commands --copt=-Wunused-private-field --copt=-Wuser-defined-warnings
   147  
   148  # Applies clang-tidy to targets without building them.
   149  build:clang-tidy --config=compile-commands
   150  build:clang-tidy --output_groups=report
   151  build:clang-tidy --aspects=@bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
   152  build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config
   153  
   154  # Compiles and runs the in-tree clang-tidy over targets.
   155  build:clang-tidy-from-source --config=clang-tidy
   156  build:clang-tidy-from-source --noincompatible_disallow_empty_glob
   157  build:clang-tidy-from-source --@bazel_clang_tidy//:clang_tidy_executable=@//tools/cpp:clang_tidy
   158  build:clang-tidy-from-source --@bazel_clang_tidy//:clang_tidy_additional_deps=@//tools/cpp:clang_tidy_deps
   159  
   160  # Support user-provided user.bazelrc
   161  try-import %workspace%/user.bazelrc