New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable version suffix independent of version number #5979
Conversation
What it breaks is this... Lines 245 to 259 in aa2d7f0
|
Ah yes, that is; The makefile would revert this pr's changes next time it's run. Pushed an alternative implementation, what do you think? Now any of the following will work, depending on what you want to change, assuming default is "v1.58.0-DEV":
Script editing the file, like the makefile does, is easy for VersionTag and VersionSuffix individually, but not the complete Version. |
I'm happy to merge this now, but it needs updating since we did a release, so the version number needs changing.
I'm sure its going to break something, but I can't think what!
If you rebase and update I'll merge
Thank you
Done: Rebased, and updated version number according to master.
Sure, I may have overlooked something (but then at least you get to yell "I told you" or "I knew it"... |
Thank you.
I predict that this will come to bite at release time or point release time - we shall see :-) And if it goes wrong, it will be all on me as I did the review, so no yelling! |
What is the purpose of this change?
Introduces a way to quickly set a custom pre-release label / version suffix on my own builds of rclone.
As of now master version is "v1.58.0-DEV". I can override this easily with something like
-ldflags "-X github.com/rclone/rclone/fs.Version=v9.9.9-CUSTOM"
, but then I loose the version number it was based on. It would be better if I could keep the number, and only set my own suffix. That could be achived, of course, with a littlesed
magic or similar. But with this PR I can simply just set fs.VersionSuffix instead. This makes the build command very easy on any platform, and easy configurable in IDEs like VSCode etc.Nice to have? Definitely not a must have. And perhaps there are better ways to do this already? Perhaps this file needs to be single variable-only to not break some build pipeline I'm not aware of?
PS: I would like to leave out the
-
separator from the VersionSuffix, which makes it more "semver-safe", but then it would no longer be variables-only file, so I started with the simplest "proof of concept" suggestion...PS2: For reference, .NET uses the name
VersionPrefix
for the number part ("1.58.0") andVersionSuffix
for the pre-release label ("DEV"), andVersion
for the combination of the two separated with-
. And it also has aInformationalVersion
which typically is the combination ofVersion
and a commit hash separated with+
("1.58.0-DEV+27d5f545fa0e2f09629d0bcbb0e571fc79341f2b").PS3: Speaking of semver-safe... in
cmd/version/version.go
andbin/cross-compile.go
we parse the string into a semver struct (after first trimming off the "v" prefix which is not strict semver) and use the version number components:rclone/bin/cross-compile.go
Lines 202 to 227 in aa2d7f0
Was the change discussed in an issue or in the forum before?
Checklist