You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent version requirements in lib/build and lib/upgrade #9267
buildIssues caused by or requiring changes to the build system (scripts or Docker image)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
It allows v1.27.0-abc.1+xyz but not v1.27.0+xyz, thus if you built an app with that version (which is permitted by build.go) it won't start
lib/upgrade
lib/upgrade uses CompareVersions to check for upgrade and TestCompareVersions uses 1.0.0+45 as test case
versionParts (that is used inside) correctly parses both v1.27.0-abc.1+xyz and v1.27.0+xyz yielding [1, 27, 0] [abc, 1] and [1, 27, 0] respectively.
Solution
I suggest making versions in form of <version core> "+" <build> valid in lib/build because the both valid semver and already accepted by lib/upgrade and build.go
Check version argument in build.go to avoid building binaries that can't be launched anyway
I generate syncthing builds with specific configurations.
To differentiate them from vanilla builds right now I use e.g. vX.Y.Z-noupgrade which is technically incorrect semver because noupgrade is not a part of the version but rather "build meta information".
Difference is that meta is not included in version checks and pre-release part is.
buildIssues caused by or requiring changes to the build system (scripts or Docker image)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
calmh commentedon Dec 6, 2023
Wo don't generate version numbers with pluses in them as far as I know?
gudvinr commentedon Dec 6, 2023
I generate syncthing builds with specific configurations.
To differentiate them from vanilla builds right now I use e.g.
vX.Y.Z-noupgradewhich is technically incorrect semver becausenoupgradeis not a part of the version but rather "build meta information".Difference is that meta is not included in version checks and pre-release part is.
lib: Add versions from syncthing#9267 to test
lib/build: Allow semver build in version regex (fixes #9267) (#9316)
gudvinr commentedon Jan 2, 2024
@KeyWeeUsr, thanks. Much appreciated.
Merge branch 'main' into tokensdb
Merge branch 'main' into cli_completion
build.go: validate -version argument against regex from lib/build
Merge branch 'main' into integrationtests
lib/build: more spec-compliant semver regex (fixes syncthing#9267 again)
build.go: validate -version argument against regex from lib/build