Documentation
¶
Overview ¶
Command consolebuild builds the operator console, the NSGo web app in pkg/online/admin/console/internal/web, and writes the files the console package embeds to pkg/online/admin/console/dist: the site nsgo build -target web writes, with its WebAssembly module kept only gzipped. It also writes pkg/online/admin/console/dist.inputs, the inputs the build was made from: the Go version, the version of every module the app links, and a hash of every file but tests in the directories of the repository's packages it links and under the app's directory; and then the build itself, the SHA-256 of every file it wrote to dist. With -check it builds nothing and fails when the sources' inputs differ from dist.inputs, or when dist is not the build dist.inputs records: a file missing (the page, the gzipped WebAssembly module or any other), one more, or one whose bytes differ. CI runs the check.
The check compares inputs rather than rebuilding and comparing bytes because an NSGo web build is not the same on every host: the license notices it links name the Go standard library's license files by paths that follow the GOROOT layout (a Homebrew Go adds libexec/), and the notices file's name in the module differs between hosts.
Run it through go generate ./pkg/online/admin/console or go run ./pkg/online/admin/console/internal/consolebuild [-check], from anywhere in the repository. The build runs with GOFLAGS cleared, so a GOFLAGS of the caller's (such as -gcflags) cannot change the module's bytes.