libnvidia-container: update to 1.17.5.

This commit is contained in:
JkktBkkt 2025-04-17 05:17:14 +03:00 committed by classabbyamp
parent 0cfa248f03
commit f530d0a43f
2 changed files with 49 additions and 3 deletions

View File

@ -0,0 +1,46 @@
From 1c680195fdc85948d635286b72a6ad9f823b5987 Mon Sep 17 00:00:00 2001
From: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
Date: Thu, 13 Feb 2025 10:18:59 +0100
Subject: [PATCH] Fix building with Go 1.24
Go 1.24 does not allow defining methods on C types anymore, so make convert a function, not a method.
Fixes the following error when building with Go 1.24:
`./main.go:35:10: cannot define new methods on non-local type CDeviceRule`
Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
---
src/nvcgo/main.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/nvcgo/main.go b/src/nvcgo/main.go
index 1523a06d..ed43be8e 100644
--- a/src/nvcgo/main.go
+++ b/src/nvcgo/main.go
@@ -32,7 +32,7 @@ func main() {}
type CDeviceRule = C.struct_device_rule
// Convert a C-based DeviceRule to a Go-based cgroup.DeviceRule
-func (r *CDeviceRule) convert() cgroup.DeviceRule {
+func convert(r *CDeviceRule) cgroup.DeviceRule {
return cgroup.DeviceRule{
Allow: bool(r.allow),
Type: C.GoString(r._type),
@@ -67,7 +67,7 @@ func GetDeviceCGroupMountPath(version C.int, procRootPath *C.char, pid C.pid_t,
return -1
}
*cgroupMountPath = C.CString(p)
- *cgroupRootPrefix= C.CString(r)
+ *cgroupRootPrefix = C.CString(r)
return 0
}
@@ -100,7 +100,7 @@ func AddDeviceRules(version C.int, cgroupPath *C.char, crules []CDeviceRule, rer
rules := make([]cgroup.DeviceRule, len(crules))
for i, cr := range crules {
- rules[i] = cr.convert()
+ rules[i] = convert(&cr)
}
err = api.AddDeviceRules(C.GoString(cgroupPath), rules)

View File

@ -1,7 +1,7 @@
# Template file for 'libnvidia-container' # Template file for 'libnvidia-container'
pkgname=libnvidia-container pkgname=libnvidia-container
version=1.16.1 version=1.17.5
revision=2 revision=1
archs="x86_64" archs="x86_64"
hostmakedepends="tar xz curl bmake groff m4 pkg-config which go" hostmakedepends="tar xz curl bmake groff m4 pkg-config which go"
makedepends="rpcsvc-proto libcap-devel libseccomp-devel libtirpc-devel" makedepends="rpcsvc-proto libcap-devel libseccomp-devel libtirpc-devel"
@ -10,7 +10,7 @@ maintainer="Quentin Freimanis <quentinfreimanis@gmail.com>"
license="Apache-2.0" license="Apache-2.0"
homepage="https://github.com/NVIDIA/libnvidia-container" homepage="https://github.com/NVIDIA/libnvidia-container"
distfiles="https://github.com/NVIDIA/libnvidia-container/archive/v${version}.tar.gz" distfiles="https://github.com/NVIDIA/libnvidia-container/archive/v${version}.tar.gz"
checksum=cbc1dda7ee90b8b729c5f178292cd07b421863015d84b84c37e69c8d580ab3ff checksum=50903ef115908fe50ed199a4ae05d4e94bba7ab4ac8300ad46345ea8ee0149ba
do_build() { do_build() {
make dist prefix=/usr REVISION=${version} LIB_VERSION=${version} make dist prefix=/usr REVISION=${version} LIB_VERSION=${version}