Skip to content

Add a novision build tag so the server can be built and tested off-device - #846

Open
yuzi-co wants to merge 1 commit into
sipeed:mainfrom
yuzi-co:build/novision-tag
Open

Add a novision build tag so the server can be built and tested off-device#846
yuzi-co wants to merge 1 commit into
sipeed:mainfrom
yuzi-co:build/novision-tag

Conversation

@yuzi-co

@yuzi-co yuzi-co commented Aug 1, 2026

Copy link
Copy Markdown

common/kvm_vision.go links against libkvm through cgo, so any package that reaches it can only be built with the cross-compiler and the device libraries present. That is most of the server, which means none of it can be type checked or tested on a workstation or in CI.

This adds a novision tag that swaps that one file for a pure Go stub with the same surface:

go vet -tags novision ./...
go test -tags novision ./...
go build -tags novision ./...

The device build is untouched. Without the tag the real bindings are used exactly as before, and common/kvm_vision.go only gains a //go:build !novision line.

I opened this first because several other fixes I am proposing come with tests, and without something like this there is no way to run them anywhere but on hardware.

One thing worth knowing

With the tag in place the existing suite runs, and it is not quite green under load. service/controlmode and service/picoclaw have tests with one-second timing budgets that fail when the whole suite runs in parallel on a slow filesystem, and pass consistently when run alone:

go test -tags novision -count=1 ./service/controlmode/   ok (3/3 runs)
go test -tags novision -count=1 ./service/picoclaw/      ok (2/2 runs)
go test -tags novision -count=1 -p 1 ./...               intermittent

Those are pre-existing and nothing to do with this change, but if you wire this into CI you will meet them. -p 1 makes it reliable in my testing.

Verified: go build, go vet, and GOOS=linux GOARCH=riscv64 go build all clean with and without the tag.

common/kvm_vision.go links against libkvm through cgo, so any package that
reaches it can only be built on the cross-compiler with the device libraries
present. That is most of the server, which means none of it can be type
checked or tested on a workstation or in CI.

The novision tag swaps that file for a pure Go stub with the same surface, so
the tree builds and the tests run anywhere:

    go vet -tags novision ./...
    go test -tags novision ./...

The device build is unchanged: without the tag the real bindings are used
exactly as before.
@yuzi-co
yuzi-co force-pushed the build/novision-tag branch from f2e305c to b82cea5 Compare August 13, 2026 17:47
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