Skip to content

build: FTW holds no driver source - #712

Merged
frahlg merged 1 commit into
masterfrom
ftw-holds-no-driver-source
Jul 29, 2026
Merged

build: FTW holds no driver source#712
frahlg merged 1 commit into
masterfrom
ftw-holds-no-driver-source

Conversation

@frahlg

@frahlg frahlg commented Jul 29, 2026

Copy link
Copy Markdown
Member

The cutover. drivers/*.lua leaves git and is gitignored.

The files still ship. Offline recovery needs them in the image, the release tarballs carry them, the tests read them. They are fetched from the commit pinned in drivers/BUNDLED_SOURCE.json rather than committed here.

Why, in one paragraph

The point is not the bytes. It is that there is no file to open a pull request against. Two contributors spent real effort — thirty minutes on an SE17K, register-by-register Modbus probing on a Pixii — writing fixes against files that regenerate. A guard that fails the pull request recovers the codebase but not the afternoon. Absence teaches faster than a red check does.

This is the small change #708 and #709 were for

Everything that needed the files in git already stopped needing them:

What changed

--check asks a different question. It used to compare committed bytes against the pin. There are no committed bytes now, so it asks whether any driver is committed at all — cheaper than a content diff, a stricter rule, and it needs no network.

Every workflow that reads drivers/ fetches first:

Workflow Jobs
test.yml core, drivers, e2e (drivers-from-pin already did)
beta.yml the image build
release-assets.yml the tarball job and the image job

Locally, e2e, release and driver-repository-validate depend on drivers-present, so a missing fetch fails with the remedy rather than a confusing file-not-found.

Verified

$ rm -rf drivers/*.lua && make drivers
wrote 37 drivers from srcfl/device-drivers@a4d0205d5f44

$ cd go && go clean -testcache && go test ./...
(all packages ok)

$ FTW_E2E=1 go test ./test/e2e
ok  github.com/srcfl/ftw/go/test/e2e  25.6s

The guard is proven to fire: git add -f drivers/pixii.lua makes --check report COMMITTED drivers/pixii.lua and exit 1.

Pin is at device-drivers a4d0205, current with its main.

The one thing to watch

The release workflows cannot be exercised by this pull request — they run on tags. I read beta.yml, release-assets.yml, release.yml, optimizer-release.yml and rpi-image-build.yml and added the fetch to every job that either builds the image or packs the tarballs; the other two never touch drivers/. Worth a deliberate look before the next release, since a missed fetch there produces an image with no drivers rather than a failed build.

🤖 Generated with Claude Code

drivers/*.lua leaves git and is gitignored. The files still ship --
offline recovery needs them in the image, the release tarballs carry
them, the tests read them -- but they are fetched from the commit
pinned in drivers/BUNDLED_SOURCE.json rather than committed here.

The point is not the bytes. It is that there is no file to open a pull
request against. Two contributors spent real effort, including thirty
minutes on an SE17K and register-by-register probing on a Pixii,
writing fixes against files that regenerate. A guard that fails the
pull request recovers the codebase but not the afternoon. Absence
teaches faster than a red check does.

Everything that needed the files in git already stopped needing them:
#708 made the fetch a build step and proved a build works from the pin
alone, #709 moved the SemVer gate onto the pins. This is the small
change those two were for.

--check changes its question. It used to compare committed bytes
against the pin; there are no committed bytes now, so it asks whether
any driver is committed at all. Cheaper than a content diff, a stricter
rule, and it needs no network.

Every workflow that reads drivers/ fetches first: core, drivers and
e2e in test.yml, the image build in beta.yml, and both the tarball and
image jobs in release-assets.yml. e2e, release and
driver-repository-validate depend on drivers-present locally, so a
missing fetch fails with the remedy rather than a confusing
file-not-found.

Verified: rm -rf the drivers, make drivers restores 37 of 37, go test
./... passes uncached, and the full-stack e2e is green. The guard is
proven to fire -- git add -f on one driver and --check reports it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg merged commit a1acf67 into master Jul 29, 2026
13 checks passed
@frahlg
frahlg deleted the ftw-holds-no-driver-source branch July 29, 2026 06:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf3c1d4cc3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md
Comment on lines +52 to +54
```bash
make drivers
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fetch bundled drivers in make dev

On a fresh clone, the documented local-development sequence still goes directly from git clone to make dev, but that target has neither a drivers nor drivers-present prerequisite. Because config.local.example.yaml references drivers/ferroamp.lua and drivers/sungrow.lua, both files are absent after this change and the simulator drivers cannot load, leaving the advertised development stack without telemetry; wire this fetch or at least the presence guard into make dev.

AGENTS.md reference: AGENTS.md:L89-L95

Useful? React with 👍 / 👎.

Comment on lines +77 to +78
echo "no driver source is committed here (drivers/ is fetched from the pin)"
exit 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove ignored drivers that are no longer pinned

When a driver is later removed from BUNDLED_SOURCE.json, an already-populated checkout retains its ignored .lua file: the normal fetch only copies listed drivers, while this new --check path exits before the existing unlisted-file scan. Git cannot report the stale ignored file, and drivers-present accepts any single Lua file, so make release can archive and ship a driver that was explicitly removed from the recovery set; the fetch should delete unlisted files or release validation should compare the complete directory with the pin.

AGENTS.md reference: AGENTS.md:L12-L15

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant