Skip to content

Commit a868228

Browse files
committed
ci: hydrate vendored deps before build jobs
1 parent 6d2efb0 commit a868228

4 files changed

Lines changed: 65 additions & 9 deletions

File tree

.github/workflows/canary.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
- name: Checkout
4242
uses: actions/checkout@v4
4343

44+
- name: Hydrate vendored deps
45+
run: scripts/vendor/vendor-repo.sh hydrate
46+
4447
- name: Install Rust
4548
uses: dtolnay/rust-toolchain@stable
4649
with:
@@ -102,6 +105,9 @@ jobs:
102105
- name: Checkout
103106
uses: actions/checkout@v4
104107

108+
- name: Hydrate vendored deps
109+
run: scripts/vendor/vendor-repo.sh hydrate
110+
105111
- name: Install Rust
106112
uses: dtolnay/rust-toolchain@stable
107113
with:
@@ -131,7 +137,7 @@ jobs:
131137
path: dist/flow-x86_64-unknown-linux-gnu-linux-host-simd.tar.gz
132138

133139
release:
134-
needs: build
140+
needs: [build, build-linux-host-simd]
135141
timeout-minutes: 20
136142
runs-on: ubuntu-latest
137143
steps:

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
- name: Checkout
3737
uses: actions/checkout@v4
3838

39+
- name: Hydrate vendored deps
40+
run: scripts/vendor/vendor-repo.sh hydrate
41+
3942
- name: Install Rust
4043
uses: dtolnay/rust-toolchain@stable
4144
with:
@@ -97,6 +100,9 @@ jobs:
97100
- name: Checkout
98101
uses: actions/checkout@v4
99102

103+
- name: Hydrate vendored deps
104+
run: scripts/vendor/vendor-repo.sh hydrate
105+
100106
- name: Install Rust
101107
uses: dtolnay/rust-toolchain@stable
102108
with:
@@ -126,7 +132,7 @@ jobs:
126132
path: dist/flow-x86_64-unknown-linux-gnu-linux-host-simd.tar.gz
127133

128134
release:
129-
needs: build
135+
needs: [build, build-linux-host-simd]
130136
timeout-minutes: 20
131137
runs-on: ubuntu-latest
132138
steps:

docs/ci-cd-runbook.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ This runbook documents how Flow CI/CD is wired today and how to debug it quickly
77
- Workflows:
88
- `.github/workflows/canary.yml`: runs on every push to `main`, publishes/updates the `canary` release/tag.
99
- `.github/workflows/release.yml`: runs on tag pushes matching `v*`, publishes stable releases.
10+
- Vendored deps bootstrap:
11+
- Both workflows run `scripts/vendor/vendor-repo.sh hydrate` immediately after checkout in each build job.
12+
- This materializes `lib/vendor/*` from the pinned commit in `vendor.lock.toml` before Cargo builds.
1013
- Build jobs in both workflows:
1114
- Matrix build: macOS + Linux targets.
1215
- SIMD build: `build-linux-host-simd` (Linux x64 with `--features linux-host-simd-json`).
1316
- Release jobs:
1417
- Gather all build artifacts.
1518
- Publish release assets (and in Canary, force-move `canary` tag to current `main` commit).
19+
- `release` waits for both `build` and `build-linux-host-simd`.
1620

1721
## Runner Modes
1822

@@ -92,6 +96,14 @@ gh run view <run-id> --log-failed
9296
gh run watch <run-id>
9397
```
9498

99+
If failure shows:
100+
101+
- `failed to load source for dependency 'axum'`
102+
- `Unable to update .../lib/vendor/axum`
103+
- `No such file or directory (os error 2)`
104+
105+
then vendored deps were not hydrated before build.
106+
95107
### 2) SIMD lane queued forever
96108

97109
Usually means self-hosted runner routing issue.
@@ -131,6 +143,25 @@ f ci-blacksmith-enable-apply
131143
f ci-blacksmith-disable-apply
132144
```
133145

146+
### 3b) Vendored repo hydrate issues
147+
148+
Hydration depends on `vendor.lock.toml` pin and vendor repo availability.
149+
150+
Quick checks:
151+
152+
```bash
153+
scripts/vendor/vendor-repo.sh status
154+
scripts/vendor/vendor-repo.sh hydrate
155+
```
156+
157+
Expected:
158+
159+
- pinned commit in `vendor.lock.toml` is non-empty,
160+
- hydrate logs `hydrated <crate> -> lib/vendor/<crate>`,
161+
- `lib/vendor/axum/Cargo.toml` and `lib/vendor/reqwest/Cargo.toml` exist after hydrate.
162+
163+
If CI cannot clone SSH URL from lock, `vendor-repo.sh` now falls back to HTTPS clone for GitHub URLs.
164+
134165
### 4) `curl ... install.sh` does not fetch expected fresh build
135166

136167
Flow installer defaults to `canary` unless `FLOW_VERSION` is set differently. Check if `canary` moved:

scripts/vendor/vendor-repo.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,21 @@ ensure_checkout() {
134134
if git clone "$repo_url" "$checkout" >/dev/null 2>&1; then
135135
echo "cloned $repo_url -> $checkout" >&2
136136
else
137-
echo "warning: failed to clone $repo_url" >&2
138-
echo "initializing local checkout at $checkout (set remote for later push)" >&2
139-
git init "$checkout" >/dev/null
140-
git -C "$checkout" checkout -q -B "$branch"
141-
git -C "$checkout" remote add origin "$repo_url"
137+
https_url=""
138+
if [[ "$repo_url" =~ ^git@github\.com:(.+)\.git$ ]]; then
139+
https_url="https://github.com/${BASH_REMATCH[1]}.git"
140+
fi
141+
142+
if [[ -n "$https_url" ]] && git clone "$https_url" "$checkout" >/dev/null 2>&1; then
143+
echo "cloned $https_url -> $checkout (fallback from SSH URL)" >&2
144+
git -C "$checkout" remote set-url origin "$repo_url" >/dev/null 2>&1 || true
145+
else
146+
echo "warning: failed to clone $repo_url" >&2
147+
echo "initializing local checkout at $checkout (set remote for later push)" >&2
148+
git init "$checkout" >/dev/null
149+
git -C "$checkout" checkout -q -B "$branch"
150+
git -C "$checkout" remote add origin "$repo_url"
151+
fi
142152
fi
143153

144154
if ! git -C "$checkout" rev-parse --verify "$branch" >/dev/null 2>&1; then
@@ -357,8 +367,11 @@ cmd_status() {
357367

358368
if [[ -d "$checkout/.git" ]]; then
359369
local head_sha
360-
head_sha="$(git -C "$checkout" rev-parse HEAD)"
361-
echo "head: $head_sha"
370+
if head_sha="$(git -C "$checkout" rev-parse --verify HEAD 2>/dev/null)"; then
371+
echo "head: $head_sha"
372+
else
373+
echo "head: <no commits yet>"
374+
fi
362375

363376
if git -C "$checkout" remote get-url origin >/dev/null 2>&1; then
364377
if git -C "$checkout" fetch -q origin "$branch" >/dev/null 2>&1; then

0 commit comments

Comments
 (0)