mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-21 20:22:41 +09:00
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-_<arch>.qpkg while we returned (and put in the manifest) Tailscale_1.105.265-1_<arch>.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 <gabriel@tailscale.com>
This commit is contained in:
1 parent
54c4153604
commit
f3bc40b679
2 files changed
+6
-7
No files matched your search
+1
-1
@@ -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
|
||||
Vendored
+5
-6
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user