Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#73889 - spirv-headers versioning is broken

Attached to Project: Community Packages
Opened by Alex Wood (ajw107) - Saturday, 19 February 2022, 16:57 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Friday, 04 March 2022, 22:37 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Bruno Pagani (ArchangeGabriel)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Package: spirv-headers
Due to bad versioning code different package managers would get confused (e.g. spirv-headers 1.5.4.raytracing.fixed-1 is lexicographically the highest version, but spirv-headers 1.5.4.r106+ge71fedd-1 was the lastest). This can result in the package being upgraded and downgraded if you switch between package managers.
This is caused by pkgver() being set to the github tag, which was not the full version. The main version is stored in CMakeList.txt, so this should be added to the start of the verion from github to create the full version.

Also the sed commands to sanitise the version numbers are not correct, they do not remove all '-' or any '/'

Additional info:
* package version(s)
If the package continues to use the github tags, you get the following version (in order from oldest to newest):
- 1.5.4.raytracing.fixed-1
- 1.5.4.r106+ge71fedd-1 (as this is a random commit version)
- sdk- (this will look like a downgrade, but is an upgrade)
- sdk-
- sdk- (latest commit, as of 19/02/2022)

Adding the version number from CMakeList.txt at the start of this would mean we would have parsable version numbers again:
- 1.5.5.sdk-
- 1.5.5.sdk-
- 1.5.5.sdk-

* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
- Update/install spirv-headers in pacman/pamac/yay/paru/etc (updates to 1.5.4.r106+ge71fedd-1)
- Open Discover, states an update is available to 1.5.4.raytracing.fixed-1 (the previous version)

I am unable to attach a PKGBUILD with code in to correct this, so here is the diff (Note this also updates the package to the latest commit):

--- spirv-headers/PKGBUILD 2021-10-23 09:24:10.000000000 +0100
+++ spirv-headers_PKGBUILD 2022-02-19 16:53:51.649914363 +0000
@@ -3,8 +3,8 @@

pkgdesc="SPIR-V Headers"
@@ -13,13 +13,15 @@
# From either
# or
# using whatever is newest for latest release

pkgver() {
cd ${_pkg}
- git describe --tags --exclude '*raytracing*' | sed 's/\([^-]*-g\)/r\1/;s/-/./;s/-/+/'
+ _full_ver="$(grep "SPIRV-Headers VERSION" CMakeLists.txt | awk '{print $3}' | tr --delete '()')"
+ _sub_ver="$(git describe --tags --exclude '*raytracing*' | sed 's/\([^-]*-g\)/r\1/')"
+ echo "${_full_ver}.${_sub_ver}" | sed 's/-/./g;s/-/+/g;s|/|_|g'

build() {
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Friday, 04 March 2022, 22:37 GMT
Reason for closing:  Fixed
Additional comments about closing:  I’ve actually switched to sdk versionning and added an epoch for the switch.
Comment by Alex Wood (ajw107) - Saturday, 19 February 2022, 16:59 GMT
Just seeing if I can attack the updated PKGBUILD now
Comment by Alex Wood (ajw107) - Sunday, 20 February 2022, 00:56 GMT
Sorry, refreshed page and accidently resent form