[POC] guix: cross-architecture reproducibility (x86_64 & aarch64)#24569
[POC] guix: cross-architecture reproducibility (x86_64 & aarch64)#24569fanquake wants to merge 2 commits intobitcoin:masterfrom
Conversation
…n startup code (csu) When we are building against a glibc newer than 2.24 we may be able to use newer options, like --with-rtld-early-cflags or --with-nonshared-cflags.
This is kinda yuck, but should achieve cross-arch build reproducibility for atleast the non-qt binaries.
|
Concept ACK. |
Guix builds on
|
|
On Apple M1: |
It looks like your trying to build for aarch64 on aarch64. That doesn't currently work, see #22458. |
Guix builds on
|
Do you mean for the other HOSTS? They wont be reproducible until I've addedd additional |
|
Does guix not have a way for us to get the store paths programatically rather than hard coding them? |
|
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. |
|
Lets continue in #24615. |
With this change, I'm now seeing cross-architecture reproducibility from our Guix build (release) process. Given the same code, doing a Guix build on
x86_64andaarch64(arm64 Apple M1) hardware now gives the exact same binaries.The code change to our build script is a bit yuck (hence draft), and generating the correct store paths is a multi-phase process, as modifying glibc to insert the debug-prefix option for the native compiler, changes the store path hashes of the then-rebuilt GCC 10 toolchain, however once we have them, they should be stable for a given commit in our Guix time-machine.
Given that glibc startup code ends up in our binaries, we also need to patch out any
/gnu/store/*paths that may end up in the debug info for it's objects/libs i.e:Two points on that:
-fdebug-prefix-mapis used instead of-ffile-prefix-map=. The later is only supported by GCC 8 and older.--with-nonshared-cflags=) to make it easier to:which means in future we could potentially use this, as an additional glibc configure option, rather than patching a glibc Makefile.
Related to #21194.
Guix build on x86_64:
uname -a Linux 1ab0f609970a 5.13.0-1017-aws #19~20.04.1-Ubuntu SMP Mon Mar 7 12:53:12 UTC 2022 x86_64 LinuxGuix build on arm64 (Debian in Docker on Apple M1)
uname -a Linux 3b26b9608b88 5.10.104-linuxkit #1 SMP PREEMPT Wed Mar 9 19:01:25 UTC 2022 aarch64 GNU/Linux