-
Notifications
You must be signed in to change notification settings - Fork 32
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
tar2rpm: Build Date is far in the future #43
Comments
The problem with embedding the actual build date, is that it makes the build non-reproducible and non-cachable. The tag is optional, and I expanded about why I don't like build dates in the discussion of #33, where the dates were added due to non-compliant consumers. The reason you see 2042 is rather silly. In #33 we used signed int32, but apparently if you truncate the sign of the int64 golang zero value of I don't think we should use the actual date. We should fix the uint32 thing. If you have an actual use case for having the real date, we can accept it as another flag, say |
Thanks for your swift feedback. |
Add a build_time flag which allows specifying the build timestamp for people who like that. To use the current time, you can use: ` --build_time $(date +%s)` I strongly recommend not doing that, because it makes the build change every time and hurt your caching and reproducibility, but people seem to need this. Also change the default timestamp to be empty to avoid the 2042 time. Fixes google#43
Can you check #46 and see if it fixes the bug? |
Yes, thanks a lot. This fixes the issue for me: Testcase 1: Run tar2rpm as previously and verify that Build Date does not contain this weird year 2042 date:
Result: As expected. The Build Date of "(none)" is reasonable. Testcase 2: Run tar2rpm with the new command line switch --build_time with argument of current unix timestamp from /bin/date
Result: As expected. The Build Date contains the Timestamp when the rpm was created with tar2rpm. Thanks a lot! |
The rpm created by tar2rpm contains a "Build Date" that is far in the future.
Steps to reproduce:
kali@kali:~/go$ date
Wed 08 Jul 2020 04:02:49 PM EDT
kali@kali:~/go$ ./tar2rpm -file /tmp/example.rpm -name "Example" -version "1.0" /tmp/input.tar
kali@kali:~/go$ rpm -qip /tmp/example.rpm
Expectation:
The "Build Date:" line of the rpm query should contain something like "Wed 08 Jul 2020 04:02:49 PM EDT", but it's always "Sun 13 Jul 2042 09:04:00 PM EDT" even on subsequent delayed rebuilds of the rpm.
The text was updated successfully, but these errors were encountered: