mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 05:15:49 +03:00
[GH-ISSUE #263] Version string missing in binary since v0.5.1+ (ldflags regression) #160
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#160
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @leodurandfr on GitHub (Nov 30, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/263
Description
Starting from version 0.5.1 (or later), the released binaries no longer contain the semantic version string. Instead, only the git commit hash is embedded.
Expected behavior
$ go-librespot
level=info msg="running go-librespot 0.5.3"
Actual behavior
$ go-librespot
level=info msg="running go-librespot
ab178ffd"Root cause
The Dockerfile.build ldflags changed between versions:
v0.5.0 (working):
-ldflags="-X github.com/devgianlu/go-librespot.commit=${COMMIT} -X github.com/devgianlu/go-librespot.version=${VERSION}"
v0.5.3 (current):
-ldflags "-s -w"
The -X flags that inject the version and commit variables are no longer present.
Impact
Suggested fix
Restore the ldflags in Dockerfile.build:
-ldflags="-s -w -X github.com/devgianlu/go-librespot.commit=${COMMIT} -X github.com/devgianlu/go-librespot.version=${VERSION}"