Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Enable BuildBuddy for voice release builds (#54737)

Adam Perry @ OpenAI835d3049f03e
diff --git a/.github/workflows/rust-release-windows.yml b/.github/workflows/rust-release-windows.yml
index 0f28688eee..8e167aa805 100644
--- a/.github/workflows/rust-release-windows.yml
+++ b/.github/workflows/rust-release-windows.yml
@@ -179,6 +179,9 @@ jobs:
build-windows-voice:
name: Build Windows voice - ${{ matrix.target }}
runs-on: ${{ matrix.runs_on }}
+ environment:
+ name: bazel
+ deployment: false
timeout-minutes: 120
permissions:
contents: read
@@ -250,7 +253,7 @@ jobs:
env:
ARCH: ${{ matrix.arch }}
VOICE_ARCH: ${{ matrix.arch }}
- BUILDBUDDY_API_KEY: ""
+ BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
(cd codex-rs && cargo update --workspace)
python .github/scripts/watch_voice_bazel.py "$(cygpath -w "$BASH")" ./.github/scripts/run-bazel-ci.sh \
diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml
index 3fc99ac71b..abde060ea3 100644
--- a/.github/workflows/rust-release.yml
+++ b/.github/workflows/rust-release.yml
@@ -268,8 +268,8 @@ jobs:
export STABLE_GIT_COMMIT
cargo build --target "$target" --release --timings "${build_args[@]}"
- - name: Prepare Bazel release build
- if: ${{ matrix.build-system == 'bazel' }}
+ - name: Prepare Bazel for release binaries or Linux voice
+ if: matrix.build-system == 'bazel' || (matrix.bundle == 'primary' && contains(matrix.target, 'linux'))
uses: ./.github/actions/prepare-bazel-ci
with:
target: ${{ matrix.target }}
@@ -322,17 +322,12 @@ jobs:
path: codex-rs/symbols-dist/${{ matrix.artifact_name }}/*
if-no-files-found: error
- - name: Set up Bazel for Linux voice
- if: ${{ matrix.bundle == 'primary' && contains(matrix.target, 'linux') }}
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
- with:
- bazelisk-version: 1.28.1
-
- name: Build Linux voice runtime
if: ${{ matrix.bundle == 'primary' && contains(matrix.target, 'linux') }}
shell: bash
env:
APP_TARGET: ${{ matrix.target }}
+ BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
set -euo pipefail
cd "$GITHUB_WORKSPACE"
@@ -342,7 +337,8 @@ jobs:
x86_64-unknown-linux-gnu) prefix=linux_x86_64 ;;
*) exit 1 ;;
esac
- bazel build --config=release //codex-rs/voice-host:codex-voice-host //third_party/voice:native_runtime
+ python3 .github/scripts/run_bazel_with_buildbuddy.py build --config=release \
+ //codex-rs/voice-host:codex-voice-host //third_party/voice:native_runtime
source="bazel-bin/third_party/voice/native_runtime_${prefix}"
output="${RUNNER_TEMP}/signed-voice/${APP_TARGET}"
mkdir -p "$output"
@@ -575,6 +571,9 @@ jobs:
needs: tag-check
name: Build voice runtime - ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
+ environment:
+ name: bazel
+ deployment: false
timeout-minutes: 120
permissions:
contents: read
@@ -595,20 +594,24 @@ jobs:
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
+ - name: Prepare Bazel CI
+ uses: ./.github/actions/prepare-bazel-ci
with:
- bazelisk-version: 1.28.1
+ target: ${{ matrix.target }}
+ cache-scope: bazel-release-primary
- name: Build matching helper and native runtime
shell: bash
env:
TARGET: ${{ matrix.target }}
PREFIX: ${{ matrix.prefix }}
+ BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
set -euo pipefail
# Release tags bump Cargo.toml without rewriting the workspace lockfile.
# Refresh workspace versions before Bazel reads the Cargo dependency graph.
(cd codex-rs && cargo update --workspace)
- bazel build --config=release --macos_minimum_os=14.0 //codex-rs/voice-host:codex-voice-host //third_party/voice:native_runtime
+ python3 .github/scripts/run_bazel_with_buildbuddy.py build --config=release \
+ --macos_minimum_os=14.0 //codex-rs/voice-host:codex-voice-host //third_party/voice:native_runtime
runtime="bazel-bin/third_party/voice/native_runtime_${PREFIX}"
PYTHONPATH=third_party/voice python3 - "$runtime" "$TARGET" <<'PY'
from pathlib import Path