fix(nightly): make .deb/.rpm Version dpkg-valid (digit-leading short commit)#672
Merged
Conversation
The nightly packages set their Debian/RPM Version field to the bare short
commit (version_template: {{ .ShortCommit }}). dpkg requires the Version to
start with a digit, so any nightly whose short SHA starts with a-f (~6/16 of
commits) produces a .deb that fails to install:
dpkg: error processing archive ... 'Version' field value 'dd44277c':
version number does not start with digit
On the VPS fleet this aborts cloud-init's package install, so http-proxy
never comes up, the route never reaches running, and provisioning retries
forever. It only worked until now by luck (previous tags happened to start
with a digit, e.g. 7f088dc).
Fix: prefix a digit-leading stub in the Version (0.0.0+<shortcommit>) and pin
the nfpm file_name_template to keep the short commit in the asset name, so the
published asset stays http-proxy-lantern_<shortcommit>_linux_<arch>.deb — the
exact name the VPS cloud-init builds its download URL from. No change needed
in lantern-cloud or the bandit_vps_http_proxy_default_short_tag workflow.
goreleaser check passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Nightly
.deb/.rpmpackages set their Version field to the bare short commit (.goreleaser.yaml:version_template: "{{ .ShortCommit }}"). Debian/RPM require the Version to start with a digit, so any nightly whose short SHA starts witha–f(~6/16 of commits) produces a package dpkg refuses to install:On the bandit VPS fleet this aborts cloud-init's package-install step (
cc_scripts_user … Runparts: 1 failures), so http-proxy never installs, the route never reachesrunning/gets a public address, and the provisioner retries the box forever. It went unnoticed because previous nightly tags happened to start with a digit (e.g.7f088dcf); pointing the fleet atdd44277csurfaced it and stalled all new http-proxy provisions.Fix
version_template: "0.0.0+{{ .ShortCommit }}"— digit-leading, valid for both dpkg and rpm (0.0.0+dd44277c).nfpms.file_name_templatetohttp-proxy-lantern_{{ .ShortCommit }}_linux_{{ .Arch }}so the published asset name is unchanged (http-proxy-lantern_<shortcommit>_linux_<arch>.deb). The VPS cloud-init builds its download URL frombandit_vps_http_proxy_default_short_tag(alnum short commit), so decoupling the file name from the Version keeps that workflow working with no change in lantern-cloud.goreleaser checkpasses.After merge / deploy
Once a nightly is built from this fix, point the fleet at the new short commit:
lc settings update --name bandit_vps_http_proxy_default_short_tag --value '"<newshortcommit>"' --overwrite. With this change any short commit (digit- or letter-leading) installs cleanly.Related: getlantern/engineering#3630 (http-proxy hot-swap gap — separate issue). Surfaced while rolling out the keepcurrent memory fix (#671).