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
Allow to not have randomness in file_id #2436
Conversation
|
also note, that I only tested that it builds, not that it works. |
|
It's great to see the reproducible builds effort reaching out to us, thanks! Summoning @ssm, your opinion? |
|
Actually, projects could make their software more reproducible by just looking at results that I publish every few weeks - e.g. http://rb.zq1.de/compare.factory-20170208/varnish-compare.out but since I have all my tools setup and some experience in debugging reproducibility-issues, it is probably easier for me to do. |
|
The randomness is a place-holder. What really should go there is the SHA256() over the .h files which constitute the VRT API. Now that we hav |
|
So which .h files constitute that API? And I think this code was run multiple times - so how would one determine the right hash per call? |
|
@bmwiedemann, sorry for the lack of response lately but to answer your question this is still an ongoing effort. Somewhat related link, still an incomplete draft: https://github.com/varnishcache/varnish-cache/wiki/VIP20%3A-Varnish-ABI-and-packaging |
|
I guess at least I had misinterpreted this ticket: This is about the vmod's file_id, and the bugwash consensus was to SHA256 the vmods .vcc file, and leave it at that. |
in order to make builds reproducible. See https://reproducible-builds.org/ for why this is good.
|
@bsdphk I tried your patch ontop of 6.0.0 and get an error during build: It probably needs to be self.file_id = hashlib.sha256(a.encode('utf-8')).hexdigest()For some reason both versions work in python2 (soon to be dropped anyway) |
Without this patch, it did TypeError: Unicode-objects must be encoded before hashing Fixes: varnishcache#2436
|
Made PR #2759 for the fixup. openSUSE's varnish package builds reproducibly with the patches. yay! |
I belive this makes our builds reproducible. Fixes: #2436 Conflicts: include/vrt.h
Without this patch, it did TypeError: Unicode-objects must be encoded before hashing Fixes: #2436
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good.
Debian is approaching this with
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835061
which fixes the rand seed, but I was afraid that this might produce
different files with identical file_id values.
There could be a third approach possible where all relevant inputs
are hashed into the file_id value, so that it differs when inputs change
but remains the same otherwise.