11 Commits

Author SHA1 Message Date
Michael Stapelberg
52cab9f145 packer: stop using updateflag global state
related to https://github.com/gokrazy/tools/pull/68
2025-12-06 08:37:24 +01:00
Michael Stapelberg
2c805ed001 refactor cobra command initialization to avoid stale state
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).
2025-11-29 10:47:48 +01:00
Michael Stapelberg
9a9519186b integration: add 'gok update' test
Some checks failed
gokrazy CI / CI (macos-latest) (push) Has been cancelled
gokrazy CI / CI (ubuntu-latest) (push) Has been cancelled
gokrazy CI / CI (windows-latest) (push) Has been cancelled
2025-10-03 19:12:17 +02:00
Michael Stapelberg
f606b3de4f gok sbom: buffer build output and only print (to stderr!) on error
fixes https://github.com/gokrazy/tools/issues/91
2025-05-29 15:26:31 +02:00
Michael Stapelberg
703a860502 sbom: do not hash source files, record buildid of binaries instead
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
2025-02-21 18:51:16 +01:00
Michael Stapelberg
5f4d95c2d4 gok: apply Environment from config.json
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
2025-01-26 22:43:19 +01:00
Michael Stapelberg
a2dd9b9a09 sbom: move os.Chdir into 'gok sbom' (but not gokr-packer)
fixes #51
2024-09-09 17:20:07 +02:00
Damiano Donati
1c3069c7e6 fix sbom generation inconsistency, take 2 (#66) 2023-10-25 08:39:46 +02:00
Michael Stapelberg
2b269a6d8d correctly plumb through config struct to GenerateSBOM 2023-02-05 21:43:49 +01:00
Damiano Donati
db4f55e31a gok sbom: prefactor mv GenerateSBOM to internal/packer 2023-02-05 13:51:32 +01:00
Michael Stapelberg
ca01203cad gok: add sbom subcommand 2023-01-29 21:55:42 +01:00