-
Notifications
You must be signed in to change notification settings - Fork 41
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
Please add support for SOURCE_DATE_EPOCH to enable reproducible builds #61
Comments
@alerque Is there any example support? |
add unit test: Lines 384 to 390 in 479ae8f
|
@alerque Thanks for your mr. It's seem use new shadow-rs = "0.6.5" |
@baoyachi that looks like a partially good way to handle it. However, it is still using Local, which means that, when interacting with the object, it will depend on the |
@anthraxx Is that in reference the test above (which does use a local time zone but doesn't matter because it only tests that the local time is different that a fixed time passed with the end var) or do you think my actual implementation is a problem? In the actual implementation I'm using |
@alerque yes, the issue is with the actual implementation. The let time = Local.timestamp(1628685351, 0);
println!("{}", time.format("%Y-%m-%d %H:%M:%S"));
let time = Utc.timestamp(1628685351, 0);
println!("{}", time.format("%Y-%m-%d %H:%M:%S"));
|
I'll optimize it. |
I see, good catch and my apologies for the incomplete implementation. @baoyachi I'm happy to setup a PR if you want but it looks like it might be just as easy for you to make the correction. Let me know... |
Wait a minute. There will be a new version after modification 🚀 |
I'm sorry about this. I lost https://github.com/baoyachi/shadow-rs/blob/feature/issue_61/src/time.rs#L23 |
new version published shadow-rs = "0.6.6" |
Currently this library is blocking every project that uses it from passing reproducible build checks. The primary offender is here:
shadow-rs/src/env.rs
Line 253 in 1e9feec
The standardized solution to this it to support SOURCE_DATE_EPOCH. This way distro build systems and anything that is trying to verify whether packages are reproducible can keep ephemeral time information from being embedded in the binaries during test builds.
As an example of where this is a problem, see projects such as starship that are showing up in the BAD list on Arch Linux's reproducible status dashboard. The relevant bit from the diffoscope output is this snippet:
The text was updated successfully, but these errors were encountered: