From ce0617eac49a82346ade58414e99d7f4c84bbc1f Mon Sep 17 00:00:00 2001 From: Yevhen Vydolob Date: Wed, 26 Mar 2025 14:47:04 +0200 Subject: [PATCH] Use gvisor-tap-vsock version from go.mod file Instead of hardcoding gvisor version in different build files, we get gvisor version from go.mod file. Signed-off-by: Yevhen Vydolob --- Makefile | 8 ++++---- contrib/pkginstaller/Makefile | 2 +- winmake.ps1 | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index edc140b6d3..77a85b5261 100644 --- a/Makefile +++ b/Makefile @@ -218,7 +218,7 @@ endif # gvisor-tap-vsock version for gvproxy.exe and win-sshproxy.exe downloads # the upstream project ships pre-built binaries since version 0.7.1 -GV_VERSION=v0.8.4 +GVPROXY_VERSION=$(shell grep github.com/containers/gvisor-tap-vsock go.mod | cut -d" " -f2) ### ### Primary entry-point targets @@ -861,12 +861,12 @@ podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$ if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then $(MAKE) clean-binaries; fi -rm -rf "$(tmpsubdir)" -# Downloads pre-built gvproxy and win-sshproxy helpers. See comment on GV_VERSION declaration +# Downloads pre-built gvproxy and win-sshproxy helpers. See comment on GVPROXY_VERSION declaration .PHONY: win-gvproxy win-gvproxy: test/version/version mkdir -p bin/windows/ - curl -sSL -o bin/windows/gvproxy.exe --retry 5 https://github.com/containers/gvisor-tap-vsock/releases/download/$(GV_VERSION)/gvproxy-windowsgui.exe - curl -sSL -o bin/windows/win-sshproxy.exe --retry 5 https://github.com/containers/gvisor-tap-vsock/releases/download/$(GV_VERSION)/win-sshproxy.exe + curl -sSL -o bin/windows/gvproxy.exe --retry 5 https://github.com/containers/gvisor-tap-vsock/releases/download/$(GVPROXY_VERSION)/gvproxy-windowsgui.exe + curl -sSL -o bin/windows/win-sshproxy.exe --retry 5 https://github.com/containers/gvisor-tap-vsock/releases/download/$(GVPROXY_VERSION)/win-sshproxy.exe .PHONY: rpm rpm: ## Build rpm packages diff --git a/contrib/pkginstaller/Makefile b/contrib/pkginstaller/Makefile index 3d886586d5..b65efd88ce 100644 --- a/contrib/pkginstaller/Makefile +++ b/contrib/pkginstaller/Makefile @@ -6,7 +6,7 @@ ifeq ($(ARCH), aarch64) else GOARCH:=$(ARCH) endif -GVPROXY_VERSION ?= 0.8.4 +GVPROXY_VERSION ?= $(shell grep github.com/containers/gvisor-tap-vsock ../../go.mod | cut -d" " -f2) VFKIT_VERSION ?= 0.6.1 KRUNKIT_VERSION ?= 0.2.0 GVPROXY_RELEASE_URL ?= https://github.com/containers/gvisor-tap-vsock/releases/download/v$(GVPROXY_VERSION)/gvproxy-darwin diff --git a/winmake.ps1 b/winmake.ps1 index 24323360d8..267d89315e 100644 --- a/winmake.ps1 +++ b/winmake.ps1 @@ -72,7 +72,8 @@ function Win-SSHProxy { New-Item -ItemType Directory -Force -Path "./bin/windows" if (-Not $Version) { - $Version = "v0.8.4" + $match = Select-String -Path "$PSScriptRoot\go.mod" -Pattern "github.com/containers/gvisor-tap-vsock\s+(v[\d\.]+)" + $Version = $match.Matches.Groups[1].Value } curl.exe -sSL -o "./bin/windows/gvproxy.exe" --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/gvproxy-windowsgui.exe" curl.exe -sSL -o "./bin/windows/win-sshproxy.exe" --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/win-sshproxy.exe"