gvproxy: Update to 0.7.2 release

This updates the Windows installer and macOS installer to ship the newer
binaries, as well as the vendored gvisor-tap-vsock code.

[NO NEW TESTS NEEDED]

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Christophe Fergeau
2024-01-17 16:57:19 +01:00
parent e293ca8916
commit c566551e96
12 changed files with 114 additions and 99 deletions

View File

@@ -0,0 +1,64 @@
package types
import (
"flag"
"fmt"
"runtime/debug"
"strings"
)
var (
// set using the '-X github.com/containers/gvisor-tap-vsock/pkg/types.gitVersion' linker flag
gitVersion = ""
// set through .gitattributes when `git archive` is used
// see https://icinga.com/blog/2022/05/25/embedding-git-commit-information-in-go-binaries/
gitArchiveVersion = "$Format:%(describe)$"
)
type version struct {
binaryName string
showVersion bool
}
func NewVersion(binaryName string) *version { //nolint:revive
return &version{
binaryName: binaryName,
}
}
func (ver *version) String() string {
return fmt.Sprintf("%s version %s", ver.binaryName, moduleVersion())
}
func (ver *version) AddFlag() {
flag.BoolVar(&ver.showVersion, "version", false, "Print version information")
}
func (ver *version) ShowVersion() bool {
return ver.showVersion
}
func moduleVersion() string {
switch {
// This will be substituted when building from a GitHub tarball
case !strings.HasPrefix(gitArchiveVersion, "$Format:"):
return gitArchiveVersion
// This will be set when building from git using make
case gitVersion != "":
return gitVersion
// moduleVersionFromBuildInfo() will be set when using `go install`
default:
return moduleVersionFromBuildInfo()
}
}
func moduleVersionFromBuildInfo() string {
info, ok := debug.ReadBuildInfo()
if !ok {
return ""
}
if info.Main.Version == "(devel)" {
return ""
}
return info.Main.Version
}