Skip to content

Commit 65111e5

Browse files
maxholmanclaude
andauthored
fix(version): restore semver+build-metadata format with seconds (#77)
* fix(version): restore vergen semver+build-metadata format with seconds Replace `built` crate with `vergen-gitcl` for all build metadata. Version strings now use proper semver+build-metadata format: `0.8.0+a1b2c3d-dirty.20260316T123456.release` - CLI, MCP, and daemon all use the same canonical format - Timestamp includes seconds (was date-only before) - Removed duplicate `version_string()` from daemon crate - Removed `built` dependency from daemon and CLI - REPL banner and `info` output use canonical version This work was originally done but lost in a stash. Recovered from stash@{1} and updated to use `build_timestamp` (with seconds) instead of `build_date`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(ci): use 4-core runners for PR workflow Faster builds, same cost (2x rate but half the time). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * revert(ci): back to ubuntu-latest, 4-core runners need org setup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(ci): use ubuntu-latest-m larger runner for PR workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * revert(ci): back to ubuntu-latest, larger runners require spending limit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(version): collapse consecutive str::replace per clippy Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(ci): use self-hosted runner for PR workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(ci): remove cloud cache for self-hosted runners Self-hosted runners persist target/ locally — no need for Swatinem/rust-cache or actions/cache. Also use plain docker build instead of buildx cache-from/cache-to which uploads to GitHub. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(ci): skip cloud cache on self-hosted runners Cache steps conditionally skipped when runner name contains 'self-hosted' — local target/ persists between runs. Falls back to Swatinem/rust-cache if switched to GitHub-hosted runners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ci): use runner.environment to detect self-hosted runners runner.name is the configured name (e.g. "hyper0"), not "self-hosted". runner.environment is "self-hosted" or "github-hosted". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ci): add --clobber to cross download for self-hosted runners Self-hosted runners persist /tmp between runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(ci): move build-and-publish to self-hosted runners Same pattern as PR workflow: self-hosted runners, conditional cache skip, plain docker build, --clobber for cross download. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(ci): guard cloud cache/buildx in build-and-publish with if Keep all GitHub-hosted runner steps intact but skip them on self-hosted via runner.environment check. Nothing deleted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6a7c9c6 commit 65111e5

21 files changed

Lines changed: 373 additions & 247 deletions

.github/workflows/build-and-publish.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ jobs:
2727
- x86_64-unknown-linux-musl
2828
- aarch64-unknown-linux-gnu
2929
include:
30-
# Per-target: os, artifact, cross
30+
# Per-target: artifact, cross
3131
- target: x86_64-unknown-linux-gnu
32-
os: ubuntu-latest
3332
artifact: wallhack-linux-x64
3433
- target: x86_64-unknown-linux-musl
35-
os: ubuntu-latest
3634
artifact: wallhack-linux-x64-musl
3735
cross: true
3836
custom_image: true
3937
- target: aarch64-unknown-linux-gnu
40-
os: ubuntu-latest
4138
artifact: wallhack-linux-arm64
4239
cross: true
4340
# Per-variant: features, suffix
@@ -60,7 +57,7 @@ jobs:
6057
variant: slim
6158
bloat_label: slim-musl
6259

63-
runs-on: ${{ matrix.os }}
60+
runs-on: self-hosted
6461

6562
steps:
6663
- uses: actions/checkout@v6
@@ -73,30 +70,33 @@ jobs:
7370
rustup target add ${{ matrix.target }}
7471
7572
- uses: Swatinem/rust-cache@v2
73+
if: runner.environment != 'self-hosted'
7674
with:
7775
shared-key: ${{ matrix.target }}-${{ matrix.variant }}
7876

7977
- name: Cache cross binary
80-
if: matrix.cross
78+
if: matrix.cross && runner.environment != 'self-hosted'
8179
id: cache-cross
8280
uses: actions/cache@v5
8381
with:
8482
path: ~/.cargo/bin/cross
8583
key: cross-${{ env.CROSS_VERSION }}-x86_64-unknown-linux-musl
8684

