Skip to content

Conversation

dongcarl
Copy link
Contributor

@dongcarl dongcarl commented Jan 13, 2020

This PR brings our Guix builds on par with Gitian in terms of supported architectures.

Reviewers: if you run a build, please submit:

find output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum

So that we can compare hashes and ensure reproducibility!

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 13, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, 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.

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously concept ACK on macOS GUIX builds. Not going to comment on the interim system Clang commits here.

# esac
# )

# Environment variables for determinism
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we no longer have to set ZERO_AR_DATE here because we're not using a libtool from cctools?

From libtool.c:

all of these values are initialized to reasonable defaults for deterministic
archives: archives that are consistent regardless of user, time, or umask
differences. Ordinarily, these values and will be set to more specific
ones when building new archives, but that can be suppressed using the
'-D' option or the ZERO_AR_DATE environment variable.

@dongcarl dongcarl force-pushed the 2020-01-guix-macos branch 2 times, most recently from 20e9e0b to fa7ea1b Compare January 31, 2020 14:50
@fanquake fanquake added this to the 0.21.0 milestone Mar 28, 2020
@dongcarl
Copy link
Contributor Author

Update: this is still being actively worked on. Current hurdle: some weird clang internal search path logic.

@Sjors
Copy link
Member

Sjors commented Dec 11, 2020

Tested 40ad768. I (re)installed guix on an Ubuntu 20 machine and used --no-substitutes and --bootstrap to exercise my low time preference.

This did not go without hickups, e.g.:

  • guix install glibc-locales (as root, this would fail without substitutes) and configuring GUIX_LOCPATH (as guix user) is not particularly well documented upstream
  • during guix-build.sh the step /gnu/store/36fgj9n3c8bmix2pd12kfaszi7bd5y7a-ghostscript-9.27.drv' failed without too much actionable info. I tried dropping --bootstrap, but got the same error, so I ended up dropping --no-substitutes as well
  • noticed a warning: Computing Guix derivation for 'x86_64-linux'... WARNING: (guix build emacs-build-system): imported module (guix build utils) overrides core binding delete'`

Not sure what file is most useful to compare, but here's a few:

0aa66de467110bf45e7606d2696ea4417d4a94fdc59495646428c1ca05e2e744  distsrc-x86_64-linux-gnu/src/bitcoind
2b75f3955337b0345c7b6e33ad83185bba06ea96f1aedc30b7894c20af4489ee  distsrc-x86_64-apple-darwin16/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt

I can also still build and use depends on native macOS Big Sur. CI seems to struggle, maybe a spurious failure.

