-
Notifications
You must be signed in to change notification settings - Fork 8
build: fetch the bundled drivers, and prove a build needs nothing else #708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "ftw": patch | ||
| --- | ||
|
|
||
| `make drivers` fetches the bundled snapshot from the pinned device-drivers commit, and CI proves a build works from the pin alone. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,8 @@ | |
|
|
||
| .PHONY: help test optimizer-install optimizer-test compose-migration-test container-boundary-test build build-arm64 build-amd64 build-windows-amd64 release \ | ||
| run-sim dev fmt vet clean e2e ci ci-ui ci-hw-pi docs \ | ||
| verify verify-all install-hooks driver-repository-validate driver-versions | ||
| verify verify-all install-hooks driver-repository-validate driver-versions \ | ||
| drivers drivers-present | ||
|
|
||
| VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev) | ||
| LDFLAGS := -s -w -X main.Version=$(VERSION) | ||
|
|
@@ -42,11 +43,31 @@ help: | |
| @echo " ci-ui browser smoke against FTW_BASE_URL" | ||
| @echo " ci-hw-pi deploy candidate to Pi CI slot + browser smoke" | ||
| @echo " fmt vet Go format + static checks" | ||
| @echo " drivers fetch drivers/ from the pinned device-drivers commit" | ||
| @echo " clean nuke build artifacts" | ||
|
|
||
| # ---- Bundled drivers ---- | ||
| # | ||
| # drivers/ is a snapshot of srcfl/device-drivers at the commit pinned in | ||
| # drivers/BUNDLED_SOURCE.json. It is fetched, not authored here. The Go tests | ||
| # read it, the container image copies it, and the release tarballs carry it, | ||
| # so it has to be populated before any of those run. | ||
|
|
||
| # Fetch the snapshot. Safe to re-run; it writes the same bytes every time. | ||
| drivers: | ||
| bash scripts/sync-bundled-drivers.sh | ||
|
|
||
| # Cheap enough to run before every test invocation, and it costs no network. | ||
| # Fetching here instead would put a remote call in the inner loop. | ||
| drivers-present: | ||
| @ls drivers/*.lua >/dev/null 2>&1 || { \ | ||
| echo "drivers/ has no .lua files. Run 'make drivers' to fetch the" >&2; \ | ||
| echo "snapshot pinned in drivers/BUNDLED_SOURCE.json." >&2; \ | ||
| exit 1; } | ||
|
|
||
| # ---- Testing ---- | ||
|
|
||
| test: optimizer/.venv/.installed | ||
| test: optimizer/.venv/.installed drivers-present | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the committed AGENTS.md reference: AGENTS.md:L12-L15 Useful? React with 👍 / 👎. |
||
| @status=0; \ | ||
| optimizer/.venv/bin/pytest -q optimizer/tests & py_pid=$$!; \ | ||
| (cd go && go test ./...) & go_pid=$$!; \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a pin update removes a driver,
make driversinvokes the existing sync script in write mode, which reports the old file asUNLISTEDbut exits successfully without deleting it; for example, droppingzapleavesdrivers/zap.luaon disk while printing that 36 drivers were written. The new target therefore does not reliably recreate the pinned snapshot in an existing checkout, so it should remove unlisted files or fail instead.AGENTS.md reference: AGENTS.md:L12-L15
Useful? React with 👍 / 👎.