From 13598da797fc03c57155a336b0065c17ecf1c819 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Mon, 22 Dec 2025 18:16:59 +0100 Subject: [PATCH 1/9] New cache --- .github/workflows/rust-ci.yml | 72 +++++++++++------------------------ 1 file changed, 22 insertions(+), 50 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 1af0bf2f4ae..0ba04cb1881 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -62,6 +62,12 @@ jobs: - uses: dtolnay/rust-toolchain@1.90 with: components: rustfmt + - uses: Swatinem/rust-cache@v2 + with: + # This workflow runs from the repo root, but the Rust workspace lives in codex-rs. + workspaces: | + codex-rs + cache-targets: false - name: cargo fmt run: cargo fmt -- --config imports_granularity=Item --check - name: Verify codegen for mcp-types @@ -78,6 +84,11 @@ jobs: steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@1.90 + - uses: Swatinem/rust-cache@v2 + with: + workspaces: | + codex-rs + cache-targets: false - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: cargo-shear @@ -164,20 +175,13 @@ jobs: echo "hash=$(sha256sum Cargo.lock | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" echo "toolchain_hash=$(sha256sum rust-toolchain.toml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - # Explicit cache restore: split cargo home vs target, so we can - # avoid caching the large target dir on the gnu-dev job. - - name: Restore cargo home cache - id: cache_cargo_home_restore - uses: actions/cache/restore@v5 + - uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ steps.lockhash.outputs.toolchain_hash }} - restore-keys: | - cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}- + # Keep caching focused on Cargo registry/git; sccache handles compiled artifacts. + workspaces: | + codex-rs + shared-key: rust-ci-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} + cache-targets: false # Install and restore sccache cache - name: Install sccache @@ -277,20 +281,6 @@ jobs: find . -name Cargo.toml -mindepth 2 -maxdepth 2 -print0 \ | xargs -0 -n1 -I{} bash -c 'cd "$(dirname "{}")" && cargo check --profile ${{ matrix.profile }}' - # Save caches explicitly; make non-fatal so cache packaging - # never fails the overall job. Only save when key wasn't hit. - - name: Save cargo home cache - if: always() && !cancelled() && steps.cache_cargo_home_restore.outputs.cache-hit != 'true' - continue-on-error: true - uses: actions/cache/save@v5 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ steps.lockhash.outputs.toolchain_hash }} - - name: Save sccache cache (fallback) if: always() && !cancelled() && env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' continue-on-error: true @@ -405,18 +395,12 @@ jobs: echo "hash=$(sha256sum Cargo.lock | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" echo "toolchain_hash=$(sha256sum rust-toolchain.toml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - - name: Restore cargo home cache - id: cache_cargo_home_restore - uses: actions/cache/restore@v5 + - uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ steps.lockhash.outputs.toolchain_hash }} - restore-keys: | - cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}- + workspaces: | + codex-rs + shared-key: rust-ci-tests-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} + cache-targets: false - name: Install sccache if: ${{ env.USE_SCCACHE == 'true' }} @@ -467,18 +451,6 @@ jobs: RUST_BACKTRACE: 1 NEXTEST_STATUS_LEVEL: leak - - name: Save cargo home cache - if: always() && !cancelled() && steps.cache_cargo_home_restore.outputs.cache-hit != 'true' - continue-on-error: true - uses: actions/cache/save@v5 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ steps.lockhash.outputs.toolchain_hash }} - - name: Save sccache cache (fallback) if: always() && !cancelled() && env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' continue-on-error: true From 31ff46ab9bad08c62634ad503b8d3f981948b8b1 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 11:59:36 +0100 Subject: [PATCH 2/9] Better cache --- .github/workflows/rust-ci.yml | 168 ++-------------------------------- 1 file changed, 9 insertions(+), 159 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 0ba04cb1881..123e3b75d31 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -67,7 +67,8 @@ jobs: # This workflow runs from the repo root, but the Rust workspace lives in codex-rs. workspaces: | codex-rs - cache-targets: false + cache-targets: true + cache-on-failure: true - name: cargo fmt run: cargo fmt -- --config imports_granularity=Item --check - name: Verify codegen for mcp-types @@ -88,7 +89,8 @@ jobs: with: workspaces: | codex-rs - cache-targets: false + cache-targets: true + cache-on-failure: true - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: cargo-shear @@ -108,10 +110,7 @@ jobs: run: working-directory: codex-rs env: - # Speed up repeated builds across CI runs by caching compiled objects (non-Windows). - USE_SCCACHE: ${{ startsWith(matrix.runner, 'windows') && 'false' || 'true' }} CARGO_INCREMENTAL: "0" - SCCACHE_CACHE_SIZE: 10G strategy: fail-fast: false @@ -166,60 +165,14 @@ jobs: targets: ${{ matrix.target }} components: clippy - - name: Compute lockfile hash - id: lockhash - working-directory: codex-rs - shell: bash - run: | - set -euo pipefail - echo "hash=$(sha256sum Cargo.lock | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - echo "toolchain_hash=$(sha256sum rust-toolchain.toml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - - uses: Swatinem/rust-cache@v2 with: - # Keep caching focused on Cargo registry/git; sccache handles compiled artifacts. + # Cache registry/git and build artifacts for this workspace/target/profile triple. workspaces: | codex-rs shared-key: rust-ci-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} - cache-targets: false - - # Install and restore sccache cache - - name: Install sccache - if: ${{ env.USE_SCCACHE == 'true' }} - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 - with: - tool: sccache - version: 0.7.5 - - - name: Configure sccache backend - if: ${{ env.USE_SCCACHE == 'true' }} - shell: bash - run: | - set -euo pipefail - if [[ -n "${ACTIONS_CACHE_URL:-}" && -n "${ACTIONS_RUNTIME_TOKEN:-}" ]]; then - echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" - echo "Using sccache GitHub backend" - else - echo "SCCACHE_GHA_ENABLED=false" >> "$GITHUB_ENV" - echo "SCCACHE_DIR=${{ github.workspace }}/.sccache" >> "$GITHUB_ENV" - echo "Using sccache local disk + actions/cache fallback" - fi - - - name: Enable sccache wrapper - if: ${{ env.USE_SCCACHE == 'true' }} - shell: bash - run: echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" - - - name: Restore sccache cache (fallback) - if: ${{ env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' }} - id: cache_sccache_restore - uses: actions/cache/restore@v5 - with: - path: ${{ github.workspace }}/.sccache/ - key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ github.run_id }} - restore-keys: | - sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}- - sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}- + cache-targets: true + cache-on-failure: true - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}} name: Prepare APT cache directories (musl) @@ -281,31 +234,6 @@ jobs: find . -name Cargo.toml -mindepth 2 -maxdepth 2 -print0 \ | xargs -0 -n1 -I{} bash -c 'cd "$(dirname "{}")" && cargo check --profile ${{ matrix.profile }}' - - name: Save sccache cache (fallback) - if: always() && !cancelled() && env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' - continue-on-error: true - uses: actions/cache/save@v5 - with: - path: ${{ github.workspace }}/.sccache/ - key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ github.run_id }} - - - name: sccache stats - if: always() && env.USE_SCCACHE == 'true' - continue-on-error: true - run: sccache --show-stats || true - - - name: sccache summary - if: always() && env.USE_SCCACHE == 'true' - shell: bash - run: | - { - echo "### sccache stats — ${{ matrix.target }} (${{ matrix.profile }})"; - echo; - echo '```'; - sccache --show-stats || true; - echo '```'; - } >> "$GITHUB_STEP_SUMMARY" - - name: Save APT cache (musl) if: always() && !cancelled() && (matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl') && steps.cache_apt_restore.outputs.cache-hit != 'true' continue-on-error: true @@ -334,10 +262,7 @@ jobs: run: working-directory: codex-rs env: - # Speed up repeated builds across CI runs by caching compiled objects (non-Windows). - USE_SCCACHE: ${{ startsWith(matrix.runner, 'windows') && 'false' || 'true' }} CARGO_INCREMENTAL: "0" - SCCACHE_CACHE_SIZE: 10G strategy: fail-fast: false @@ -386,58 +311,13 @@ jobs: with: targets: ${{ matrix.target }} - - name: Compute lockfile hash - id: lockhash - working-directory: codex-rs - shell: bash - run: | - set -euo pipefail - echo "hash=$(sha256sum Cargo.lock | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - echo "toolchain_hash=$(sha256sum rust-toolchain.toml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" - - uses: Swatinem/rust-cache@v2 with: workspaces: | codex-rs shared-key: rust-ci-tests-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} - cache-targets: false - - - name: Install sccache - if: ${{ env.USE_SCCACHE == 'true' }} - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 - with: - tool: sccache - version: 0.7.5 - - - name: Configure sccache backend - if: ${{ env.USE_SCCACHE == 'true' }} - shell: bash - run: | - set -euo pipefail - if [[ -n "${ACTIONS_CACHE_URL:-}" && -n "${ACTIONS_RUNTIME_TOKEN:-}" ]]; then - echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" - echo "Using sccache GitHub backend" - else - echo "SCCACHE_GHA_ENABLED=false" >> "$GITHUB_ENV" - echo "SCCACHE_DIR=${{ github.workspace }}/.sccache" >> "$GITHUB_ENV" - echo "Using sccache local disk + actions/cache fallback" - fi - - - name: Enable sccache wrapper - if: ${{ env.USE_SCCACHE == 'true' }} - shell: bash - run: echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" - - - name: Restore sccache cache (fallback) - if: ${{ env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' }} - id: cache_sccache_restore - uses: actions/cache/restore@v5 - with: - path: ${{ github.workspace }}/.sccache/ - key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ github.run_id }} - restore-keys: | - sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}- - sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}- + cache-targets: true + cache-on-failure: true - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: @@ -451,31 +331,6 @@ jobs: RUST_BACKTRACE: 1 NEXTEST_STATUS_LEVEL: leak - - name: Save sccache cache (fallback) - if: always() && !cancelled() && env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' - continue-on-error: true - uses: actions/cache/save@v5 - with: - path: ${{ github.workspace }}/.sccache/ - key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ steps.lockhash.outputs.hash }}-${{ github.run_id }} - - - name: sccache stats - if: always() && env.USE_SCCACHE == 'true' - continue-on-error: true - run: sccache --show-stats || true - - - name: sccache summary - if: always() && env.USE_SCCACHE == 'true' - shell: bash - run: | - { - echo "### sccache stats — ${{ matrix.target }} (tests)"; - echo; - echo '```'; - sccache --show-stats || true; - echo '```'; - } >> "$GITHUB_STEP_SUMMARY" - - name: verify tests passed if: steps.test.outcome == 'failure' run: | @@ -509,8 +364,3 @@ jobs: [[ '${{ needs.cargo_shear.result }}' == 'success' ]] || { echo 'cargo_shear failed'; exit 1; } [[ '${{ needs.lint_build.result }}' == 'success' ]] || { echo 'lint_build failed'; exit 1; } [[ '${{ needs.tests.result }}' == 'success' ]] || { echo 'tests failed'; exit 1; } - - - name: sccache summary note - if: always() - run: | - echo "Per-job sccache stats are attached to each matrix job's Step Summary." From 45792ff5f5b877396315998c74a7f8af23fd8ba3 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 12:47:34 +0100 Subject: [PATCH 3/9] Mock --- codex-rs/core/src/compact.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/core/src/compact.rs b/codex-rs/core/src/compact.rs index 1a90b7b223f..10404dc6f2c 100644 --- a/codex-rs/core/src/compact.rs +++ b/codex-rs/core/src/compact.rs @@ -30,7 +30,7 @@ use tracing::error; pub const SUMMARIZATION_PROMPT: &str = include_str!("../templates/compact/prompt.md"); pub const SUMMARY_PREFIX: &str = include_str!("../templates/compact/summary_prefix.md"); -const COMPACT_USER_MESSAGE_MAX_TOKENS: usize = 20_000; +const COMPACT_USER_MESSAGE_MAX_TOKENS: usize = 20_001; pub(crate) fn should_use_remote_compact_task( session: &Session, From 6b5fe9edcf3b2c03e49762705ba2d0a64796d6c3 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 13:14:31 +0100 Subject: [PATCH 4/9] try something --- .github/workflows/rust-ci.yml | 60 +++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 123e3b75d31..3bacce99e71 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -111,6 +111,7 @@ jobs: working-directory: codex-rs env: CARGO_INCREMENTAL: "0" + CARGO_TARGET_DIR: ${{ github.workspace }}/.target/${{ matrix.target }}-${{ matrix.profile }} strategy: fail-fast: false @@ -165,15 +166,6 @@ jobs: targets: ${{ matrix.target }} components: clippy - - uses: Swatinem/rust-cache@v2 - with: - # Cache registry/git and build artifacts for this workspace/target/profile triple. - workspaces: | - codex-rs - shared-key: rust-ci-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} - cache-targets: true - cache-on-failure: true - - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}} name: Prepare APT cache directories (musl) shell: bash @@ -201,6 +193,35 @@ jobs: sudo apt-get -y update -o Acquire::Retries=3 sudo apt-get -y install --no-install-recommends musl-tools pkg-config + - uses: Swatinem/rust-cache@v2 + with: + # Cache registry/git and build artifacts for this workspace/target/profile triple. + workspaces: | + codex-rs + shared-key: rust-ci-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} + cache-targets: true + cache-on-failure: true + + - name: Install cargo-chef + if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} + uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 + with: + tool: cargo-chef + version: 0.1.71 + + - name: Pre-warm dependency cache (cargo-chef) + if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} + shell: bash + run: | + set -euo pipefail + RECIPE="${RUNNER_TEMP}/chef-recipe.json" + cargo chef prepare --recipe-path "$RECIPE" + PROFILE_ARGS="--profile ${{ matrix.profile }}" + if [[ "${{ matrix.profile }}" == "release" ]]; then + PROFILE_ARGS="--release" + fi + cargo chef cook --recipe-path "$RECIPE" --target ${{ matrix.target }} $PROFILE_ARGS --all-features + - name: Install cargo-chef if: ${{ matrix.profile == 'release' }} uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 @@ -263,6 +284,7 @@ jobs: working-directory: codex-rs env: CARGO_INCREMENTAL: "0" + CARGO_TARGET_DIR: ${{ github.workspace }}/.target/${{ matrix.target }}-${{ matrix.profile }} strategy: fail-fast: false @@ -319,6 +341,26 @@ jobs: cache-targets: true cache-on-failure: true + - name: Install cargo-chef + if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} + uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 + with: + tool: cargo-chef + version: 0.1.71 + + - name: Pre-warm dependency cache (cargo-chef) + if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} + shell: bash + run: | + set -euo pipefail + RECIPE="${RUNNER_TEMP}/chef-recipe.json" + cargo chef prepare --recipe-path "$RECIPE" + PROFILE_ARGS="--profile ${{ matrix.profile }}" + if [[ "${{ matrix.profile }}" == "release" ]]; then + PROFILE_ARGS="--release" + fi + cargo chef cook --recipe-path "$RECIPE" --target ${{ matrix.target }} $PROFILE_ARGS --all-features + - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: nextest From e32ddcfa70fe5444fa3b4f7bb9fe7e0977a7d544 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 13:55:24 +0100 Subject: [PATCH 5/9] try something 2 --- codex-rs/core/src/compact.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/core/src/compact.rs b/codex-rs/core/src/compact.rs index 10404dc6f2c..1a90b7b223f 100644 --- a/codex-rs/core/src/compact.rs +++ b/codex-rs/core/src/compact.rs @@ -30,7 +30,7 @@ use tracing::error; pub const SUMMARIZATION_PROMPT: &str = include_str!("../templates/compact/prompt.md"); pub const SUMMARY_PREFIX: &str = include_str!("../templates/compact/summary_prefix.md"); -const COMPACT_USER_MESSAGE_MAX_TOKENS: usize = 20_001; +const COMPACT_USER_MESSAGE_MAX_TOKENS: usize = 20_000; pub(crate) fn should_use_remote_compact_task( session: &Session, From afe3673575590e2e933d83f64717615d2df17927 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 14:01:06 +0100 Subject: [PATCH 6/9] Fix windows --- .github/workflows/rust-ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 3bacce99e71..2b1ae46b1e3 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -284,7 +284,8 @@ jobs: working-directory: codex-rs env: CARGO_INCREMENTAL: "0" - CARGO_TARGET_DIR: ${{ github.workspace }}/.target/${{ matrix.target }}-${{ matrix.profile }} + # Tests run with the custom ci-test profile; keep target dir keyed to it. + CARGO_TARGET_DIR: ${{ github.workspace }}/.target/${{ matrix.target }}-ci-test strategy: fail-fast: false @@ -337,7 +338,7 @@ jobs: with: workspaces: | codex-rs - shared-key: rust-ci-tests-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} + shared-key: rust-ci-tests-${{ matrix.runner }}-${{ matrix.target }}-ci-test cache-targets: true cache-on-failure: true @@ -355,10 +356,7 @@ jobs: set -euo pipefail RECIPE="${RUNNER_TEMP}/chef-recipe.json" cargo chef prepare --recipe-path "$RECIPE" - PROFILE_ARGS="--profile ${{ matrix.profile }}" - if [[ "${{ matrix.profile }}" == "release" ]]; then - PROFILE_ARGS="--release" - fi + PROFILE_ARGS="--profile ci-test" cargo chef cook --recipe-path "$RECIPE" --target ${{ matrix.target }} $PROFILE_ARGS --all-features - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 From 46fb8820e378474bbc33fc9a6803b8c801f10a8c Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 17:43:26 +0100 Subject: [PATCH 7/9] Improve windows --- .github/workflows/rust-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 2b1ae46b1e3..6c7ae282ad2 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -203,14 +203,12 @@ jobs: cache-on-failure: true - name: Install cargo-chef - if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: cargo-chef version: 0.1.71 - name: Pre-warm dependency cache (cargo-chef) - if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} shell: bash run: | set -euo pipefail @@ -343,14 +341,12 @@ jobs: cache-on-failure: true - name: Install cargo-chef - if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: cargo-chef version: 0.1.71 - name: Pre-warm dependency cache (cargo-chef) - if: ${{ matrix.profile == 'release' || contains(matrix.target, 'windows') }} shell: bash run: | set -euo pipefail From cb24978d44034f67ffcbb3cec37a39817f9279f7 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 17:50:18 +0100 Subject: [PATCH 8/9] Fix --- .github/workflows/rust-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 6c7ae282ad2..9e3f001128c 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -282,8 +282,7 @@ jobs: working-directory: codex-rs env: CARGO_INCREMENTAL: "0" - # Tests run with the custom ci-test profile; keep target dir keyed to it. - CARGO_TARGET_DIR: ${{ github.workspace }}/.target/${{ matrix.target }}-ci-test + CARGO_TARGET_DIR: ${{ github.workspace }}/.target/${{ matrix.target }}-${{ matrix.profile }} strategy: fail-fast: false @@ -336,7 +335,7 @@ jobs: with: workspaces: | codex-rs - shared-key: rust-ci-tests-${{ matrix.runner }}-${{ matrix.target }}-ci-test + shared-key: rust-ci-tests-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }} cache-targets: true cache-on-failure: true From 3718dd988ce6e36687de329cc20231018bf61fb4 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 23 Dec 2025 17:51:18 +0100 Subject: [PATCH 9/9] Drop cargo chef --- .github/workflows/rust-ci.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 9e3f001128c..2140bd11f1e 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -339,21 +339,6 @@ jobs: cache-targets: true cache-on-failure: true - - name: Install cargo-chef - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 - with: - tool: cargo-chef - version: 0.1.71 - - - name: Pre-warm dependency cache (cargo-chef) - shell: bash - run: | - set -euo pipefail - RECIPE="${RUNNER_TEMP}/chef-recipe.json" - cargo chef prepare --recipe-path "$RECIPE" - PROFILE_ARGS="--profile ci-test" - cargo chef cook --recipe-path "$RECIPE" --target ${{ matrix.target }} $PROFILE_ARGS --all-features - - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: nextest