Files
dev/Makefile
T
zeekay 43a2ed215f test: check every surface, and test the thing that edits upstream
The branding check read `dev --help` only, which is why `dev exec`
announced "OpenAI Codex" as its banner for a while — `--help` never shows
it. It now reads every subcommand's help, and found four more leaks by
itself: exec's usage line, its --strict-config and --skip-git-repo-check
text, and `-c/--config` still naming ~/.codex/config.toml. That last one
was recorded as unreachable when a copied island could not include
utils/cli; editing the checkout in place made it reachable.

Two things keep the word legitimately and are exempt: CODEX_HOME, an
environment variable upstream owns, and `codex/...`, which names a method
on the app-server wire protocol. Renaming either breaks something real.
Branding is the product name a reader sees, not identifiers on a wire.

hanzo-upstream had no tests, and it is the code that edits upstream in
place — including an idempotence bug shipped earlier today that stacked
appending edits until `hanzo-tui` appeared three times in one manifest.
The anchor logic is now a pure function with six tests, one of which is
that exact regression, and one of which asserts every shipped anchor is
well formed. `make test` reaches the crate now; being a detached
workspace, the root run could not see it.

Cloud tasks are Hanzo Tasks, not the upstream service's name.
2026-09-07 21:40:25 -07:00

65 lines
2.0 KiB
Makefile

TOOL := cargo run --quiet --manifest-path crates/hanzo-upstream/Cargo.toml --
CARGO := RUST_MIN_STACK=8388608 cargo
.PHONY: all prepare build release install test test-upstream bump v8 fmt clean reset help
.DEFAULT_GOAL := help
all: build
## prepare: apply the owned edits to the pinned upstream checkout
prepare:
@$(TOOL) prepare
## build: build the dev binary
build: prepare
@$(CARGO) build --locked -p hanzo-dev --bin dev
## release: build the optimized dev binary
release: prepare
@$(CARGO) build --locked --release -p hanzo-dev --bin dev
## install: put the release binary on PATH
install: release
@$(CARGO) install --locked --path crates/hanzo-dev --bin dev
## test: run the Hanzo test suite
# hanzo-upstream is a detached workspace, so the root run cannot see it — and it
# is the code that edits upstream in place, which is the last thing to leave
# untested.
test: prepare
@$(CARGO) nextest run --locked --no-fail-fast $(ARGS)
@$(CARGO) nextest run --no-fail-fast --manifest-path crates/hanzo-upstream/Cargo.toml $(ARGS)
## test-upstream: run the upstream suite against the pinned submodule
# voice-host wants GStreamer >= 1.28, which no current distribution ships, and
# nothing else in the workspace depends on it.
test-upstream: v8
@. target/v8-env.sh && $(CARGO) nextest run --no-fail-fast \
--manifest-path upstream/codex/codex-rs/Cargo.toml \
--workspace --exclude codex-voice-host $(ARGS)
## bump: move the upstream submodules to newer revisions
bump:
@$(TOOL) bump $(ARGS)
@$(TOOL) prepare
## v8: download and verify the V8 build the JavaScript runtime links
v8:
@$(TOOL) v8
## fmt: format the crates Hanzo owns
fmt:
@$(CARGO) fmt -p hanzo-dev -p hanzo-config -p hanzo-tui
@$(CARGO) fmt --manifest-path crates/hanzo-upstream/Cargo.toml
## clean: discard build output
clean:
@$(CARGO) clean
## reset: return the upstream checkout to its pinned revision
reset:
@git submodule foreach --quiet 'git reset --quiet --hard'
help:
@grep -hE '^## ' $(MAKEFILE_LIST) | sed 's/## / make /' | sort