Skip to content
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

Reproducibility issue linked to different length of commits under HEADS_GIT_VERSION #1227

Closed
tlaurion opened this issue Oct 20, 2022 · 0 comments · Fixed by #1228
Closed

Comments

@tlaurion
Copy link
Collaborator

There is a difference between git reports of what is specified in Makefile to obtain git tag+commit: HEADS_GIT_VERSION := $(shell git describe --tags --dirty)

osresearch:
v0.2.0-1263-gf2e45c4

tlaurion:
v0.2.0-1263-gf2e45c43

Note the difference in length, being 7 or 8 characters above

Seems like the way to fix this would be to set the abbrev option to fixate length of commit length output:
--abbrev[=<n>] use <n> digits to display object names

Github shows commit ids in an abbrev form of 7 characters. We should force the same inside of the builds for consistency and to avoid reproducibility issues on that:
HEADS_GIT_VERSION := $(shell git describe --tags --abbrev=7 --dirty)

Locally, this fixes the issue:

user@heads-tests:~/heads$ git describe --tags --abbrev=7 --dirty
v0.2.1.bis2-144-gf2e45c4-dirty
user@heads-tests:~/heads$ git describe --tags --dirty
v0.2.1.bis2-144-gf2e45c43-dirty

Originally posted by @tlaurion in #1225 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant