-
Notifications
You must be signed in to change notification settings - Fork 36.7k
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
build: add --enable-determinism configure flag #18135
Conversation
Concept ACK: deterministic is better than non-deterministic Thanks for doing this! |
ACK 73b33c1 -- patch looks correct |
Might roll this into an |
Gitian builds
|
@fanquake Don't we want determinism by default? :) |
Concept NACK, build preferences should be set by the user. ( |
If used, this will enable additional compile / link time flags that will make subsequent builds of bitcoind determinisitic.
73b33c1
to
3d9b41e
Compare
I've updated this to be an |
ACK 3d9b41e -- patch looks correct |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
How is this different from libfaketime, which we use in the gitian builds? |
This bypasses the need for |
Yes, the idea is to not need faketime anymore at some point. It was always a hack because so many of the GNU and Qt tools embedded timestamps in all kind of unexpected places. We've slowly been working to get rid of those. I like putting this under an option instead of making it ACK 3d9b41e |
3d9b41e build: add --enable-determinism configure flag (fanquake) Pull request description: This adds a `--enable-determinsm` configure flag, which if used, will enable additional compile / link time flags to make subsequent builds of bitcoind deterministic. The first flag enabled is `--no-insert-timestamp`. This prevents the linker from embedding timestamps, and makes consecutive builds of `bitcoind.exe` deterministic. This will likely also be used for [Guix Windows builds](bitcoin#17595 (comment)). [`--no-insert-timestamp`](https://manpages.debian.org/buster/binutils-mingw-w64-x86-64/x86_64-w64-mingw32-ld.bfd.1.en.html): > The option --no-insert-timestamp can be used to insert a zero value for the timestamp, this ensuring that binaries produced from identical sources will compare identically. Diff of consecutive builds of [master](bitcoin@2bdc476): ```diff --- bitcoind.exe.1 +++ bitcoind.exe.2 @@ -2,20 +2,20 @@ 00000060: 7420 6265 2072 756e 2069 6e20 444f 5320 t be run in DOS 00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000 mode....$....... -00000080: 5045 0000 6486 1400 57e8 445e 00da 6900 PE..d...W.D^..i. +00000080: 5045 0000 6486 1400 e3e9 445e 00da 6900 PE..d.....D^..i. 0000009: e015 0100 f000 2600 0b02 021f 00de 4900 ......&.......I. 000000a0: 00b0 5b00 008a 0000 e014 0000 0010 0000 ..[............. 000000b0: 0000 4000 0000 0000 0010 0000 0002 0000 ..@............. 000000c0: 0400 0000 0000 0000 0500 0200 0000 0000 ................ -000000d0: 00f0 6a00 0006 0000 bd31 af00 0300 6001 ..j......1....`. +000000d0: 00f0 6a00 0006 0000 d434 af00 0300 6001 ..j......4....`. 000000e0: 0000 2000 0000 0000 0010 0000 0000 0000 .. ............. @@ -373594,15 +373594,15 @@ 005b35f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ -005b3600: 0000 0000 57e8 445e 0000 0000 7ce1 5b00 ....W.D^....|.[. +005b3600: 0000 0000 e2e9 445e 0000 0000 7ce1 5b00 ......D^....|.[. 005b3610: 0100 0000 2200 0000 2200 0000 28e0 5b00 ...."..."...(.[. ``` ACKs for top commit: practicalswift: ACK 3d9b41e -- patch looks correct laanwj: ACK 3d9b41e Tree-SHA512: 1ff9dab7fa818b1fc6b0eb3b7a1e0468aac9e2578f4451aa300a648f883fa83f83722067f1adf27ebad54157790857d1501d573adbd7ebdf6962858cc669960d
So we can remove libfaketime from gitian as well and replace it with this configure flag and/or appropriate |
Mind looking into #19627? |
3d9b41e build: add --enable-determinism configure flag (fanquake) Pull request description: This adds a `--enable-determinsm` configure flag, which if used, will enable additional compile / link time flags to make subsequent builds of bitcoind deterministic. The first flag enabled is `--no-insert-timestamp`. This prevents the linker from embedding timestamps, and makes consecutive builds of `bitcoind.exe` deterministic. This will likely also be used for [Guix Windows builds](bitcoin#17595 (comment)). [`--no-insert-timestamp`](https://manpages.debian.org/buster/binutils-mingw-w64-x86-64/x86_64-w64-mingw32-ld.bfd.1.en.html): > The option --no-insert-timestamp can be used to insert a zero value for the timestamp, this ensuring that binaries produced from identical sources will compare identically. Diff of consecutive builds of [master](bitcoin@2bdc476): ```diff --- bitcoind.exe.1 +++ bitcoind.exe.2 @@ -2,20 +2,20 @@ 00000060: 7420 6265 2072 756e 2069 6e20 444f 5320 t be run in DOS 00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000 mode....$....... -00000080: 5045 0000 6486 1400 57e8 445e 00da 6900 PE..d...W.D^..i. +00000080: 5045 0000 6486 1400 e3e9 445e 00da 6900 PE..d.....D^..i. 0000009: e015 0100 f000 2600 0b02 021f 00de 4900 ......&.......I. 000000a0: 00b0 5b00 008a 0000 e014 0000 0010 0000 ..[............. 000000b0: 0000 4000 0000 0000 0010 0000 0002 0000 ..@............. 000000c0: 0400 0000 0000 0000 0500 0200 0000 0000 ................ -000000d0: 00f0 6a00 0006 0000 bd31 af00 0300 6001 ..j......1....`. +000000d0: 00f0 6a00 0006 0000 d434 af00 0300 6001 ..j......4....`. 000000e0: 0000 2000 0000 0000 0010 0000 0000 0000 .. ............. @@ -373594,15 +373594,15 @@ 005b35f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ -005b3600: 0000 0000 57e8 445e 0000 0000 7ce1 5b00 ....W.D^....|.[. +005b3600: 0000 0000 e2e9 445e 0000 0000 7ce1 5b00 ......D^....|.[. 005b3610: 0100 0000 2200 0000 2200 0000 28e0 5b00 ...."..."...(.[. ``` ACKs for top commit: practicalswift: ACK 3d9b41e -- patch looks correct laanwj: ACK 3d9b41e Tree-SHA512: 1ff9dab7fa818b1fc6b0eb3b7a1e0468aac9e2578f4451aa300a648f883fa83f83722067f1adf27ebad54157790857d1501d573adbd7ebdf6962858cc669960d
This adds a
--enable-determinsm
configure flag, which if used, will enable additional compile / link time flags to make subsequent builds of bitcoind deterministic.The first flag enabled is
--no-insert-timestamp
. This prevents the linker from embedding timestamps, and makes consecutive builds ofbitcoind.exe
deterministic. This will likely also be used for Guix Windows builds.--no-insert-timestamp
:Diff of consecutive builds of master: