Chris McDonald | 9581238 | 2022-01-11 12:36:32 -0700 | [diff] [blame] | 1 | # Assume we're building on x86_64 Linux for now. |
| 2 | build --host_platform @rules_cros//cros/platforms:linux_x86_64 |
| 3 | |
Chris McDonald | 187e80d | 2022-02-03 14:52:30 -0700 | [diff] [blame] | 4 | # Use the target platform in the bazel-out/ output directory name fragment |
| 5 | # instead of the CPU (darwin, k8). This avoids thrashing the output directory |
| 6 | # when switching between top level target --platforms values. |
| 7 | build --experimental_platform_in_output_dir |
| 8 | |
Chris McDonald | 730f3f9 | 2022-02-03 14:31:06 -0700 | [diff] [blame] | 9 | # Use the JDK provided by the CrOS SDK instead of trying to download a bundled |
| 10 | # remote JDK. |
| 11 | build --tool_java_runtime_version=11 |
| 12 | |
Chris McDonald | 9581238 | 2022-01-11 12:36:32 -0700 | [diff] [blame] | 13 | # Use toolchain resolution to find the cc toolchain. |
| 14 | build --incompatible_enable_cc_toolchain_resolution |
| 15 | |
| 16 | # Enable usage of experimental cc-related build APIs |
| 17 | build --experimental_starlark_cc_import |
| 18 | build --experimental_repo_remote_exec |
| 19 | |
Chris McDonald | 9581238 | 2022-01-11 12:36:32 -0700 | [diff] [blame] | 20 | # Disable local cpp toolchain detection, as we declare it explicitly. |
| 21 | build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 |
| 22 | |
| 23 | # Declare a cc_toolchain_suite to work around |
| 24 | # https://github.com/bazelbuild/bazel/issues/12712 |
Chris McDonald | 290d1b8 | 2022-01-21 15:22:54 -0700 | [diff] [blame] | 25 | build --crosstool_top="@rules_cros//cros/toolchain/cc:cros-cc-toolchain-suite" |
Chris McDonald | 9581238 | 2022-01-11 12:36:32 -0700 | [diff] [blame] | 26 | |
| 27 | # Lock down the PATH variable in actions to /usr/bin and /usr/local/bin. |
| 28 | build --experimental_strict_action_env |
| 29 | |
| 30 | # Do not tokenize copts, other than strings that consist of a single Make |
| 31 | # variable. This prevents the need to double-escape characters like backslashes |
| 32 | # and quotes in copts. |
| 33 | build --features no_copts_tokenization |
| 34 | |
| 35 | # Support a local user-specific bazelrc file. |
| 36 | try-import %workspace%/user.bazelrc |