Skip to content

Commit 06ee8b0

Browse files
authored
[LEP-4968] fix(release): support Ubuntu 26.04 install artifact fallback (#1243)
Signed-off-by: Gyuho Lee <gyuhol@nvidia.com>
1 parent 7facedb commit 06ee8b0

3 files changed

Lines changed: 44 additions & 3 deletions

File tree

install.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,31 @@ main() {
144144
fi
145145

146146
if [ "$OS_NAME" = "ubuntu" ]; then
147+
# Ubuntu artifact compatibility:
148+
# GPUd uses github.com/mattn/go-sqlite3 with CGO enabled, but does not build
149+
# with the "libsqlite3" build tag. That means go-sqlite3 compiles its bundled
150+
# SQLite amalgamation into the gpud binary instead of dynamically linking
151+
# against Ubuntu's /usr/lib/.../libsqlite3.so. The distro-specific runtime
152+
# compatibility risk is therefore the C runtime ABI, not the host SQLite
153+
# package version.
154+
#
155+
# glibc preserves runtime backward compatibility for older linked symbols:
156+
# a binary built against an older glibc baseline can run on newer Ubuntu
157+
# releases, while the reverse is not guaranteed. The Ubuntu 24.04 artifact
158+
# is safe for Ubuntu 26.04 because it does not require Ubuntu 26.04-only
159+
# glibc symbols or any Ubuntu-provided SQLite shared library. Keep 22.04 on
160+
# its own artifact, and map newer supported LTS releases to the newest
161+
# existing Ubuntu artifact until we intentionally raise the glibc baseline or
162+
# add a real distro-specific dynamic dependency.
147163
case "$OS_VERSION" in
148-
22.04|24.04)
164+
22.04)
149165
OS_DISTRO="_${OS_NAME}${OS_VERSION}"
150166
;;
167+
24.04|26.04)
168+
OS_DISTRO="_${OS_NAME}24.04"
169+
;;
151170
*)
152-
echo "GPUd $APP_VERSION supports Ubuntu 22.04 and 24.04. Current version $OS_VERSION is not supported."
171+
echo "GPUd $APP_VERSION supports Ubuntu 22.04, 24.04, and 26.04. Current version $OS_VERSION is not supported."
153172
exit 1
154173
;;
155174
esac

pkg/update/mock_system_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,24 @@ func TestDetectUbuntuVersion_Ubuntu2404(t *testing.T) {
4848
})
4949
}
5050

51+
// TestDetectUbuntuVersion_Ubuntu2604UsesUbuntu2404Artifact tests Ubuntu 26.04
52+
// detection intentionally reuses the Ubuntu 24.04 artifact.
53+
func TestDetectUbuntuVersion_Ubuntu2604UsesUbuntu2404Artifact(t *testing.T) {
54+
mockey.PatchConvey("detect ubuntu 26.04", t, func() {
55+
cmdCallCount := 0
56+
mockey.Mock((*exec.Cmd).Output).To(func(cmd *exec.Cmd) ([]byte, error) {
57+
cmdCallCount++
58+
if cmdCallCount == 1 {
59+
return []byte("Ubuntu\n"), nil
60+
}
61+
return []byte("26.04\n"), nil
62+
}).Build()
63+
64+
result := detectUbuntuVersion()
65+
assert.Equal(t, "ubuntu24.04", result)
66+
})
67+
}
68+
5169
// TestDetectUbuntuVersion_NotUbuntu tests when OS is not Ubuntu.
5270
func TestDetectUbuntuVersion_NotUbuntu(t *testing.T) {
5371
mockey.PatchConvey("not ubuntu", t, func() {

pkg/update/system.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ func detectUbuntuVersion() string {
2323
return ""
2424
}
2525
version := strings.TrimSpace(string(outputBytes))
26-
if version == "22.04" || version == "24.04" {
26+
if version == "22.04" {
2727
return "ubuntu" + version
2828
}
29+
if version == "24.04" || version == "26.04" {
30+
// Keep self-update artifact selection aligned with install.sh.
31+
return "ubuntu24.04"
32+
}
2933
return ""
3034
}
3135

0 commit comments

Comments
 (0)