Skip to content

ci: prerelease release builds use local ccache only (no remote reads) (#7249) - #7531

Merged
marbre merged 1 commit into
release/therock-10.0from
users/marbre/therock-10.0-9273e0c
Aug 20, 2026
Merged

ci: prerelease release builds use local ccache only (no remote reads) (#7249)#7531
marbre merged 1 commit into
release/therock-10.0from
users/marbre/therock-10.0-9273e0c

Conversation

@marbre

@marbre marbre commented Aug 20, 2026

Copy link
Copy Markdown
Member

Cherry-picks commit 9273e0c into the ROCm 10.0 release branch.


Motivation

Stable releases are a repackage of the prerelease release-candidate build, so the prerelease compile is what actually ships. Those objects should never come from a remote cache hit to eliminate cache poisoning risks.

Technical Details

Prerelease builds use the local cache only (remote disabled): zero remote hits, but the local cache still works normally (reads + writes).

  • build_tools/setup_ccache.py: now maps nightly-bkc and prerelease values of --release-type to --config-preset=local

Why local-only (not recache or full-disable)

  • Keep the local cache: local hits are fine, and some builds (notably Windows) need at least a local cache for performance and runner stability - without one we have seen runners exhaust resources and fail.
  • recache was rejected: it forces local misses too, defeating the local cache Windows needs.
  • Full-disable was rejected: it removes the local cache and changes build-config parity with nightly/CI.

Test Plan

  • build_tools/tests/setup_ccache_test.py (new): pins which release types read the shared remote cache and which are local-only, plus both failure modes above.
  • Local: run the tool as each workflow does for ci / dev / nightly / prerelease and compare the emitted config.
  • Owner dispatch: a prerelease run shows zero remote hits (local hits fine) in each stage's "Report" step and still builds artifacts; a dev / nightly run is unchanged.

Test Result

CI on this branch, all 9 new tests passing on both platforms:

Check Result
[Unit Tests ::
ubuntu-24.04](https://github.com/ROCm/TheRock/actions/runs/32395965820/job/96512731944) pass - 9/9 setup_ccache_test.py
[Unit Tests ::
windows-2022](https://github.com/ROCm/TheRock/actions/runs/32395965820/job/96512731634) pass - 9/9 setup_ccache_test.py

|
pre-commit | pass (black, mdformat, actionlint) |

Windows coverage matters here, not just for parity: IS_WINDOWS selects a different compiler_check mode, and Windows is the platform whose local-cache requirement is the reason this is local-only rather than a full disable.

Cache mode output from running the tool exactly as each workflow invokes it - only prerelease loses the remote, and it keeps its local cache:

[setup_ccache] Cache mode: release_type=ci         preset=github-oss-dev     remote=http://bazelremote-svc.bazelremote-ns...:8080|layout=bazel|connect-timeout=50      local=/tmp/ccache/ci/cache
[setup_ccache] Cache mode: release_type=dev        preset=github-oss-dev     remote=http://bazelremote-svc.bazelremote-ns...:8080|layout=bazel|connect-timeout=50      local=/tmp/ccache/dev/cache
[setup_ccache] Cache mode: release_type=nightly    preset=github-oss-release remote=http://bazelremote-svc-rel.bazelremote-ns...:8080|layout=bazel|connect-timeout=50  local=/tmp/ccache/nightly/cache
[setup_ccache] Cache mode: release_type=prerelease preset=github-oss-release remote=disabled (--no-remote-cache)                                                       local=/tmp/ccache/prerelease/cache

Submission Checklist


…#7249)

Cherry-picks commit 9273e0c into the ROCm 10.0 release branch.

---

## Motivation

Stable releases are a repackage of the **prerelease** release-candidate
build, so the prerelease compile is what actually ships. Those objects
should never come from a **remote** cache hit to eliminate cache
poisoning risks.

* Background: #7248
* Design discussion: #7259

## Technical Details

Prerelease builds use the **local cache only** (remote disabled): zero
remote hits, but the local cache still works normally (reads + writes).

- `build_tools/setup_ccache.py`: now maps `nightly-bkc` and `prerelease`
values of `--release-type` to `--config-preset=local`

### Why local-only (not recache or full-disable)

- **Keep the local cache**: local hits are fine, and some builds
(notably Windows) need at least a local cache for performance and runner
stability - without one we have seen runners exhaust resources and fail.
- `recache` was rejected: it forces *local* misses too, defeating the
local cache Windows needs.
- Full-disable was rejected: it removes the local cache and changes
build-config parity with nightly/CI.

## Test Plan

- `build_tools/tests/setup_ccache_test.py` (new): pins which release
types read the shared remote cache and which are local-only, plus both
failure modes above.
- Local: run the tool as each workflow does for `ci` / `dev` / `nightly`
/ `prerelease` and compare the emitted config.
- Owner dispatch: a `prerelease` run shows zero remote hits (local hits
fine) in each stage's "Report" step and still builds artifacts; a `dev`
/ `nightly` run is unchanged.

## Test Result

CI on this branch, all 9 new tests passing on both platforms:

| Check | Result |
| --- | --- |
| [Unit Tests ::
ubuntu-24.04](https://github.com/ROCm/TheRock/actions/runs/32395965820/job/96512731944)
| pass - 9/9 `setup_ccache_test.py` |
| [Unit Tests ::
windows-2022](https://github.com/ROCm/TheRock/actions/runs/32395965820/job/96512731634)
| pass - 9/9 `setup_ccache_test.py` |
|
[pre-commit](https://github.com/ROCm/TheRock/actions/runs/32395965889/job/96512732019)
| pass (black, mdformat, actionlint) |

Windows coverage matters here, not just for parity: `IS_WINDOWS` selects
a different `compiler_check` mode, and Windows is the platform whose
local-cache requirement is the reason this is local-only rather than a
full disable.

`Cache mode` output from running the tool exactly as each workflow
invokes it - only `prerelease` loses the remote, and it keeps its local
cache:

```text
[setup_ccache] Cache mode: release_type=ci         preset=github-oss-dev     remote=http://bazelremote-svc.bazelremote-ns...:8080|layout=bazel|connect-timeout=50      local=/tmp/ccache/ci/cache
[setup_ccache] Cache mode: release_type=dev        preset=github-oss-dev     remote=http://bazelremote-svc.bazelremote-ns...:8080|layout=bazel|connect-timeout=50      local=/tmp/ccache/dev/cache
[setup_ccache] Cache mode: release_type=nightly    preset=github-oss-release remote=http://bazelremote-svc-rel.bazelremote-ns...:8080|layout=bazel|connect-timeout=50  local=/tmp/ccache/nightly/cache
[setup_ccache] Cache mode: release_type=prerelease preset=github-oss-release remote=disabled (--no-remote-cache)                                                       local=/tmp/ccache/prerelease/cache
```

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Scott Todd <Scott.Todd@amd.com>
@marbre
marbre merged commit 16adc4d into release/therock-10.0 Aug 20, 2026
11 of 13 checks passed
@marbre
marbre deleted the users/marbre/therock-10.0-9273e0c branch August 20, 2026 22:34
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants