From f3bc40b6799dabec4743e0e9c4907ddabfae44f2 Mon Sep 17 00:00:00 2001 From: Gabriel von Winckler Date: Tue, 17 Nov 2026 14:31:35 +0000 Subject: [PATCH] release/dist/qnap: drop the static package tag from QPKG_VER (#22381) QDK's qbuild truncates QPKG_VER to 10 characters, so versions like 1.105.265-1 produced Tailscale_1.105.265-_.qpkg while we returned (and put in the manifest) Tailscale_1.105.265-1_.qpkg. The "-1" tag was never bumped, so drop it and use the version alone. Fail the build if the version itself exceeds 10 characters rather than silently producing a mismatched filename. Built qnap/x86_64 unsigned at 1.105.280: the file on disk and the manifest both name Tailscale_1.105.280_x86_64.qpkg, and the qpkg header version is 1.105.280. The length guard and signed builds were not exercised. Updates tailscale/corp#51480 Signed-off-by: Gabriel von Winckler --- release/dist/qnap/files/scripts/build-qpkg.sh | 2 +- release/dist/qnap/pkgs.go | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/release/dist/qnap/files/scripts/build-qpkg.sh b/release/dist/qnap/files/scripts/build-qpkg.sh index 61786ead8..eead5999c 100755 --- a/release/dist/qnap/files/scripts/build-qpkg.sh +++ b/release/dist/qnap/files/scripts/build-qpkg.sh @@ -14,6 +14,6 @@ mkdir -p /Tailscale/$ARCH cp /tailscaled /Tailscale/$ARCH/tailscaled cp /tailscale /Tailscale/$ARCH/tailscale -sed "s/\$QPKG_VER/$TSTAG-$QNAPTAG/g" /Tailscale/qpkg.cfg.in >/Tailscale/qpkg.cfg +sed "s/\$QPKG_VER/$TSTAG/g" /Tailscale/qpkg.cfg.in >/Tailscale/qpkg.cfg qbuild --root /Tailscale --build-arch $ARCH --build-dir /out diff --git a/release/dist/qnap/pkgs.go b/release/dist/qnap/pkgs.go index b505b1ac0..b02af7d73 100644 --- a/release/dist/qnap/pkgs.go +++ b/release/dist/qnap/pkgs.go @@ -54,11 +54,11 @@ func (t *target) Build(b *dist.Build) ([]string, error) { return t.buildQPKG(b, qnapBuilds, inner) } -const ( - qnapTag = "1" // currently static, we don't seem to bump this -) - func (t *target) buildQPKG(b *dist.Build, qnapBuilds *qnapBuilds, inner *innerPkg) ([]string, error) { + // qbuild truncates QPKG_VER to 10 characters (the qpkg header's version field). + if len(b.Version.Short) > 10 { + return nil, fmt.Errorf("version %q is longer than the 10 characters QDK allows for QPKG_VER", b.Version.Short) + } if _, err := exec.LookPath("docker"); err != nil { return nil, fmt.Errorf("docker not found, cannot build: %w", err) } @@ -67,14 +67,13 @@ func (t *target) buildQPKG(b *dist.Build, qnapBuilds *qnapBuilds, inner *innerPk return nil, fmt.Errorf("makeDockerImage: %w", err) } - filename := fmt.Sprintf("Tailscale_%s-%s_%s.qpkg", b.Version.Short, qnapTag, t.arch) + filename := fmt.Sprintf("Tailscale_%s_%s.qpkg", b.Version.Short, t.arch) filePath := filepath.Join(b.Out, filename) args := []string{"run", "--rm", "--network=host", "-e", fmt.Sprintf("ARCH=%s", t.arch), "-e", fmt.Sprintf("TSTAG=%s", b.Version.Short), - "-e", fmt.Sprintf("QNAPTAG=%s", qnapTag), "-v", fmt.Sprintf("%s:/tailscale", inner.tailscalePath), "-v", fmt.Sprintf("%s:/tailscaled", inner.tailscaledPath), // Tailscale folder has QNAP package setup files needed for building.