8785
- name: Install cross
88-
if: matrix.cross && steps.cache-cross.outputs.cache-hit != 'true'
86+
if: matrix.cross && (runner.environment == 'self-hosted' || steps.cache-cross.outputs.cache-hit != 'true')
8987
env:
9088
GH_TOKEN: ${{ github.token }}
9189
run: |
92-
gh release download "$CROSS_VERSION" --repo cross-rs/cross --pattern 'cross-x86_64-unknown-linux-musl.tar.gz' -D /tmp
93-
tar xz -C ~/.cargo/bin cross < /tmp/cross-x86_64-unknown-linux-musl.tar.gz
90+
if ! command -v cross &>/dev/null; then
91+
gh release download "$CROSS_VERSION" --repo cross-rs/cross --pattern 'cross-x86_64-unknown-linux-musl.tar.gz' -D /tmp --clobber
92+
tar xz -C ~/.cargo/bin cross < /tmp/cross-x86_64-unknown-linux-musl.tar.gz
93+
fi
9494
9595
- uses: docker/setup-buildx-action@v4
9696
if: matrix.custom_image
9797

9898
- name: Build and cache cross Docker image
99-
if: matrix.custom_image
99+
if: matrix.custom_image && runner.environment != 'self-hosted'
100100
uses: docker/build-push-action@v7
101101
with:
102102
context: .
@@ -106,6 +106,10 @@ jobs:
106106
cache-from: type=gha,scope=cross-musl
107107
cache-to: type=gha,mode=max,scope=cross-musl
108108

109+
- name: Build cross Docker image
110+
if: matrix.custom_image && runner.environment == 'self-hosted'
111+
run: docker build -t wallhack-cross:${{ matrix.target }} -f Dockerfile.cross-musl .
112+
109113
- name: Build (native)
110114
if: ${{ !matrix.cross }}
111115
run: cargo build --release --target ${{ matrix.target }} -p wallhack-cli ${{ matrix.features }}
@@ -129,7 +133,7 @@ jobs:
129133
130134
publish:
131135
needs: build
132-
runs-on: ubuntu-latest
136+
runs-on: self-hosted
133137
permissions:
134138
contents: write
135139
steps:

.github/workflows/pr.yml

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ env:
2121

2222
jobs:
2323
lint:
24-
runs-on: ubuntu-latest
24+
runs-on: self-hosted
2525
steps:
2626
- uses: actions/checkout@v6
2727

2828
- name: Install Rust toolchain
2929
run: rustup show
3030

3131
- uses: Swatinem/rust-cache@v2
32+
if: runner.environment != 'self-hosted'
3233

3334
- name: Format check
3435
run: cargo fmt --all -- --check
@@ -41,88 +42,64 @@ jobs:
4142

4243
test-musl:
4344
needs: [lint]
44-
runs-on: ubuntu-latest
45+
runs-on: self-hosted
4546
steps:
4647
- uses: actions/checkout@v6
4748

4849
- name: Install Rust toolchain
4950
run: rustup show
5051

5152
- uses: Swatinem/rust-cache@v2
53+
if: runner.environment != 'self-hosted'
5254
with:
5355
shared-key: musl
5456
workspaces: . -> target/musl
5557

56-
- name: Cache cross binary
57-
id: cache-cross
58-
uses: actions/cache@v5
59-
with:
60-
path: ~/.cargo/bin/cross
61-
key: cross-${{ env.CROSS_VERSION }}-x86_64-unknown-linux-musl
62-
6358
- name: Install cross
64-
if: steps.cache-cross.outputs.cache-hit != 'true'
59+
run: |
60+
if ! command -v cross &>/dev/null; then
61+
gh release download "$CROSS_VERSION" --repo cross-rs/cross --pattern 'cross-x86_64-unknown-linux-musl.tar.gz' -D /tmp --clobber
62+
tar xz -C ~/.cargo/bin cross < /tmp/cross-x86_64-unknown-linux-musl.tar.gz
63+
fi
6564
env:
6665
GH_TOKEN: ${{ github.token }}
67-
run: |
68-
gh release download "$CROSS_VERSION" --repo cross-rs/cross --pattern 'cross-x86_64-unknown-linux-musl.tar.gz' -D /tmp
69-
tar xz -C ~/.cargo/bin cross < /tmp/cross-x86_64-unknown-linux-musl.tar.gz
7066

7167
- uses: docker/setup-buildx-action@v4
7268

