Before this commit, we held onto *cobra.Command objects,
but that is not actually supported: after the first Execute(),
commands like updateCmd are stuck on the first-ever provided ctx.
Instead, turn command initialization into functions.
I only noticed this when trying to do two 'gok update'
from within the same test, where the fake build timestamp
is injected via the context (the timestamp was always the same).
Before this commit, the mere presence of files with certain names in local
package directories would make the build fail (see nonmodulefiles_test.go).
With this commit, we now record the buildinfo and buildid of all built Go
programs of this gokrazy instance.
related to https://github.com/gokrazy/gokrazy/issues/297
fixes https://github.com/gokrazy/gokrazy/issues/299
For gok vm run, this means an explicit -arch=amd64 or -arch=arm64
might become necessary. In general, I recommend configuring
GOOS and GOARCH in config.json explicitly:
{
"Hostname": "repro",
"Environment": [
"GOOS=linux",
"GOARCH=amd64"
],
[…]
related to https://github.com/gokrazy/gokrazy/issues/191