doc: Explain how to update the gvisor go module

The repo URL is non obvious, and one has to know the `go` branch must be
used or compilation will fail.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Christophe Fergeau
2026-01-06 18:38:59 +01:00
parent ca697ac104
commit b8a20bdc2f
+33
View File
@@ -18,3 +18,36 @@ packit will automatically create fedora PRs to update gvisor-tap-vsock in the
misc fedora releases. These pull requests need to be approved. After the PRs
are approved, packit will create the corresponding updates in bodhi:
https://bodhi.fedoraproject.org/updates/?packages=gvisor-tap-vsock
## Updating the gvisor.dev/gvisor go module
The upstream repository is hosted at https://github.com/google/gvisor
However neither the `main` branch nor the `release-xxxx` tags can be directly used with gvisor-tap-vsock as they expect to be built with the bazel build system.
If you try to use them, you will get compilation errors because some generated files are missing:
```
$ go get gvisor.dev/gvisor@release-20251215.0
$ go mod tidy
$ go mod vendor
$ make
go build -ldflags "-s -w -X github.com/containers/gvisor-tap-vsock/pkg/types.gitVersion=v0.8.7-78-g742b82bb-dirty" -o bin/gvproxy ./cmd/gvproxy
# gvisor.dev/gvisor/pkg/bits
vendor/gvisor.dev/gvisor/pkg/bits/uint64_arch.go:35:9: undefined: MaskOf64
# gvisor.dev/gvisor/pkg/waiter
vendor/gvisor.dev/gvisor/pkg/waiter/waiter.go:140:2: undefined: waiterEntry
vendor/gvisor.dev/gvisor/pkg/waiter/waiter.go:211:7: undefined: waiterList
make: *** [Makefile:16: gvproxy] Error 1
```
Theres a [`go`](https://github.com/google/gvisor/tree/go) branch with the required generated files, see [this link](https://github.com/google/gvisor?tab=readme-ov-file#using-go-get) for more details.
You want a commit of the form: `2214e5a4d Merge release-20251215.0-20-g28c24757e (automated)`:
```
$ go get gvisor.dev/gvisor@2214e5a4d
$ go mod tidy
$ go mod vendor
$ make
go build -ldflags "-s -w -X github.com/containers/gvisor-tap-vsock/pkg/types.gitVersion=v0.8.7-79-gb594f2e7" -o bin/gvproxy ./cmd/gvproxy
go build -ldflags "-s -w -X github.com/containers/gvisor-tap-vsock/pkg/types.gitVersion=v0.8.7-79-gb594f2e7" -o bin/qemu-wrapper ./cmd/qemu-wrapper
GOOS=linux CGO_ENABLED=0 go build -ldflags "-s -w -X github.com/containers/gvisor-tap-vsock/pkg/types.gitVersion=v0.8.7-79-gb594f2e7" -o bin/gvforwarder ./cmd/vm
$
```