mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
## What changed - Remove automatic BuildBuddy configuration and credential forwarding from Bazel CI, release, SDK, and voice builds. Strip remote execution CI configs in the shared wrapper while retaining explicit remote configurations for local use. - Use native Windows host tools and audio dependencies for Windows Bazel actions, forwarding the required toolchain and environment settings. - Initialize message-board MCP servers through a per-session `OnceCell` so server startup does not hold the shared registry lock across an await. - Expose the message-board test helper to the core Bazel package and update the runtime-auth test call for the `reauth` argument. GitOrigin-RevId: 5d5c1f4d71fa841090dea8eec8006380981fb65b
484 lines
16 KiB
YAML
484 lines
16 KiB
YAML
name: rusty-v8-release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "rusty-v8-v*.*.*"
|
|
|
|
# Cargo's libgit2 transport has been flaky when fetching git dependencies with
|
|
# nested submodules. Prefer the system git CLI for Cargo smoke tests.
|
|
env:
|
|
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}::${{ github.ref_name }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
metadata:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
release_tag: ${{ steps.release_tag.outputs.release_tag }}
|
|
v8_version: ${{ steps.v8_version.outputs.version }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Resolve exact v8 crate version
|
|
id: v8_version
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
version="$(python3 .github/scripts/rusty_v8_bazel.py resolved-v8-crate-version)"
|
|
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Resolve release tag
|
|
id: release_tag
|
|
env:
|
|
GITHUB_REF_NAME: ${{ github.ref_name }}
|
|
V8_VERSION: ${{ steps.v8_version.outputs.version }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
expected_release_tag="rusty-v8-v${V8_VERSION}"
|
|
release_tag="${GITHUB_REF_NAME}"
|
|
if [[ "${release_tag}" != "${expected_release_tag}" ]]; then
|
|
echo "Tag ${release_tag} does not match expected release tag ${expected_release_tag}." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "release_tag=${release_tag}" >> "$GITHUB_OUTPUT"
|
|
|
|
build:
|
|
name: Build ${{ matrix.variant }} ${{ matrix.target }}
|
|
needs: metadata
|
|
runs-on: ${{ matrix.runner }}
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
environment:
|
|
name: bazel
|
|
deployment: false
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- runner: ubuntu-24.04
|
|
bazel_config: ci-v8
|
|
platform: linux_amd64
|
|
sandbox: false
|
|
target: x86_64-unknown-linux-gnu
|
|
variant: release
|
|
- runner: ubuntu-24.04
|
|
bazel_config: ci-v8
|
|
platform: linux_amd64
|
|
sandbox: true
|
|
target: x86_64-unknown-linux-gnu
|
|
variant: ptrcomp-sandbox
|
|
- runner: ubuntu-24.04-arm
|
|
bazel_config: ci-v8
|
|
platform: linux_arm64
|
|
sandbox: false
|
|
target: aarch64-unknown-linux-gnu
|
|
variant: release
|
|
- runner: ubuntu-24.04-arm
|
|
bazel_config: ci-v8
|
|
platform: linux_arm64
|
|
sandbox: true
|
|
target: aarch64-unknown-linux-gnu
|
|
variant: ptrcomp-sandbox
|
|
- runner: macos-15-intel
|
|
bazel_config: ci-macos
|
|
platform: macos_amd64
|
|
sandbox: false
|
|
target: x86_64-apple-darwin
|
|
variant: release
|
|
- runner: macos-15-intel
|
|
bazel_config: ci-macos
|
|
platform: macos_amd64
|
|
sandbox: true
|
|
target: x86_64-apple-darwin
|
|
variant: ptrcomp-sandbox
|
|
- runner: macos-15-xlarge
|
|
bazel_config: ci-macos
|
|
platform: macos_arm64
|
|
sandbox: false
|
|
target: aarch64-apple-darwin
|
|
variant: release
|
|
- runner: macos-15-xlarge
|
|
bazel_config: ci-macos
|
|
platform: macos_arm64
|
|
sandbox: true
|
|
target: aarch64-apple-darwin
|
|
variant: ptrcomp-sandbox
|
|
- runner: ubuntu-24.04
|
|
bazel_config: ci-v8
|
|
platform: linux_amd64_musl
|
|
sandbox: false
|
|
target: x86_64-unknown-linux-musl
|
|
variant: release
|
|
- runner: ubuntu-24.04-arm
|
|
bazel_config: ci-v8
|
|
platform: linux_arm64_musl
|
|
sandbox: false
|
|
target: aarch64-unknown-linux-musl
|
|
variant: release
|
|
- runner: ubuntu-24.04
|
|
bazel_config: ci-v8
|
|
platform: linux_amd64_musl
|
|
sandbox: true
|
|
target: x86_64-unknown-linux-musl
|
|
variant: ptrcomp-sandbox
|
|
- runner: ubuntu-24.04-arm
|
|
bazel_config: ci-v8
|
|
platform: linux_arm64_musl
|
|
sandbox: true
|
|
target: aarch64-unknown-linux-musl
|
|
variant: ptrcomp-sandbox
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Prepare Bazel CI
|
|
uses: ./.github/actions/prepare-bazel-ci
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
cache-scope: bazel-v8
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Set up Rust toolchain for Cargo smoke
|
|
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
|
|
with:
|
|
toolchain: "1.95.0"
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Build Bazel V8 release pair
|
|
env:
|
|
PLATFORM: ${{ matrix.platform }}
|
|
SANDBOX: ${{ matrix.sandbox }}
|
|
TARGET: ${{ matrix.target }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
target_suffix="${TARGET//-/_}"
|
|
pair_kind="release_pair"
|
|
if [[ "${SANDBOX}" == "true" ]]; then
|
|
pair_kind="sandbox_release_pair"
|
|
fi
|
|
pair_target="//third_party/v8:rusty_v8_${pair_kind}_${target_suffix}"
|
|
|
|
bazel_args=(
|
|
build
|
|
-c
|
|
opt
|
|
"--platforms=@llvm//platforms:${PLATFORM}"
|
|
"${pair_target}"
|
|
--build_metadata=COMMIT_SHA=$(git rev-parse HEAD)
|
|
)
|
|
|
|
./.github/scripts/run_bazel_with_buildbuddy.py \
|
|
--noexperimental_remote_repo_contents_cache \
|
|
"${bazel_args[@]}" \
|
|
"--config=${{ matrix.bazel_config }}"
|
|
|
|
- name: Stage release pair
|
|
env:
|
|
BAZEL_CONFIG: ${{ matrix.bazel_config }}
|
|
PLATFORM: ${{ matrix.platform }}
|
|
SANDBOX: ${{ matrix.sandbox }}
|
|
TARGET: ${{ matrix.target }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
stage_args=(
|
|
--platform "${PLATFORM}"
|
|
--target "${TARGET}"
|
|
--compilation-mode opt
|
|
--output-dir "dist/${TARGET}"
|
|
--bazel-config "${BAZEL_CONFIG}"
|
|
)
|
|
if [[ "${SANDBOX}" == "true" ]]; then
|
|
stage_args+=(--sandbox)
|
|
fi
|
|
|
|
python3 .github/scripts/rusty_v8_bazel.py stage-release-pair "${stage_args[@]}"
|
|
|
|
# Larger Linux runner images may omit the host linker used by Cargo build scripts.
|
|
- name: Install native Linux Cargo smoke dependencies
|
|
if: ${{ runner.os == 'Linux' }}
|
|
env:
|
|
TARGET: ${{ matrix.target }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
packages=(build-essential)
|
|
if [[ "${TARGET}" == *-musl ]]; then
|
|
packages+=(musl-tools)
|
|
fi
|
|
sudo apt-get update -y
|
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "${packages[@]}"
|
|
if [[ "${TARGET}" == *-musl ]]; then
|
|
# Use musl only for target links; Cargo build scripts still link on the glibc host.
|
|
linker_var="CARGO_TARGET_${TARGET^^}_LINKER"
|
|
echo "${linker_var//-/_}=$(command -v musl-gcc)" >> "${GITHUB_ENV}"
|
|
fi
|
|
|
|
- name: Smoke test staged artifact with Cargo
|
|
env:
|
|
SANDBOX: ${{ matrix.sandbox }}
|
|
TARGET: ${{ matrix.target }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
archive="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'librusty_v8_*.a.gz' -print -quit)"
|
|
binding="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'src_binding_*.rs' -print -quit)"
|
|
if [[ -z "${archive}" || -z "${binding}" ]]; then
|
|
echo "Missing staged archive or binding for ${TARGET}." >&2
|
|
exit 1
|
|
fi
|
|
|
|
cargo_args=(test -p codex-v8-poc --target "${TARGET}")
|
|
if [[ "${SANDBOX}" == "true" ]]; then
|
|
cargo_args+=(--features sandbox)
|
|
fi
|
|
cargo_args+=(-- --include-ignored)
|
|
|
|
(
|
|
cd codex-rs
|
|
CARGO_TARGET_DIR="${RUNNER_TEMP}/rusty-v8-cargo-smoke-${TARGET}-${SANDBOX}" \
|
|
RUSTY_V8_ARCHIVE="${GITHUB_WORKSPACE}/${archive}" \
|
|
RUSTY_V8_SRC_BINDING_PATH="${GITHUB_WORKSPACE}/${binding}" \
|
|
cargo "${cargo_args[@]}"
|
|
)
|
|
|
|
- name: Upload staged artifacts
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
with:
|
|
name: rusty-v8-${{ needs.metadata.outputs.v8_version }}-${{ matrix.variant }}-${{ matrix.target }}
|
|
path: dist/${{ matrix.target }}/*
|
|
|
|
build-windows-source:
|
|
name: Build ptrcomp-sandbox ${{ matrix.target }} from source
|
|
needs: metadata
|
|
runs-on: ${{ matrix.runner }}
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- runner: windows-2022
|
|
target: x86_64-pc-windows-msvc
|
|
- runner: windows-2022
|
|
target: aarch64-pc-windows-msvc
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Configure git for upstream checkout
|
|
shell: bash
|
|
run: git config --global core.symlinks true
|
|
|
|
- name: Check out upstream rusty_v8
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
repository: denoland/rusty_v8
|
|
ref: v${{ needs.metadata.outputs.v8_version }}
|
|
path: upstream-rusty-v8
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
|
|
- name: Download upstream Windows build tools
|
|
shell: bash
|
|
working-directory: upstream-rusty-v8
|
|
run: |
|
|
set -euo pipefail
|
|
# Upstream skips this submodule and downloads the pinned archive in CI.
|
|
mkdir -p tools/win
|
|
curl -fL https://chromium.googlesource.com/chromium/src/tools/win/+archive/faefd1b6fa9eeb033ad6fe60368ccb9bf908cbd0.tar.gz |
|
|
tar -xz -C tools/win
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
with:
|
|
python-version: "3.11"
|
|
architecture: x64
|
|
|
|
- name: Set up Codex Rust toolchain for Cargo smoke
|
|
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
|
|
with:
|
|
toolchain: "1.95.0"
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Install rusty_v8 Rust toolchain
|
|
env:
|
|
TARGET: ${{ matrix.target }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
rustup toolchain install 1.91.0 --profile minimal --no-self-update
|
|
rustup target add --toolchain 1.91.0 "${TARGET}"
|
|
|
|
- name: Write upstream submodule status
|
|
shell: bash
|
|
working-directory: upstream-rusty-v8
|
|
run: git submodule status --recursive > git_submodule_status.txt
|
|
|
|
- name: Restore upstream source-build cache
|
|
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
with:
|
|
path: |
|
|
upstream-rusty-v8/target/sccache
|
|
upstream-rusty-v8/target/${{ matrix.target }}/release/gn_out
|
|
key: rusty-v8-source-${{ matrix.target }}-sandbox-${{ hashFiles('upstream-rusty-v8/Cargo.lock', 'upstream-rusty-v8/build.rs', 'upstream-rusty-v8/git_submodule_status.txt', 'patches/v8_array_sort_elements_kind.patch') }}
|
|
restore-keys: |
|
|
rusty-v8-source-${{ matrix.target }}-sandbox-
|
|
|
|
- name: Apply V8 Array.sort backport
|
|
shell: bash
|
|
working-directory: upstream-rusty-v8/v8
|
|
run: git apply -p3 "${GITHUB_WORKSPACE}/patches/v8_array_sort_elements_kind.patch"
|
|
|
|
- name: Install sccache
|
|
uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2.62.49
|
|
with:
|
|
tool: sccache@0.8.2
|
|
|
|
- name: Start sccache
|
|
shell: pwsh
|
|
env:
|
|
SCCACHE_CACHE_SIZE: 256M
|
|
SCCACHE_DIR: ${{ github.workspace }}/upstream-rusty-v8/target/sccache
|
|
SCCACHE_IDLE_TIMEOUT: 0
|
|
run: sccache --start-server
|
|
|
|
- name: Install Chromium clang for ARM64 MSVC cross build
|
|
if: matrix.target == 'aarch64-pc-windows-msvc'
|
|
shell: bash
|
|
working-directory: upstream-rusty-v8
|
|
run: python3 tools/clang/scripts/update.py
|
|
|
|
- name: Build upstream rusty_v8 sandbox release pair
|
|
env:
|
|
SCCACHE_IDLE_TIMEOUT: 0
|
|
TARGET: ${{ matrix.target }}
|
|
V8_FROM_SOURCE: "1"
|
|
shell: bash
|
|
working-directory: upstream-rusty-v8
|
|
run: cargo +1.91.0 build --locked --release --target "${TARGET}" --features v8_enable_sandbox
|
|
|
|
- name: Stage upstream sandbox release pair
|
|
env:
|
|
TARGET: ${{ matrix.target }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
python3 .github/scripts/rusty_v8_bazel.py stage-upstream-release-pair \
|
|
--target-dir upstream-rusty-v8/target \
|
|
--target "${TARGET}" \
|
|
--output-dir "dist/${TARGET}" \
|
|
--sandbox
|
|
|
|
- name: Smoke link staged artifact with Cargo
|
|
env:
|
|
TARGET: ${{ matrix.target }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
archive="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'rusty_v8_*.lib.gz' -print -quit)"
|
|
binding="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'src_binding_*.rs' -print -quit)"
|
|
if [[ -z "${archive}" || -z "${binding}" ]]; then
|
|
echo "Missing staged archive or binding for ${TARGET}." >&2
|
|
exit 1
|
|
fi
|
|
|
|
(
|
|
cd codex-rs
|
|
RUSTY_V8_ARCHIVE="${GITHUB_WORKSPACE}/${archive}" \
|
|
RUSTY_V8_SRC_BINDING_PATH="${GITHUB_WORKSPACE}/${binding}" \
|
|
cargo +1.95.0 test -p codex-v8-poc --target "${TARGET}" --features sandbox --no-run
|
|
)
|
|
|
|
- name: Upload staged artifacts
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
with:
|
|
name: rusty-v8-${{ needs.metadata.outputs.v8_version }}-ptrcomp-sandbox-${{ matrix.target }}
|
|
path: dist/${{ matrix.target }}/*
|
|
|
|
publish-release:
|
|
needs:
|
|
- metadata
|
|
- build
|
|
- build-windows-source
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
actions: read
|
|
|
|
steps:
|
|
- name: Check whether release already exists
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
RELEASE_TAG: ${{ needs.metadata.outputs.release_tag }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
if is_draft="$(gh release view "${RELEASE_TAG}" --repo "${GITHUB_REPOSITORY}" --json isDraft --jq '.isDraft' 2>/dev/null)"; then
|
|
if [[ "${is_draft}" != "true" ]]; then
|
|
echo "Refusing to replace existing published release ${RELEASE_TAG}." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Removing unfinished draft release for ${RELEASE_TAG}."
|
|
gh release delete "${RELEASE_TAG}" --repo "${GITHUB_REPOSITORY}" --yes
|
|
fi
|
|
|
|
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
path: dist
|
|
|
|
- name: Create GitHub Release
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
RELEASE_TAG: ${{ needs.metadata.outputs.release_tag }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
assets=()
|
|
while IFS= read -r -d '' asset; do
|
|
assets+=("${asset}")
|
|
done < <(find dist -type f -print0)
|
|
if [[ "${#assets[@]}" -eq 0 ]]; then
|
|
echo "No V8 release artifacts were found." >&2
|
|
exit 1
|
|
fi
|
|
|
|
# GitHub CLI keeps asset-bearing releases in draft until all uploads finish.
|
|
gh release create "${RELEASE_TAG}" \
|
|
--repo "${GITHUB_REPOSITORY}" \
|
|
--title "${RELEASE_TAG}" \
|
|
--verify-tag \
|
|
--prerelease \
|
|
"${assets[@]}"
|