-
Notifications
You must be signed in to change notification settings - Fork 96
Add commit hash to the version for dev builds #1694
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
base: master
Are you sure you want to change the base?
Add commit hash to the version for dev builds #1694
Conversation
0d72aa3 to
e55c3b0
Compare
|
Thanks for the contribution, but it is currently introducing a new crate which seems overkill and add more work for the release process (that generally requires for me to comment the -dev part etc). We need to discuss first on the issue about the needs and the way of doing it. Is it only for quick development in debug mode, or for all binaries, etc. |
e55c3b0 to
8840ea1
Compare
|
I adapted following your comments. |
04d37e7 to
6b770bf
Compare
|
To simplify the release process we could add version and profile as environment variables at compile time and use them at runtime to build EDIT: the profile is already set by cargo during the build process |
|
from an internal discussion: add after this line then:
I think by this way we do not have to edit/comment any file during a release |
f0d17cf to
2fc1bbe
Compare
|
I converted the PR to draft because I've been unable to test the |
64980f0 to
3ff5999
Compare
|
I finally had time to test this, the release script fails, while a normal |
2661773 to
44e3c7f
Compare
44e3c7f to
2b4eb5f
Compare

I introduced a
GIT_HASHenvironment variable created for each crate that would need it. This is done in thebuild.rsfile of each crate. The latter uses a tiny new cratebuild-helpersto factor out the code that gets the commit hash and which could also be used for other build purposes.Then I adapted the
impl fmt::Display for Version.Also since the
Versionstruct is used in both lianad and liana-gui don't you think it could be moved to liana ?So now
./lianad --versionand./liana-gui --versionreturn10.0.0-dev-f43bed5, and the same goes for the window title.Closes #1601