|
| 1 | +common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 |
| 2 | +common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 |
| 3 | +# Dummy xcode config so we don't need to build xcode_locator in repo rule. |
| 4 | +common --xcode_version_config=//:disable_xcode |
| 5 | + |
| 6 | +common --disk_cache=~/.cache/bazel-disk-cache |
| 7 | +common --repo_contents_cache=~/.cache/bazel-repo-contents-cache |
| 8 | +common --repository_cache=~/.cache/bazel-repo-cache |
| 9 | +common --remote_cache_compression |
| 10 | +startup --experimental_remote_repo_contents_cache |
| 11 | + |
| 12 | +common --experimental_platform_in_output_dir |
| 13 | + |
| 14 | +# Runfiles strategy rationale: codex-rs/utils/cargo-bin/README.md |
| 15 | +common --noenable_runfiles |
| 16 | + |
| 17 | +common --enable_platform_specific_config |
| 18 | +common:linux --host_platform=//:local_linux |
| 19 | +common:windows --host_platform=//:local_windows |
| 20 | +common --@rules_cc//cc/toolchains/args/archiver_flags:use_libtool_on_macos=False |
| 21 | +common --@llvm//config:experimental_stub_libgcc_s |
| 22 | + |
| 23 | +# TODO(zbarsky): rules_rust doesn't implement this flag properly with remote exec... |
| 24 | +# common --@rules_rust//rust/settings:pipelined_compilation |
| 25 | + |
| 26 | +common --incompatible_strict_action_env |
| 27 | +# Not ideal, but We need to allow dotslash to be found |
| 28 | +common:linux --test_env=PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin |
| 29 | +common:macos --test_env=PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin |
| 30 | + |
| 31 | +# Pass through some env vars Windows needs to use powershell? |
| 32 | +common:windows --test_env=SYSTEMROOT |
| 33 | +common:windows --test_env=COMSPEC |
| 34 | +common:windows --test_env=WINDIR |
| 35 | +# Rust's libtest harness runs test bodies on std-spawned threads. The default |
| 36 | +# 2 MiB stack can be too small for large async test futures on Windows CI; see |
| 37 | +# https://github.com/openai/codex/pull/19067 for the motivating failure. |
| 38 | +common --test_env=RUST_MIN_STACK=8388608 # 8 MiB |
| 39 | + |
| 40 | +common --test_output=errors |
| 41 | +common --bes_results_url=https://app.buildbuddy.io/invocation/ |
| 42 | +common --bes_backend=grpcs://remote.buildbuddy.io |
| 43 | +common --remote_cache=grpcs://remote.buildbuddy.io |
| 44 | +common --remote_download_toplevel |
| 45 | +common --nobuild_runfile_links |
| 46 | +common --remote_timeout=3600 |
| 47 | +common --noexperimental_throttle_remote_action_building |
| 48 | +common --experimental_remote_execution_keepalive |
| 49 | +common --grpc_keepalive_time=30s |
| 50 | +common --experimental_remote_downloader=grpcs://remote.buildbuddy.io |
| 51 | + |
| 52 | +# This limits both in-flight executions and concurrent downloads. Even with high number |
| 53 | +# of jobs execution will still be limited by CPU cores, so this just pays a bit of |
| 54 | +# memory in exchange for higher download concurrency. |
| 55 | +common --jobs=30 |
| 56 | + |
| 57 | +common:remote --extra_execution_platforms=//:rbe |
| 58 | +common:remote --remote_executor=grpcs://remote.buildbuddy.io |
| 59 | +common:remote --jobs=800 |
| 60 | +# TODO(team): Evaluate if this actually helps, zbarsky is not sure, everything seems bottlenecked on `core` either way. |
| 61 | +# Enable pipelined compilation since we are not bound by local CPU count. |
| 62 | +#common:remote --@rules_rust//rust/settings:pipelined_compilation |
| 63 | + |
| 64 | +# GitHub Actions CI configs. |
| 65 | +common:ci --remote_download_minimal |
| 66 | +common:ci --keep_going |
| 67 | +common:ci --verbose_failures |
| 68 | +common:ci --build_metadata=REPO_URL=https://github.com/openai/codex.git |
| 69 | +common:ci --build_metadata=ROLE=CI |
| 70 | +common:ci --build_metadata=VISIBILITY=PUBLIC |
| 71 | +# rules_rust derives debug level from Bazel toolchain/compilation-mode settings, |
| 72 | +# not Cargo profiles. Keep CI Rust actions explicit and lean. |
| 73 | +common:ci --@rules_rust//rust/settings:extra_rustc_flag=-Cdebuginfo=0 |
| 74 | +common:ci --@rules_rust//rust/settings:extra_exec_rustc_flag=-Cdebuginfo=0 |
| 75 | + |
| 76 | +# Disable disk cache in CI since we have a remote one and aren't using persistent workers. |
| 77 | +common:ci --disk_cache= |
| 78 | + |
| 79 | +# Shared config for the main Bazel CI workflow. |
| 80 | +common:ci-bazel --config=ci |
| 81 | +common:ci-bazel --build_metadata=TAG_workflow=bazel |
| 82 | +# Bazel CI cross-compiles in several legs, and the V8-backed code-mode tests |
| 83 | +# are not stable in that setup yet. Keep running the rest of the Rust |
| 84 | +# integration suites through the workspace-root launcher. |
| 85 | +common:ci-bazel --test_env=CODEX_BAZEL_TEST_SKIP_FILTERS=suite::code_mode:: |
| 86 | + |
| 87 | +# Shared config for Bazel-backed Rust linting. |
| 88 | +build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect |
| 89 | +build:clippy --output_groups=+clippy_checks |
| 90 | +build:clippy --@rules_rust//rust/settings:clippy.toml=//codex-rs:clippy.toml |
| 91 | +# Keep this deny-list in sync with `codex-rs/Cargo.toml` `[workspace.lints.clippy]`. |
| 92 | +# Cargo applies those lint levels to member crates that opt into `[lints] workspace = true` |
| 93 | +# in their own `Cargo.toml`, but `rules_rust` Bazel clippy does not read Cargo lint levels. |
| 94 | +# `clippy.toml` can configure lint behavior, but it cannot set allow/warn/deny/forbid levels. |
| 95 | +build:clippy --@rules_rust//rust/settings:clippy_flag=-Dwarnings |
| 96 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::await_holding_invalid_type |
| 97 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::await_holding_lock |
| 98 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::expect_used |
| 99 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::identity_op |
| 100 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_clamp |
| 101 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_filter |
| 102 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_find |
| 103 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_flatten |
| 104 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_map |
| 105 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_memcpy |
| 106 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_non_exhaustive |
| 107 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_ok_or |
| 108 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_range_contains |
| 109 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_retain |
| 110 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_strip |
| 111 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_try_fold |
| 112 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_unwrap_or |
| 113 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::needless_borrow |
| 114 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::needless_borrowed_reference |
| 115 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::needless_collect |
| 116 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::needless_late_init |
| 117 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::needless_option_as_deref |
| 118 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::needless_question_mark |
| 119 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::needless_update |
| 120 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::redundant_clone |
| 121 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::redundant_closure |
| 122 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::redundant_closure_for_method_calls |
| 123 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::redundant_static_lifetimes |
| 124 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::trivially_copy_pass_by_ref |
| 125 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::uninlined_format_args |
| 126 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::unnecessary_filter_map |
| 127 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::unnecessary_lazy_evaluations |
| 128 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::unnecessary_sort_by |
| 129 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::unnecessary_to_owned |
| 130 | +build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::unwrap_used |
| 131 | + |
| 132 | +# Shared config for Bazel-backed argument-comment-lint. |
| 133 | +build:argument-comment-lint --aspects=//tools/argument-comment-lint:lint_aspect.bzl%rust_argument_comment_lint_aspect |
| 134 | +build:argument-comment-lint --output_groups=argument_comment_lint_checks |
| 135 | +build:argument-comment-lint --@rules_rust//rust/toolchain/channel=nightly |
| 136 | + |
| 137 | +# Rearrange caches on Windows so they're on the same volume as the checkout. |
| 138 | +common:ci-windows --config=ci-bazel |
| 139 | +common:ci-windows --build_metadata=TAG_os=windows |
| 140 | +common:ci-windows --repo_contents_cache=D:/a/.cache/bazel-repo-contents-cache |
| 141 | + |
| 142 | +# We prefer to run the build actions entirely remotely so we can dial up the concurrency. |
| 143 | +# We have platform-specific tests, so we want to execute the tests on all platforms using the strongest sandboxing available on each platform. |
| 144 | + |
| 145 | +# On linux, we can do a full remote build/test, by targeting the right (x86/arm) runners, so we have coverage of both. |
| 146 | +# Linux crossbuilds don't work until we untangle the libc constraint mess. |
| 147 | +common:ci-linux --config=ci-bazel |
| 148 | +common:ci-linux --build_metadata=TAG_os=linux |
| 149 | +common:ci-linux --config=remote |
| 150 | +common:ci-linux --strategy=remote |
| 151 | +common:ci-linux --platforms=//:rbe |
| 152 | + |
| 153 | +# On mac, we can run all the build actions remotely but test actions locally. |
| 154 | +common:ci-macos --config=ci-bazel |
| 155 | +common:ci-macos --build_metadata=TAG_os=macos |
| 156 | +common:ci-macos --config=remote |
| 157 | +common:ci-macos --strategy=remote |
| 158 | +common:ci-macos --strategy=TestRunner=darwin-sandbox,local |
| 159 | + |
| 160 | +# On Windows, use Linux remote execution for build actions but keep test actions |
| 161 | +# on the Windows runner so Bazel's normal test sharding and flaky-test retries |
| 162 | +# still run against Windows binaries. |
| 163 | +common:ci-windows-cross --config=ci-windows |
| 164 | +common:ci-windows-cross --build_metadata=TAG_windows_cross_compile=true |
| 165 | +common:ci-windows-cross --config=remote |
| 166 | +common:ci-windows-cross --host_platform=//:rbe |
| 167 | +common:ci-windows-cross --strategy=remote |
| 168 | +common:ci-windows-cross --strategy=TestRunner=local |
| 169 | +common:ci-windows-cross --local_test_jobs=4 |
| 170 | +common:ci-windows-cross --test_env=RUST_TEST_THREADS=1 |
| 171 | +# Native Windows CI still covers the PowerShell tests. The cross-built gnullvm |
| 172 | +# binaries currently hang in PowerShell AST parser tests when those binaries are |
| 173 | +# run on the Windows runner. |
| 174 | +common:ci-windows-cross --test_env=CODEX_BAZEL_TEST_SKIP_FILTERS=suite::code_mode::,powershell |
| 175 | +common:ci-windows-cross --platforms=//:windows_x86_64_gnullvm |
| 176 | +common:ci-windows-cross --extra_execution_platforms=//:rbe,//:windows_x86_64_msvc |
| 177 | +common:ci-windows-cross --extra_toolchains=//:windows_gnullvm_tests_on_msvc_host_toolchain |
| 178 | + |
| 179 | +# Linux-only V8 CI config. |
| 180 | +common:ci-v8 --config=ci |
| 181 | +common:ci-v8 --build_metadata=TAG_workflow=v8 |
| 182 | +common:ci-v8 --build_metadata=TAG_os=linux |
| 183 | +common:ci-v8 --config=remote |
| 184 | +common:ci-v8 --strategy=remote |
| 185 | + |
| 186 | +# Source-built Bazel V8 artifacts use the in-process sandbox by default. This |
| 187 | +# does not affect Cargo's default prebuilt rusty_v8 path. |
| 188 | +common --@v8//:v8_enable_pointer_compression=True |
| 189 | +common --@v8//:v8_enable_sandbox=True |
| 190 | + |
| 191 | +# Keep currently published rusty_v8 release artifacts non-sandboxed until the |
| 192 | +# artifact migration ships matching Rust feature selection for Cargo consumers. |
| 193 | +common:v8-release-compat --@v8//:v8_enable_pointer_compression=False |
| 194 | +common:v8-release-compat --@v8//:v8_enable_sandbox=False |
| 195 | + |
| 196 | +# Optional per-user local overrides. |
| 197 | +try-import %workspace%/user.bazelrc |
0 commit comments