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

recording date potentially leads to non-reproducible builds #578

Open
ghost opened this issue Dec 30, 2019 · 6 comments
Open

recording date potentially leads to non-reproducible builds #578

ghost opened this issue Dec 30, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Dec 30, 2019

https://github.com/kevinlawler/kona/blob/master/Makefile#L122 in my experience leads to non-reproducible builds (see https://reproducible-builds.org/) as it records a timestamp, which could change when the build of the same source is repeated on the different days assuming that the build environment does not reset the date.

If you can tell me what you want to achieve with this, I can prepare a patch which still satisfies your requirement.

a solution to this is 66852b3

@tavmem
Copy link
Collaborator

tavmem commented Dec 30, 2019

Including the KBUILD_DATE in Makefile

	echo "#define KBUILD_DATE \"`date +%Y-%m-%d`\"" >$@

was first done in commit 2dd1367
titled " merge pahihu: replaced _k value with ISO date"
done on Dec 10, 2015.

This was part of a series of merges authored by @pahihu
I have no idea what @pahihu was trying to achieve.

Your solution seems fine.
Alternatively, IMHO, the KBUILD_DATE can be removed completely.

@pahihu
Copy link

pahihu commented Dec 30, 2019 via email

@bakul
Copy link
Contributor

bakul commented Feb 8, 2020

Do you want to check the build date or the commit date? The latter would give you reproducible builds as well as tell you what sources a binary was built from.

@pahihu
Copy link

pahihu commented Feb 8, 2020 via email

@bakul
Copy link
Contributor

bakul commented Feb 8, 2020

In that case you can put something like the following in the Makefile:

VERSION=$(shell git rev-parse --short HEAD)
CLFAGS+=-DVERSION=$(VERSION)

And change the code to print out the version in the k banner. For example,

$ ./k
kona version c62db03.  Type  \ for help. \\ to exit.

If you want more details such as date, you can always do git cat-file -p <version>

@ghost
Copy link
Author

ghost commented Feb 9, 2020

In that case you can put something like the following in the Makefile:

VERSION=$(shell git rev-parse --short HEAD)
CLFAGS+=-DVERSION=$(VERSION)

I assume in a rule which is used to produce the tarball and Makefile for the distribution, because having the assumption for the release that it's a git checkout is a bad idea (which I guess you know).

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

No branches or pull requests

3 participants