mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-10-29 19:42:41 +00:00
external/virtualization-layer: fix libnvidia-container build error
Add a patch to libnvidia-container to fix build issues with go 1.24. Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
From d44307d59b60926e016b98f27aa87aadb050e4a6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matt Madison <matt@madison.systems>
|
||||||
|
Date: Sun, 9 Mar 2025 07:34:57 -0700
|
||||||
|
Subject: [PATCH] nvcgo: fix build with go 1.24
|
||||||
|
|
||||||
|
Go doesn't allow adding methods to types defined elsewhere,
|
||||||
|
leading to this error:
|
||||||
|
|
||||||
|
/main.go:35:10: cannot define new methods on non-local type CDeviceRule
|
||||||
|
|
||||||
|
Change the locally-defined method to be an ordinary function instead.
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Matt Madison <matt@madison.systems>
|
||||||
|
---
|
||||||
|
src/nvcgo/main.go | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/nvcgo/main.go b/src/nvcgo/main.go
|
||||||
|
index 1523a06d..380ebfb0 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),
|
||||||
|
@@ -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)
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@@ -45,6 +45,7 @@ SRC_URI = "git://github.com/NVIDIA/libnvidia-container.git;protocol=https;name=l
|
|||||||
git://github.com/NVIDIA/nvidia-modprobe.git;protocol=https;branch=main;name=modprobe;destsuffix=${NVIDIA_MODPROBE_SRCURI_DESTSUFFIX} \
|
git://github.com/NVIDIA/nvidia-modprobe.git;protocol=https;branch=main;name=modprobe;destsuffix=${NVIDIA_MODPROBE_SRCURI_DESTSUFFIX} \
|
||||||
file://0001-OE-cross-build-fixups.patch \
|
file://0001-OE-cross-build-fixups.patch \
|
||||||
file://0002-Expose-device-file-attrs.patch \
|
file://0002-Expose-device-file-attrs.patch \
|
||||||
|
file://0003-nvcgo-fix-build-with-go-1.24.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
# tag: v1.14.2
|
# tag: v1.14.2
|
||||||
|
|||||||
Reference in New Issue
Block a user