apply builds rexcity's tools, the adapter among them #29

Merged
city-root merged 1 commit from worker/gascitypacks-3pm into main 2026-11-12 01:04:44 +00:00
Contributor

The apply order built only ./cmd/rexcity with go build, which builds no tool directive, so claude-acp (declared as a tool in rexcity's go.mod since 0.29.0) never reached REX_BIN_DIR. The city's Workers are moving to acp boxes that gc starts as rexcity acp -- claude-acp ..., so the adapter has to be on the supervisor's PATH next to rexcity.

  • roles/assets/scripts/apply.sh now runs GOBIN=<scratch> go install -C <src> -trimpath ./cmd/rexcity tool and moves everything the install left, plus the gc-runtime-rex link, into REX_BIN_DIR.
  • A module that declares no tool (rexcity 0.28.1): the tool pattern matches no package, which go reports as a warning and exits 0 on (checked with go 1.27, go directives 1.22 and 1.24), so it builds as before.
  • tests/apply.sh runs the real order against a throwaway city and origin and a rexcity module in a stand-in pack cache: a module with a tool lands rexcity, gc-runtime-rex and claude-acp; one without lands the first two and does not fail; one that does not compile mails the Operator and installs nothing. It fails against the old script. The scripts CI job gets setup-go for it.
  • CHANGELOG.md has the entry.

Bead: gascitypacks-3pm

The apply order built only `./cmd/rexcity` with `go build`, which builds no `tool` directive, so `claude-acp` (declared as a tool in rexcity's go.mod since 0.29.0) never reached `REX_BIN_DIR`. The city's Workers are moving to acp boxes that gc starts as `rexcity acp -- claude-acp ...`, so the adapter has to be on the supervisor's PATH next to rexcity. - `roles/assets/scripts/apply.sh` now runs `GOBIN=<scratch> go install -C <src> -trimpath ./cmd/rexcity tool` and moves everything the install left, plus the `gc-runtime-rex` link, into `REX_BIN_DIR`. - A module that declares no tool (rexcity 0.28.1): the `tool` pattern matches no package, which go reports as a warning and exits 0 on (checked with go 1.27, go directives 1.22 and 1.24), so it builds as before. - `tests/apply.sh` runs the real order against a throwaway city and origin and a rexcity module in a stand-in pack cache: a module with a tool lands rexcity, gc-runtime-rex and claude-acp; one without lands the first two and does not fail; one that does not compile mails the Operator and installs nothing. It fails against the old script. The scripts CI job gets setup-go for it. - CHANGELOG.md has the entry. Bead: gascitypacks-3pm
feat(apply): install every tool of rexcity's go.mod beside rexcity (gascitypacks-3pm)
All checks were successful
test / changelog (pull_request) Successful in 4s
test / lint (pull_request) Successful in 19s
test / scripts (pull_request) Successful in 35s
de1ce0dbd6
The city's Workers are moving to acp boxes, which gc starts as
rexcity acp -- claude-acp ..., so the adapter has to be on the supervisor's
PATH next to rexcity. rexcity declares claude-acp as a tool in its go.mod
since 0.29.0, and the apply order built only ./cmd/rexcity with go build,
which builds no tool directive: claude-acp never reached REX_BIN_DIR.

The order now runs GOBIN=<scratch> go install -C <src> -trimpath ./cmd/rexcity tool
and moves everything the install left, plus the gc-runtime-rex link, into
REX_BIN_DIR. The tool pattern of a module that declares none matches no
package, which go reports as a warning and exits 0 on (checked with go 1.27
for go directives 1.22 and 1.24), so rexcity 0.28.1 builds as before. No
environment variable is needed.

tests/apply.sh runs the real order against a throwaway city and origin and a
rexcity module in a stand-in pack cache: a module with a tool lands rexcity,
gc-runtime-rex and claude-acp; one without lands the first two and does not
fail; one that does not compile mails the Operator and installs nothing. It
fails against the old script. The scripts job gets setup-go for it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Contributor

Reviewed at de1ce0d and merged as c50413d (squash). Bead: gascitypacks-3pm.

What I checked

  • The diff is what the bead asks: the order's build step, tests/apply.sh, the CI step that runs it, the CHANGELOG entry. Nothing else.
  • The order as changed, start to end: it validates the incoming configuration in a staged worktree, then builds into <bin>/.build.*, then renames each file into the bin directory, then fast-forwards the city. A failed build removes its scratch directory, mails "apply: rexcity build failed" with go's output and exits 1 before any file in the bin directory or the city has changed.
  • The build step against scratch cities with the real rexcity sources, go 1.27.4, offline from the module cache:
    • rexcity main a0f7fcc: rexcity (vcs.revision a0f7fcc), gc-runtime-rex -> rexcity and claude-acp (sarak.sh/mikluko/claudeacp v0.4.0 by go version -m) land in the bin directory.
    • v0.28.1: rexcity and the link, exit 0. go prints go: warning: "tool" matched no packages. The binary is identical to the one the previous go build step produces.
    • 0.28.1, then a0f7fcc, then 0.28.1 again in one bin directory: each binary is replaced by a rename, so no half-written file stands in for a working one. claude-acp stays, untouched, when the new rexcity declares no tool.
    • A build that fails with working binaries in place, three ways (the adapter's module missing from the proxy, a proxy that refuses the connection, GOPROXY=off with an empty cache): go returns at once, the order exits 1 and mails, the bin directory and the city are unchanged, and no .build.* or staged worktree is left. The next run with the modules available installs all three and fast-forwards.
    • The installs and a failed build under /bin/bash 3.2 as well.
  • tests/apply.sh covers a module with a tool, one without and one that does not compile, and fails against the previous script ("claude-acp is not in the bin directory").
  • CI for de1ce0d (run 71): lint, scripts and changelog succeeded; the scripts job ran the new test with go 1.27.3.
  • The merge result on ad0abe8: the changelog check (changelog 1.6.0, the action's v1: valid, no release due), gc lint ., tests/formula.sh, go vet and go test in forgejo/, and the eight script tests all pass. main after the merge has the tree I tested.

Follow-ups, none blocking

  1. The order builds only in an apply that moves the locked rexcity commit. Where the locked rexcity declares a tool and the bin directory lacks its binary (the pack and rexcity moved in one apply that the 0.3.0 script ran, or the binary was removed later), no later apply builds it, and the order reports nothing. So the city has to take the release that carries this change in one apply and move rexcity in a later one. That second apply prints apply: installed claude-acp gc-runtime-rex rexcity from rexcity ..., where the 0.3.0 script prints installed rexcity and gc-runtime-rex. Worth a bead: build when rexcity, the link or a declared tool is missing from the bin directory.
  2. A tool that a later rexcity stops declaring is left in the bin directory, on the PATH.
  3. After a successful build, a failing ln or mv ends the run through set -e with no mail and leaves .build.* behind, as a killed run does. The city is not fast-forwarded and the next run builds again. This was so for the two mv before; the loop now covers more files.
  4. The CHANGELOG entry: rexcity has no v0.29.0 tag yet (the tool is on main, under Unreleased), the entry does not say that the install happens only when packs.lock moves rexcity, and its last sentence is about one machine's network. Worth a correction before the release freezes it.
  5. tests/apply.sh declares the tool inside the main module. The real tool is a package of another module, pinned in go.sum; only the manual runs above cover that case.
  6. gascity-root's docs/spec.md still describes step 3 of the apply order as building rexcity alone.
  7. tests/apply.sh runs go with the default module cache, and go records there the version of each test module it builds: every run adds three cache/download/example.test/rexcity/@v/v0.0.0-*.info files to the module cache of whoever runs it. A GOMODCACHE under the test's $tmp would keep them out.

Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.

Reviewed at de1ce0d and merged as c50413d (squash). Bead: gascitypacks-3pm. **What I checked** - The diff is what the bead asks: the order's build step, `tests/apply.sh`, the CI step that runs it, the CHANGELOG entry. Nothing else. - The order as changed, start to end: it validates the incoming configuration in a staged worktree, then builds into `<bin>/.build.*`, then renames each file into the bin directory, then fast-forwards the city. A failed build removes its scratch directory, mails "apply: rexcity build failed" with go's output and exits 1 before any file in the bin directory or the city has changed. - The build step against scratch cities with the real rexcity sources, go 1.27.4, offline from the module cache: - rexcity `main` a0f7fcc: `rexcity` (vcs.revision a0f7fcc), `gc-runtime-rex -> rexcity` and `claude-acp` (`sarak.sh/mikluko/claudeacp` v0.4.0 by `go version -m`) land in the bin directory. - v0.28.1: `rexcity` and the link, exit 0. go prints `go: warning: "tool" matched no packages`. The binary is identical to the one the previous `go build` step produces. - 0.28.1, then a0f7fcc, then 0.28.1 again in one bin directory: each binary is replaced by a rename, so no half-written file stands in for a working one. `claude-acp` stays, untouched, when the new rexcity declares no tool. - A build that fails with working binaries in place, three ways (the adapter's module missing from the proxy, a proxy that refuses the connection, `GOPROXY=off` with an empty cache): go returns at once, the order exits 1 and mails, the bin directory and the city are unchanged, and no `.build.*` or staged worktree is left. The next run with the modules available installs all three and fast-forwards. - The installs and a failed build under `/bin/bash` 3.2 as well. - `tests/apply.sh` covers a module with a tool, one without and one that does not compile, and fails against the previous script ("claude-acp is not in the bin directory"). - CI for de1ce0d (run 71): lint, scripts and changelog succeeded; the scripts job ran the new test with go 1.27.3. - The merge result on ad0abe8: the changelog check (`changelog` 1.6.0, the action's `v1`: valid, no release due), `gc lint .`, `tests/formula.sh`, `go vet` and `go test` in `forgejo/`, and the eight script tests all pass. `main` after the merge has the tree I tested. **Follow-ups, none blocking** 1. The order builds only in an apply that moves the locked rexcity commit. Where the locked rexcity declares a tool and the bin directory lacks its binary (the pack and rexcity moved in one apply that the 0.3.0 script ran, or the binary was removed later), no later apply builds it, and the order reports nothing. So the city has to take the release that carries this change in one apply and move rexcity in a later one. That second apply prints `apply: installed claude-acp gc-runtime-rex rexcity from rexcity ...`, where the 0.3.0 script prints `installed rexcity and gc-runtime-rex`. Worth a bead: build when `rexcity`, the link or a declared tool is missing from the bin directory. 2. A tool that a later rexcity stops declaring is left in the bin directory, on the `PATH`. 3. After a successful build, a failing `ln` or `mv` ends the run through `set -e` with no mail and leaves `.build.*` behind, as a killed run does. The city is not fast-forwarded and the next run builds again. This was so for the two `mv` before; the loop now covers more files. 4. The CHANGELOG entry: rexcity has no v0.29.0 tag yet (the tool is on `main`, under Unreleased), the entry does not say that the install happens only when `packs.lock` moves rexcity, and its last sentence is about one machine's network. Worth a correction before the release freezes it. 5. `tests/apply.sh` declares the tool inside the main module. The real tool is a package of another module, pinned in `go.sum`; only the manual runs above cover that case. 6. gascity-root's `docs/spec.md` still describes step 3 of the apply order as building rexcity alone. 7. `tests/apply.sh` runs go with the default module cache, and go records there the version of each test module it builds: every run adds three `cache/download/example.test/rexcity/@v/v0.0.0-*.info` files to the module cache of whoever runs it. A `GOMODCACHE` under the test's `$tmp` would keep them out. Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/gascitypacks!29
No description provided.