mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
9e3d5f29e2
## Why PR #25905 intentionally adds a failing `codex-core` unit test, but its [Bazel test on Windows check](https://github.com/openai/codex/actions/runs/26837526950/job/79135369259) passed. That shows the Bazel configuration introduced by #25156 is not behaving as expected, so revert it while the configuration can be investigated separately. ## What changed Revert #25156 in full, restoring the previous Bazel remote configuration, CI scripts, workflows, `rusty_v8` handling, and documentation. This removes the shared BuildBuddy wrapper and its tests. ## Validation Not run locally; this exact revert was prioritized for a fast rollback.
85 lines
1.8 KiB
Bash
Executable File
85 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Run Bazel queries with the same CI startup settings as the main build/test
|
|
# invocation so target-discovery queries can reuse the same Bazel server.
|
|
|
|
query_args=()
|
|
windows_cross_compile=0
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--windows-cross-compile)
|
|
windows_cross_compile=1
|
|
shift
|
|
;;
|
|
--)
|
|
shift
|
|
break
|
|
;;
|
|
*)
|
|
query_args+=("$1")
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ $# -ne 1 ]]; then
|
|
echo "Usage: $0 [--windows-cross-compile] [<bazel query args>...] -- <query expression>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
query_expression="$1"
|
|
|
|
ci_config=ci-linux
|
|
case "${RUNNER_OS:-}" in
|
|
macOS)
|
|
ci_config=ci-macos
|
|
;;
|
|
Windows)
|
|
if [[ $windows_cross_compile -eq 1 ]]; then
|
|
ci_config=ci-windows-cross
|
|
else
|
|
ci_config=ci-windows
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
bazel_startup_args=()
|
|
if [[ -n "${BAZEL_OUTPUT_USER_ROOT:-}" ]]; then
|
|
bazel_startup_args+=("--output_user_root=${BAZEL_OUTPUT_USER_ROOT}")
|
|
fi
|
|
|
|
run_bazel() {
|
|
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
|
|
MSYS2_ARG_CONV_EXCL='*' bazel "$@"
|
|
return
|
|
fi
|
|
|
|
bazel "$@"
|
|
}
|
|
|
|
bazel_query_args=(--noexperimental_remote_repo_contents_cache query)
|
|
if [[ -n "${BUILDBUDDY_API_KEY:-}" ]]; then
|
|
bazel_query_args+=(
|
|
"--config=${ci_config}"
|
|
"--remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}"
|
|
)
|
|
fi
|
|
|
|
if [[ -n "${BAZEL_REPO_CONTENTS_CACHE:-}" ]]; then
|
|
bazel_query_args+=("--repo_contents_cache=${BAZEL_REPO_CONTENTS_CACHE}")
|
|
fi
|
|
|
|
if [[ -n "${BAZEL_REPOSITORY_CACHE:-}" ]]; then
|
|
bazel_query_args+=("--repository_cache=${BAZEL_REPOSITORY_CACHE}")
|
|
fi
|
|
|
|
bazel_query_args+=("${query_args[@]}" "$query_expression")
|
|
|
|
if (( ${#bazel_startup_args[@]} > 0 )); then
|
|
run_bazel "${bazel_startup_args[@]}" "${bazel_query_args[@]}"
|
|
else
|
|
run_bazel "${bazel_query_args[@]}"
|
|
fi
|