73-
- name: Build and cache cross Docker image
74-
uses: docker/build-push-action@v7
75-
with:
76-
context: .
77-
file: Dockerfile.cross-musl
78-
tags: wallhack-cross:x86_64-unknown-linux-musl
79-
load: true
80-
cache-from: type=gha,scope=cross-musl
81-
cache-to: type=gha,mode=max,scope=cross-musl
69+
- name: Build cross Docker image
70+
run: docker build -t wallhack-cross:x86_64-unknown-linux-musl -f Dockerfile.cross-musl .
8271

8372
- name: Test (musl — primary)
8473
run: CARGO_TARGET_DIR=target/musl cross test --release --target x86_64-unknown-linux-musl
8574

8675
build-musl:
8776
needs: [test-musl]
88-
runs-on: ubuntu-latest
77+
runs-on: self-hosted
8978
steps:
9079
- uses: actions/checkout@v6
9180

9281
- name: Install Rust toolchain
9382
run: rustup show
9483

9584
- uses: Swatinem/rust-cache@v2
85+
if: runner.environment != 'self-hosted'
9686
with:
9787
shared-key: musl
9888
workspaces: . -> target/musl
9989

100-
- name: Cache cross binary
101-
id: cache-cross
102-
uses: actions/cache@v5
103-
with:
104-
path: ~/.cargo/bin/cross
105-
key: cross-${{ env.CROSS_VERSION }}-x86_64-unknown-linux-musl
106-
10790
- name: Install cross
108-
if: steps.cache-cross.outputs.cache-hit != 'true'
91+
run: |
92+
if ! command -v cross &>/dev/null; then
93+
gh release download "$CROSS_VERSION" --repo cross-rs/cross --pattern 'cross-x86_64-unknown-linux-musl.tar.gz' -D /tmp --clobber
94+
tar xz -C ~/.cargo/bin cross < /tmp/cross-x86_64-unknown-linux-musl.tar.gz
95+
fi
10996
env:
11097
GH_TOKEN: ${{ github.token }}
111-
run: |
112-
gh release download "$CROSS_VERSION" --repo cross-rs/cross --pattern 'cross-x86_64-unknown-linux-musl.tar.gz' -D /tmp
113-
tar xz -C ~/.cargo/bin cross < /tmp/cross-x86_64-unknown-linux-musl.tar.gz
11498

11599
- uses: docker/setup-buildx-action@v4
116100

117-
- name: Build and cache cross Docker image
118-
uses: docker/build-push-action@v7
119-
with:
120-
context: .
121-
file: Dockerfile.cross-musl
122-
tags: wallhack-cross:x86_64-unknown-linux-musl
123-
load: true
124-
cache-from: type=gha,scope=cross-musl
125-
cache-to: type=gha,mode=max,scope=cross-musl
101+
- name: Build cross Docker image
102+
run: docker build -t wallhack-cross:x86_64-unknown-linux-musl -f Dockerfile.cross-musl .
126103

127104
- name: Build slim (musl — primary)
128105
run: CARGO_TARGET_DIR=target/musl cross build --release --target x86_64-unknown-linux-musl -p wallhack-cli --no-default-features --features slim
@@ -137,10 +114,9 @@ jobs:
137114
- name: Check default binary size (musl — primary)
138115
run: ./bench/check_bloat.sh --no-build --only=default-musl
139116

140-
141117
test-glibc:
142118
needs: [lint]
143-
runs-on: ubuntu-latest
119+
runs-on: self-hosted
144120
steps:
145121
- uses: actions/checkout@v6
146122

@@ -150,6 +126,7 @@ jobs:
150126
rustup target add x86_64-unknown-linux-gnu
151127
152128
- uses: Swatinem/rust-cache@v2
129+
if: runner.environment != 'self-hosted'
153130
with:
154131
shared-key: glibc
155132

@@ -158,7 +135,7 @@ jobs:
158135

159136
build-glibc:
160137
needs: [test-glibc]
161-
runs-on: ubuntu-latest
138+
runs-on: self-hosted
162139
steps:
163140
- uses: actions/checkout@v6
164141

@@ -168,6 +145,7 @@ jobs:
168145
rustup target add x86_64-unknown-linux-gnu
169146
170147
- uses: Swatinem/rust-cache@v2
148+
if: runner.environment != 'self-hosted'
171149
with:
172150
shared-key: glibc
173151
save-if: "false"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ docs/*PROPOSAL*.md
3434
# python garbage
3535
__pycache__/
3636
*.pyc
37+
.pytest_cache/
3738

3839
# bench build artifacts
3940
/bin/

0 commit comments

Comments
 (0)