You may want to link to the macOS SDK extraction instructions (and that it needs to be untarred into depends/SDK's).

You may want to rebase (#20470) now that #20422 landed, since it changed make deploy (I just tried a rebase and it seems to behave at least on macOS itself).

Does this PR mean you can switch to the upstream GUIX repo? Or are there still patches? See 93439a7

@dongcarl
Copy link
Contributor Author

Many thanks for testing @Sjors! Your review is super helpful as I want to make this process as user-friendly as possible. Even for the folks building without substitutes! Cheers.

To start off, it seems like reproducibility is working!

$ sha256sum distsrc-x86_64-linux-gnu/src/bitcoind distsrc-x86_64-apple-darwin16/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt
0aa66de467110bf45e7606d2696ea4417d4a94fdc59495646428c1ca05e2e744  distsrc-x86_64-linux-gnu/src/bitcoind
2b75f3955337b0345c7b6e33ad83185bba06ea96f1aedc30b7894c20af4489ee  distsrc-x86_64-apple-darwin16/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt

Now onto your concerns:

  • guix install glibc-locales (as root, this would fail without substitutes) and configuring GUIX_LOCPATH (as guix user) is not particularly well documented upstream

Very true, I've had experience with this myself, I will write up some documentation. As for the glibc-locales failure, could you send me your guix describe?

  • during guix-build.sh the step /gnu/store/36fgj9n3c8bmix2pd12kfaszi7bd5y7a-ghostscript-9.27.drv' failed without too much actionable info. I tried dropping --bootstrap, but got the same error, so I ended up dropping --no-substitutes as well

I've encountered this a while ago, so this must be an outstanding bug. I will look into it! I also think it may be good for me to write down in the README how to report Guix build failures (Guix always saves a bzip'd full log file in /var/log/guix for failed builds).

  • noticed a warning: Computing Guix derivation for 'x86_64-linux'... WARNING: (guix build emacs-build-system): imported module (guix build utils) overrides core binding delete'`

That warning is an old bug that has since been fixed here: https://issues.guix.gnu.org/41595. I will see how we can mitigate against this as well, may just have to bump my time-machine commit!

You may want to link to the macOS SDK extraction instructions (and that it needs to be untarred into depends/SDK's).

Sure! I added a check for it in the script but I agree that it should be in the README as well!

You may want to rebase (#20470) now that #20422 landed, since it changed make deploy (I just tried a rebase and it seems to behave at least on macOS itself).

Ah I did rebase that one, but not the cherry-picked commits in here. Will do!

Does this PR mean you can switch to the upstream GUIX repo? Or are there still patches? See 93439a7

I want to switch over to upstream GUIX once everything is finalized. There could still be things that crop up I need to patch, but it's looking increasingly unlikely.

@Sjors
Copy link
Member

Sjors commented Dec 13, 2020

guix describe (as root)

/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
guix describe: error: failed to determine origin
hint: Perhaps this `guix' command was not obtained with `guix pull'? Its version string is 1.2.0.

(my Ubuntu install in general is a cluster f*** that I very much feel like reinstalling from scratch, FWIW)

may just have to bump my time-machine commit

Happy to try again after that.

@dongcarl
Copy link
Contributor Author

@Sjors Looking into a few things... Could you send me the file that's returned by:

$ guix build --log-file /gnu/store/36fgj9n3c8bmix2pd12kfaszi7bd5y7a-ghostscript-9.27.drv

Much appreciated.

@Sjors
Copy link
Member

Sjors commented Dec 15, 2020

As user guix as well as root:

/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
guix build: error: no build log for '/gnu/store/3i5qm6z0qihhjbdgs3pwj42gy63sf74h-ghostscript-9.27'

I ran the garbage collector guix gc and git clean -xdff --exclude='/depends/SDKs/*' and did another build (same hashes).

By the way, before I ran that clean command I got:

DISTSRC directory '/bitcoin/distsrc-x86_64-linux-gnu' exists, probably because of previous builds... Aborting...

It would be nice if e.g. guix-build.sh checked this at the start, and maybe offers to nuke it.

@dongcarl
Copy link
Contributor Author

@Sjors Would you mind giving me more info on your setup? I'm particularly interested in what distro and kernel version you were using when you encountered:

guix install glibc-locales (as root, this would fail without substitutes)

@Sjors
Copy link
Member

Sjors commented Dec 17, 2020

Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-33-generic x86_64)

I installed Guix as root using their guix-install.sh script. I have a user guix where I cloned this branch and from which I run the builds.

@dongcarl
Copy link
Contributor Author

dongcarl commented Jan 13, 2021

Pushed 0e5c7bf -> 05a31a9


Is there a reason this is still draft?

Nope!

@dongcarl dongcarl marked this pull request as ready for review January 13, 2021 19:55
@fanquake
Copy link
Member

05a31a9

find output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
3f2762da34e6681471a7ede52ff7739e0e5ad64dd4584ae1e6d4af47456c2a98  output/bitcoin-05a31a95832b-osx-unsigned.dmg
ffc15b01f5028bf15fda61c1b3d785c2ba6e72fdfdd3292ea7f7d7f0b5230f9f  output/bitcoin-05a31a95832b-osx-unsigned.tar.gz
538ba85976b7dec9353d9e246346cac792916ed2a59360c5ded8c7e4ddebe8b7  output/bitcoin-05a31a95832b-osx64.tar.gz
21118fd0183fc430fe6de82bbcd5ab353643fc51a280a11cb188e9e4ae7c7cd5  output/src/bitcoin-05a31a95832b.tar.gz

@dongcarl
Copy link
Contributor Author

I'm getting matching hashes!

find output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
3f2762da34e6681471a7ede52ff7739e0e5ad64dd4584ae1e6d4af47456c2a98  output/bitcoin-05a31a95832b-osx-unsigned.dmg
ffc15b01f5028bf15fda61c1b3d785c2ba6e72fdfdd3292ea7f7d7f0b5230f9f  output/bitcoin-05a31a95832b-osx-unsigned.tar.gz
538ba85976b7dec9353d9e246346cac792916ed2a59360c5ded8c7e4ddebe8b7  output/bitcoin-05a31a95832b-osx64.tar.gz
21118fd0183fc430fe6de82bbcd5ab353643fc51a280a11cb188e9e4ae7c7cd5  output/src/bitcoin-05a31a95832b.tar.gz

@dongcarl
Copy link
Contributor Author

Pushed 05a31a9 -> f169475

  • Rebased over master
  • Fixed typo

Hashes:

2d17b6c787f91bf32e5d3732a6a054df1940d26030fc19d845ca0b472283a1bb  output/bitcoin-f1694757ddbc-osx-unsigned.dmg
c5a8207f4d76928b88ac9dfed61197be9bfd62ba93821898a9c90e1eb8a5a7d5  output/bitcoin-f1694757ddbc-osx-unsigned.tar.gz
bb972ac7f0f03c31d30c15cc9667530cd25f2237f4eb9d32cd3a1ea17ce1ff6a  output/bitcoin-f1694757ddbc-osx64.tar.gz
262cb14aabffdb98260ca53e5d420b14f4242c83e414963abf9c4798eba899b6  output/src/bitcoin-f1694757ddbc.tar.gz

@fanquake
Copy link
Member

ACK f169475 - I think we can make some small usability improvements, but this is ok to merge now.

find output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
2d17b6c787f91bf32e5d3732a6a054df1940d26030fc19d845ca0b472283a1bb  output/bitcoin-f1694757ddbc-osx-unsigned.dmg
c5a8207f4d76928b88ac9dfed61197be9bfd62ba93821898a9c90e1eb8a5a7d5  output/bitcoin-f1694757ddbc-osx-unsigned.tar.gz
bb972ac7f0f03c31d30c15cc9667530cd25f2237f4eb9d32cd3a1ea17ce1ff6a  output/bitcoin-f1694757ddbc-osx64.tar.gz
262cb14aabffdb98260ca53e5d420b14f4242c83e414963abf9c4798eba899b6  output/src/bitcoin-f1694757ddbc.tar.gz

@fanquake fanquake merged commit 019aa24 into bitcoin:master Jan 22, 2021
;; Native gcc 9 toolchain targeting glibc 2.27
(make-gcc-toolchain gcc-9 glibc-2.27))
;; Native gcc 7 toolchain
gcc-toolchain-7)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changed, seems unrelated to macos, no? Does this break gcc cross builds for our linux archs that need gcc 8 at least?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, this is the comment I was referring to: #13665 (comment)

I presume that guix is using a gcc-7 that has a fix backported?

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 22, 2021
@Sjors
Copy link
Member

Sjors commented Jan 22, 2021

Post merge test: I get the same checksums!

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants