carlos / platform Public

amadan CI: cross-compile all five targets, not three

`.amadan/ci.d/20-cross@3` dealt darwin/arm64, darwin/amd64 and
linux/arm64. The `cross` job in `.github/workflows/ci.yml` deals those
three plus windows/amd64 and windows/arm64. So the amadan copy of the
gate has been a strict subset of the gate maintainers believe protects
them — and the workflow is the thing due to be deleted.

The two missing shards are the ones the workflow's own comments argue
hardest for: Windows is a client target, the CLI is the same binary as
the agent, and the unix-only syscalls therefore live behind per-OS files
(internal/edge/purge_listen_*.go, internal/host/{statfs,flock}_*.go).
That job "is what stops the next syscall.Foo from silently un-shipping
the Windows build" — precisely the job the amadan side had dropped.

Rename to @5, add the two case arms, carry the Windows rationale across
with them, and move the shard-count fence from 3 to 5 so the file name
and the target list still cannot drift apart.

All five targets compile at this commit; the fence refuses a run at any
count other than 5.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev d9e229beaeb1b799d4d6f825289c64fb1eff84ee parent 04dece9
2 files changed, +16 −7
  • .amadan/README.md +1 −1
  • .amadan/ci.d/{20-cross@3 => 20-cross@5} +15 −6
diff --git a/.amadan/README.md b/.amadan/README.md
index e35f10661..4d96e3089 100644
--- a/.amadan/README.md
+++ b/.amadan/README.md
@@ -9,7 +9,7 @@ here.
| workflow job | here | |
|---|---|---|
| `gate` | `10-gate` | build · vet · `go test ./... -count=1` |
-| `cross` | `20-cross@3` | one target per shard |
+| `cross` | `20-cross@5` | one target per shard, all five |
| `minio-contract` | **not ported** | see below |
| `gofmt` | **not ported** | see below |
diff --git a/.amadan/ci.d/20-cross@3 b/.amadan/ci.d/20-cross@5
similarity index 66%
rename from .amadan/ci.d/20-cross@3
rename to .amadan/ci.d/20-cross@5
index 6f79790c5..9dec4b177 100755
--- a/.amadan/ci.d/20-cross@3
+++ b/.amadan/ci.d/20-cross@5
@@ -9,9 +9,16 @@
# built it was on Linux. Cross-compiling catches it in seconds and needs
# no Mac.
#
-# The @3 is amadan's whole sharding interface: it runs this script three
+# Windows is a CLIENT target: `carlos deploy` from a Windows workstation
+# against a Linux fleet. The box-side packages still have to COMPILE
+# there, because the CLI is the same binary as the agent, so unix-only
+# syscalls live behind per-OS files (internal/edge/purge_listen_*.go,
+# internal/host/{statfs,flock}_*.go). These two shards are what stops
+# the next syscall.Foo from silently un-shipping the Windows build.
+#
+# The @5 is amadan's whole sharding interface: it runs this script five
# times concurrently and tells each copy which one it is. One target per
-# shard rather than three builds in a row, because they are independent
+# shard rather than five builds in a row, because they are independent
# and this box has the cores — and because a failing target then names
# itself in the shard that failed, instead of being the first line of a
# combined log.
@@ -22,12 +29,12 @@ shards=${AMADAN_SHARD_COUNT:?this step must be run by amadan CI, which sets AMAD
# The fence. The targets below are a fixed list, and the shard count in
# this file's name is what deals them out — so the two MUST agree. Rename
-# this to @2 and, without this check, one platform silently stops being
+# this to @4 and, without this check, one platform silently stops being
# compiled while CI stays green. That is the exact shape of the bug the
# job exists to catch, arriving through the job that catches it.
-if [ "$shards" -ne 3 ]; then
- echo "this step deals 3 fixed targets but was run with $shards shards —"
- echo "rename the file back to 20-cross@3, or add a target below"
+if [ "$shards" -ne 5 ]; then
+ echo "this step deals 5 fixed targets but was run with $shards shards —"
+ echo "rename the file back to 20-cross@5, or add a target below"
exit 1
fi
@@ -35,6 +42,8 @@ case "$shard" in
0) GOOS=darwin GOARCH=arm64 ;;
1) GOOS=darwin GOARCH=amd64 ;;
2) GOOS=linux GOARCH=arm64 ;;
+3) GOOS=windows GOARCH=amd64 ;;
+4) GOOS=windows GOARCH=arm64 ;;
*) echo "no target for shard $shard"; exit 1 ;;
esac