From e292abd9ab94030c55cc190be638efa881e92c4b Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 20 Jan 2026 15:32:47 +0100 Subject: [PATCH 1/3] Allow GOLANG_VERSION to be overridden Signed-off-by: Evan Lezar --- mk/docker.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/docker.mk b/mk/docker.mk index 8058af8a..e25bb986 100644 --- a/mk/docker.mk +++ b/mk/docker.mk @@ -14,7 +14,7 @@ # # Version of golang to use in docker specific builds. -GOLANG_VERSION := 1.17.1 +GOLANG_VERSION ?= 1.17.1 # Global definitions. These are defined here to allow the docker targets to be # invoked directly without the root makefile. From d1f7d85a92260021297d2746611658de75b152e2 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 20 Jan 2026 15:33:50 +0100 Subject: [PATCH 2/3] Bump Go to 1.25.6 Signed-off-by: Evan Lezar --- .dockerignore | 2 +- mk/docker.mk | 2 +- src/nvcgo/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 7db6cb6a..cf8c8cc3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,2 @@ /dist -/.git/objects +.git diff --git a/mk/docker.mk b/mk/docker.mk index e25bb986..1e903df2 100644 --- a/mk/docker.mk +++ b/mk/docker.mk @@ -14,7 +14,7 @@ # # Version of golang to use in docker specific builds. -GOLANG_VERSION ?= 1.17.1 +GOLANG_VERSION ?= 1.25.6 # Global definitions. These are defined here to allow the docker targets to be # invoked directly without the root makefile. diff --git a/src/nvcgo/Makefile b/src/nvcgo/Makefile index 7276e29b..d2e36673 100644 --- a/src/nvcgo/Makefile +++ b/src/nvcgo/Makefile @@ -39,7 +39,7 @@ build: $(OBJ_NAME) $(OBJ_NAME): $(wildcard $(CURDIR)/*.go) $(wildcard */*.go) export CGO_CFLAGS="$(CGO_CFLAGS)"; \ export CGO_LDFLAGS="$(CGO_LDFLAGS)"; \ - $(GO) build -o $(@) -ldflags "-s -w" -buildmode=c-shared . + $(GO) build -buildvcs=false -o $(@) -ldflags "-s -w" -buildmode=c-shared . install: $(OBJ_NAME) $(INSTALL) -d -m 755 $(addprefix $(DESTDIR),$(libdir) $(includedir)/$(PKG_NAME)) From c7a5eb685dbb61c19997e6c0ba3f85411f65d2db Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 20 Jan 2026 19:33:26 +0100 Subject: [PATCH 3/3] Add tooling to auto-bump golang version Signed-off-by: Evan Lezar --- .github/dependabot.yml | 49 ++++++++++++++++++++++++++++++++++++ deployments/devel/Dockerfile | 17 +++++++++++++ hack/golang-version.sh | 22 ++++++++++++++++ mk/docker.mk | 2 +- 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 deployments/devel/Dockerfile create mode 100755 hack/golang-version.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 460e1a8c..432d917e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,55 @@ updates: labels: - dependencies + - package-ecosystem: "docker" + target-branch: main + directories: + # Golang version + - "/deployments/devel" + schedule: + interval: "daily" + labels: + - dependencies + +# The release branch(es): + - package-ecosystem: "gomod" + target-branch: release-1.18 + directories: + - "/" + # We don't update development or test dependencies on release branches + # - "deployments/devel" + # - "tests" + schedule: + interval: "weekly" + day: "sunday" + labels: + - dependencies + - maintenance + ignore: + # For release branches we only consider patch updates. + - dependency-name: "*" + update-types: + - version-update:semver-major + - version-update:semver-minor + + - package-ecosystem: "docker" + target-branch: release-1.18 + directories: + # Golang version + - "/deployments/devel" + schedule: + interval: "weekly" + day: "sunday" + ignore: + # For release branches we only apply patch updates to the golang version. + - dependency-name: "*golang*" + update-types: + - version-update:semver-major + - version-update:semver-minor + labels: + - dependencies + - maintenance + - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/deployments/devel/Dockerfile b/deployments/devel/Dockerfile new file mode 100644 index 00000000..6ff53fde --- /dev/null +++ b/deployments/devel/Dockerfile @@ -0,0 +1,17 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This Dockerfile is also used to define the golang version used in this project +# This allows dependabot to manage this version in addition to other images. +FROM golang:1.25.6 diff --git a/hack/golang-version.sh b/hack/golang-version.sh new file mode 100755 index 00000000..81685cc7 --- /dev/null +++ b/hack/golang-version.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Copyright 2024 NVIDIA CORPORATION +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../hack && pwd )" + +DOCKERFILE_ROOT=${SCRIPTS_DIR}/../deployments/devel + +GOLANG_VERSION=$(grep -E "^FROM golang:.*$" ${DOCKERFILE_ROOT}/Dockerfile | grep -oE "[0-9\.]+") + +echo $GOLANG_VERSION diff --git a/mk/docker.mk b/mk/docker.mk index 1e903df2..2898ea04 100644 --- a/mk/docker.mk +++ b/mk/docker.mk @@ -14,7 +14,7 @@ # # Version of golang to use in docker specific builds. -GOLANG_VERSION ?= 1.25.6 +GOLANG_VERSION ?= $(shell ./hack/golang-version.sh) # Global definitions. These are defined here to allow the docker targets to be # invoked directly without the root makefile.