Skip to content

Commit eb35e4e

Browse files
mmastracclaude
andcommitted
docs: Vercel fork README, CI test workflow, and release workflow
Adds .github/README.md with fork-specific documentation including patch list, rebase workflow instructions for agents, and CI/release info. This displays over the upstream README.md on GitHub. Adds vercel-ci.yml (test on push/PR) and vercel-release.yml (manual workflow_dispatch that builds x86_64 + aarch64 musl binaries and creates a vercel-YYYYMMDD tagged GitHub release with patch stack). Removes code coverage (grcov/codecov) and benchmarks (codspeed) from upstream CI workflows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent acf536c commit eb35e4e

6 files changed

Lines changed: 215 additions & 144 deletions

File tree

.github/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# sccache (Vercel fork)
2+
3+
This is a Vercel-maintained fork of [mozilla/sccache](https://github.com/mozilla/sccache). It is maintained as a linear stack of patches (one commit = one feature) on top of the upstream `main` branch.
4+
5+
For full upstream documentation, see the [upstream README](../README.md) or the [upstream repository](https://github.com/mozilla/sccache#readme).
6+
7+
## Patches
8+
9+
Each patch is a single commit. Generate the current patch list with:
10+
11+
```
12+
git log --oneline upstream/main..HEAD
13+
```
14+
15+
Current patches (oldest first):
16+
17+
1. **Multi-level caching with automatic backfill** — Cherry-picked from upstream [mozilla/sccache#2581](https://github.com/mozilla/sccache/pull/2581). Adds hierarchical cache storage (e.g., disk -> redis -> s3) with configurable write tolerance policies and automatic backfill from slower tiers. Drop this patch once the PR is merged upstream.
18+
19+
2. **Allow caching all Rust crate types via `SCCACHE_RUST_CRATE_TYPE_ALLOW_HASH`** — Vercel-originated patch. When this env var is set, all crate types (bin, dylib, cdylib, proc-macro) become cacheable. The env var value is hashed into the cache key only when unsupported crate types are present, so machines with different linker setups get separate cache entries.
20+
21+
3. **Upgrade opendal + Vercel Artifacts cache backend** — Upgrades opendal to [mmastrac/opendal vercel_opts](https://github.com/mmastrac/opendal/tree/vercel_opts) branch via `[patch.crates-io]` ([apache/opendal#7334](https://github.com/apache/opendal/pull/7334)). Adds `layers-logging` feature and `aws-lc-sys/prebuilt-nasm`. Adds Vercel Artifacts cache backend configured via `SCCACHE_VERCEL_ARTIFACTS_TOKEN`, plus optional `SCCACHE_VERCEL_ARTIFACTS_ENDPOINT`, `SCCACHE_VERCEL_ARTIFACTS_TEAM_ID`, `SCCACHE_VERCEL_ARTIFACTS_TEAM_SLUG`. Once the upstream opendal PR merges, switch the patch to `apache/opendal` main. Drop the patch entirely once opendal publishes a release with these changes.
22+
23+
4. **This README + CI/release workflows** — Fork documentation, CI test workflow, and release workflow.
24+
25+
## CI & Releases
26+
27+
- **`vercel-ci.yml`** — Runs `cargo test` on Ubuntu on every push/PR.
28+
- **`vercel-release.yml`** — Manual trigger (`workflow_dispatch`). Builds static musl binaries for `x86_64` and `aarch64` Linux, then creates a GitHub release tagged `vercel-YYYYMMDD` with the patch stack in the release description.
29+
30+
## Agent instructions for rebasing on upstream
31+
32+
When rebasing this fork on the latest upstream `main`, follow these steps:
33+
34+
1. **Set up the upstream remote** (one-time):
35+
```
36+
git remote add upstream https://github.com/mozilla/sccache.git
37+
```
38+
39+
2. **Fetch upstream and rebase**:
40+
```
41+
git fetch upstream
42+
git rebase upstream/main
43+
```
44+
This replays each patch commit on top of the latest upstream.
45+
46+
3. **Resolve conflicts patch-by-patch**. For each patch that conflicts:
47+
- Fix the conflict in the affected files
48+
- `git add <files>` and `git rebase --continue`
49+
- Build and run tests to confirm correctness: `cargo build && cargo test`
50+
- If a patch corresponds to an upstream PR that has been merged (e.g., #2581), it will likely produce an empty commit or trivial conflict — **drop it** with `git rebase --skip` or remove it during interactive rebase
51+
52+
4. **Update this README**: revise the patch list above to reflect any dropped or added patches. Regenerate with `git log --oneline upstream/main..HEAD`.
53+
54+
5. **Run formatting, lints, build, and tests** after all patches are applied:
55+
```
56+
cargo fmt --all
57+
cargo clippy --locked --all-targets -- -D warnings -A unknown-lints -A clippy::type_complexity -A clippy::new-without-default
58+
cargo build
59+
cargo test
60+
```
61+
62+
6. **Force-push** the rebased branch:
63+
```
64+
git push --force-with-lease origin main
65+
```

.github/workflows/benchmarks.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,8 @@ jobs:
118118
rustc: beta
119119
notest_cuda_compilers: clang++
120120
extra_desc: cuda12.8
121-
no_coverage: true
122121
env:
123122
RUST_BACKTRACE: 1
124-
COVERAGE_REPORT_DIR: "target/debug"
125-
COVERAGE_REPORT_FILE: "target/debug/lcov.info"
126-
BINARY_DIR: "target/debug"
127-
GRCOV_IGNORE_OPTION: '--ignore build.rs --ignore "/*" --ignore "[a-zA-Z]:/*"'
128-
GRCOV_EXCLUDE_OPTION: '--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"'
129123
NOTEST_CUDA_COMPILERS: ${{ matrix.notest_cuda_compilers || '' }}
130124
CARGO_PROFILE_DEV_DEBUG: '0' # save disk space
131125
steps:
@@ -139,7 +133,6 @@ jobs:
139133
uses: ./.github/actions/rust-toolchain
140134
with:
141135
toolchain: ${{ matrix.rustc }}
142-
components: llvm-tools-preview
143136

144137
- if: ${{ contains(matrix.os, 'ubuntu') }}
145138
name: Install gcc & clang for tests
@@ -164,39 +157,6 @@ jobs:
164157
with:
165158
cuda-version: ${{ matrix.cuda }}
166159

167-
- name: "`grcov` ~ install"
168-
if: ${{ ! matrix.no_coverage }}
169-
shell: bash
170-
run: |
171-
GRCOV_VERSION="0.10.7"
172-
if [[ "$RUNNER_OS" == "Windows" ]]; then
173-
TARGET="x86_64-pc-windows-msvc"
174-
EXT="zip"
175-
elif [[ "$RUNNER_OS" == "macOS" && "$RUNNER_ARCH" == "ARM64" ]]; then
176-
TARGET="aarch64-apple-darwin"
177-
EXT="tar.bz2"
178-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
179-
TARGET="x86_64-apple-darwin"
180-
EXT="tar.bz2"
181-
else
182-
TARGET="x86_64-unknown-linux-musl"
183-
EXT="tar.bz2"
184-
fi
185-
URL="https://github.com/mozilla/grcov/releases/download/v${GRCOV_VERSION}/grcov-${TARGET}.${EXT}"
186-
curl -sL "$URL" -o "grcov.${EXT}"
187-
if [[ "$EXT" == "zip" ]]; then
188-
unzip -q "grcov.${EXT}" -d "$HOME/.cargo/bin/"
189-
else
190-
tar -xjf "grcov.${EXT}" -C "$HOME/.cargo/bin/"
191-
fi
192-
193-
- name: Create config for testing
194-
if: ${{ ! matrix.no_coverage }}
195-
run: |
196-
mkdir -p .cargo
197-
echo '[env]
198-
LLVM_PROFILE_FILE = { value = "target/debug/coverage/default-%p-%8m.profraw", relative = true }' >> .cargo/config.toml
199-
200160
- if: ${{ matrix.cuda != '' && runner.os == 'Linux' }}
201161
name: Free disk space for CUDA tests
202162
run: |
@@ -208,45 +168,13 @@ jobs:
208168
env:
209169
CARGO_INCREMENTAL: "0"
210170
RUSTC_WRAPPER: ""
211-
RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off"
212171

213172
- name: Upload failure
214173
if: failure()
215174
uses: ./.github/actions/artifact_failure
216175
with:
217176
name: test-${{ matrix.os }}-${{ matrix.rustc || 'stable' }}-${{ matrix.extra_desc }}
218177

219-
# coverage:
220-
- name: Display coverage files
221-
if: ${{ ! matrix.no_coverage }}
222-
shell: bash
223-
run:
224-
grcov . -s . --binary-path $BINARY_DIR --output-type files $GRCOV_IGNORE_OPTION $GRCOV_EXCLUDE_OPTION | sort --unique
225-
226-
- name: Generate coverage data (via `grcov`)
227-
if: ${{ ! matrix.no_coverage }}
228-
id: coverage
229-
shell: bash
230-
run: |
231-
mkdir -p "${COVERAGE_REPORT_DIR}"
232-
grcov . -s . --binary-path $BINARY_DIR --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch $GRCOV_IGNORE_OPTION $GRCOV_EXCLUDE_OPTION
233-
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
234-
235-
- name: Upload coverage results (to Codecov.io)
236-
if: ${{ ! matrix.no_coverage }}
237-
uses: codecov/codecov-action@v5
238-
with:
239-
files: ${{ steps.coverage.outputs.report }}
240-
## flags: IntegrationTests, UnitTests, ${{ steps.vars.outputs.CODECOV_FLAGS }}
241-
flags: ${{ steps.vars.outputs.CODECOV_FLAGS }}
242-
name: codecov-umbrella-${{ matrix.os }}-rust_${{ matrix.rustc || 'stable' }}-${{ matrix.extra_desc }}
243-
fail_ci_if_error: true
244-
# verbose: true
245-
env:
246-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
247-
248-
249-
250178
build:
251179
name: build ${{ matrix.binary || 'sccache' }} ${{ matrix.target }}
252180
runs-on: ${{ matrix.os }}

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,7 @@ jobs:
4444
uses: actions/checkout@v5
4545

4646
- name: Test
47-
run: cd tests/integration && WITH_COVERAGE=1 make test-${{ matrix.type }}
48-
49-
- name: Build report
50-
run: |
51-
cd tests/integration
52-
WITH_COVERAGE=1 make coverage-report
53-
echo "Coverage files:"
54-
ls ../../target/integration-coverage/profraw -l
55-
echo "Coverage report:"
56-
ls ../../target/integration-coverage/reports/lcov.info -l
57-
58-
- name: Upload coverage results (to Codecov.io)
59-
uses: codecov/codecov-action@v5
60-
with:
61-
files: target/integration-coverage/reports/lcov.info
62-
name: codecov-umbrella-integration-${{ matrix.type }}
63-
fail_ci_if_error: true
64-
# verbose: true
65-
env:
66-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
47+
run: cd tests/integration && make test-${{ matrix.type }}
6748

6849
gha:
6950
runs-on: ubuntu-24.04

.github/workflows/vercel-ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: vercel-ci
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
name: test ubuntu
7+
runs-on: ubuntu-22.04
8+
timeout-minutes: 30
9+
env:
10+
RUST_BACKTRACE: 1
11+
CARGO_INCREMENTAL: "0"
12+
RUSTC_WRAPPER: ""
13+
CARGO_PROFILE_DEV_DEBUG: "0"
14+
steps:
15+
- name: Clone repository
16+
uses: actions/checkout@v5
17+
18+
- name: Install rust
19+
uses: ./.github/actions/rust-toolchain
20+
with:
21+
toolchain: stable
22+
23+
- name: Install gcc & clang for tests
24+
env:
25+
DEBIAN_FRONTEND: noninteractive
26+
run: |
27+
set -x
28+
if dpkg -s gcc-14 >/dev/null 2>&1; then
29+
sudo apt remove -y gcc-14 g++-14
30+
sudo apt autoremove -y
31+
fi
32+
sudo apt install -y --no-install-recommends gcc clang
33+
34+
- name: Execute tests
35+
run: cargo test --locked --lib --bins --tests

0 commit comments

Comments
 (0)