Skip to content

Commit 37c0195

Browse files
authored
Merge pull request #132 from TransformerOptimus/feat/eval-harness-bench-runner
Eval harness: bench-runner + context-sync + bulk-indexer (+CI)
2 parents 180287e + 0a352e3 commit 37c0195

21 files changed

Lines changed: 828 additions & 153 deletions

File tree

.cargo/config.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# The static musl bench-runner must be a NON-PIE static binary.
2+
#
3+
# Rust defaults the x86_64-unknown-linux-musl target to static-PIE, which
4+
# segfaults at startup on some native x86_64 hosts (it only ran under emulation
5+
# in local testing; CI on a native runner caught the SIGSEGV). relocation-model=
6+
# static produces a classic, position-dependent, fully static executable that
7+
# runs everywhere — including the SWE-bench task containers the bench-runner
8+
# ships into.
9+
[target.x86_64-unknown-linux-musl]
10+
rustflags = ["-C", "relocation-model=static"]

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,48 @@ jobs:
4848
- name: cargo check (workspace)
4949
run: cargo check --workspace --all-targets
5050

51+
- name: cargo test (workspace)
52+
run: cargo test --workspace --locked
53+
54+
bench-runner-musl:
55+
# The bench-runner ships as a static musl binary into toolchain-free task
56+
# containers. cargo check can't catch a native-tls regression (it only breaks
57+
# the musl link), so we build it for real here to guard the rustls-only (R1)
58+
# invariant. Builds ONLY -p bench-runner, so no tauri/frontend deps are needed.
59+
runs-on: ubuntu-22.04
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- uses: dtolnay/rust-toolchain@stable
64+
with:
65+
targets: x86_64-unknown-linux-musl
66+
67+
- uses: swatinem/rust-cache@v2
68+
with:
69+
key: musl-bench-runner
70+
71+
- name: Install musl toolchain
72+
run: sudo apt-get update && sudo apt-get install -y musl-tools
73+
74+
- name: Build static bench-runner
75+
env:
76+
CC_x86_64_unknown_linux_musl: musl-gcc
77+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
78+
run: cargo build --release --locked -p bench-runner --target x86_64-unknown-linux-musl
79+
80+
- name: Assert static & self-contained (R1 guard)
81+
run: |
82+
BIN=target/x86_64-unknown-linux-musl/release/bench-runner
83+
file "$BIN"
84+
ldd "$BIN" 2>&1 || true
85+
# musl static-pie resolves NO shared libs; a real dynamic dep shows "=>".
86+
# (file's wording for static-pie varies by version, so don't grep file.)
87+
if ldd "$BIN" 2>&1 | grep -qE '=>|libssl|libcrypto'; then
88+
echo "ERROR: dynamic dependency present (native-tls regressed?)"; exit 1
89+
fi
90+
# Self-contained: runs on this host even though no musl libc is installed.
91+
"$BIN" --help >/dev/null && echo "runs standalone: OK"
92+
5193
frontend:
5294
runs-on: ubuntu-latest
5395
steps:

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,46 @@ jobs:
105105
name: supercoder-${{ matrix.target }}
106106
path: ${{ join(fromJSON(steps.tauri.outputs.artifactPaths), '\n') }}
107107
if-no-files-found: ignore
108+
109+
bench-runner:
110+
# The eval-harness bench-runner: a static musl x86_64 binary that runs the
111+
# agent headless inside toolchain-free task containers. Not a tauri bundle, so
112+
# it lives outside the desktop build matrix.
113+
runs-on: ubuntu-22.04
114+
permissions:
115+
contents: write
116+
steps:
117+
- uses: actions/checkout@v4
118+
119+
- uses: dtolnay/rust-toolchain@stable
120+
with:
121+
targets: x86_64-unknown-linux-musl
122+
123+
- uses: swatinem/rust-cache@v2
124+
with:
125+
key: musl-bench-runner
126+
127+
- name: Install musl toolchain
128+
run: sudo apt-get update && sudo apt-get install -y musl-tools
129+
130+
- name: Build static bench-runner
131+
env:
132+
CC_x86_64_unknown_linux_musl: musl-gcc
133+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
134+
run: cargo build --release --locked -p bench-runner --target x86_64-unknown-linux-musl
135+
136+
- name: Stage artifact
137+
run: cp target/x86_64-unknown-linux-musl/release/bench-runner bench-runner-x86_64-unknown-linux-musl
138+
139+
- name: Upload to release
140+
if: github.event_name == 'release'
141+
env:
142+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
run: gh release upload "${{ github.event.release.tag_name }}" bench-runner-x86_64-unknown-linux-musl --clobber
144+
145+
- name: Upload as workflow artifact (workflow_dispatch only)
146+
if: github.event_name == 'workflow_dispatch'
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: bench-runner-x86_64-unknown-linux-musl
150+
path: bench-runner-x86_64-unknown-linux-musl

0 commit comments

Comments
 (0)