Skip to content
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

Bootstrappable Builds #8929

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Bootstrappable Builds #8929

wants to merge 1 commit into from

Conversation

tobtoht
Copy link
Contributor

@tobtoht tobtoht commented Jul 2, 2023

This PR proposes to replace Gitian with Guix to achieve bootstrappable builds for release binaries.

What?

https://youtube.com/watch?v=I2iShmUTEl8

If you have 15 minutes, please consider watching this presentation by Carl Dong linked above as it covers the migration (Gitian → Guix) this PR proposes to make. It explains why reproducibility alone is not enough.

Other resources:

Why?

  • Greater build system security: Bootstrappability allows us to audit and reproduce our toolchain instead of blindly trusting binary downloads. Our build environment can be built from source, all the way down. It allows us to reduce our supply chain attack surface by only including the packages that we need, and nothing else.

  • Easier to set up: Guix runs on any Linux distribution and on most architectures (x86_64, aarch64, riscv64). To produce reproducible release binaries, you only need to install Guix and run the build script. This hopefully leads to more participants in the pre-release verified reproduction process.

  • More flexibility: Unlike Gitian, we are not limited to the package set of a particular Ubuntu version. Guix allows us to pick and choose our toolchains. This allows us to use the latest compilers while targeting older versions of glibc and would, for example, make it easier to add a modern Rust compiler to our build environment. Packages that are not available in Guix can easily be defined in the manifest or upstreamed.

  • Better developer UX: Guix allows us to modify any detail about our build environment with ease. Debugging build issues takes less time because we have shell access to the build environment. The monero source code is bind mounted into the container, so edits to package definitions can be tested incrementally.

  • Future proof: Guix is actively developed, Gitian is in maintenance mode (serious bug fixes only).

How to test?

Requirements:

  • any Linux distribution
  • 50 GB of free disk space
  • 4 or more cores recommended
  • 2 GB RAM per thread
# Install guix
$ apt install guix  # ubuntu 22.04, debian 11, or later 
or 
# use the install script: https://guix.gnu.org/manual/en/html_node/Binary-Installation.html

# Clone the repo
$ git clone https://github.com/tobtoht/monero
$ cd monero
$ git checkout guix

# Run the builds
$ ./contrib/guix/guix-build  # this will take several hours, uses all available cores
or
$ JOBS=N ./contrib/guix/guix-build # replace N with the desired maximum number of threads

# Obtain a list of hashes
$ uname --machine && find guix/guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum

For more information, see README.md

Notes

Environment Guix version (NEW) Gitian version (OLD)
Guix 53396a22af (28 Aug 2024) n/a
Glibc 2.27 2.27
Binutils 2.38 2.30
GCC 12.4.0 7.5.0
Clang 11.1.0 (darwin, freebsd) 9.0.0
Linux headers 6.1.106 (LTS)* 5.4.0

* this does not affect run-time kernel requirements, see glibc docs.

The guix.yml workflow does not use caching because it uses too much space and causes evictions for other caches (10 GB limit). We only need to run it when there is a change to contrib/{depends,guix}, which happens infrequently and doesn't need to complete quickly.

This PR removes native_clang because Guix provides us with a bootstrapped package and non-guix builds can use the system clang. This PR introduces backwards incompatible compiler flags, bumping the minimum Clang version to 10 (up from 9) for depends builds. Clang >=10 is available in the package managers of all supported distros (including Ubuntu 18.04).

The minimum glibc version for all Linux targets is now 2.27 (Ubuntu 18.04, Debian 10), for more details see #9171 (comment).

The source archive now includes all submodules.

To-do

  • Working builds for all targets
  • GitHub Actions
  • Minimize manifest
  • Fix release archive structure
  • Fix rpath
  • Build attestation
  • Fix reproducibility defects
  • Set up a monero-project/guix repo
  • (Builds reproducible on x86_64 and aarch64 based hosts)
  • Add more docs to source
  • Test --no-substitutes build
  • All binaries tested
  • Set up a monero-project/guix.sigs repo

Q&A

What role does Guix serve in the build process?

Guix is used to set-up a reproducible, bootstrappable, containerized build environment. This replaces the Ubuntu 18.04 based environment we used for Gitian builds.

Monero dependencies are built using the depends build system inside the container provided by Guix. While Guix could eventually replace depends, it would be too drastic for this PR.

Can Guix run on any Linux distribution?

Yes, with few exceptions. Installing Guix on an immutable distro like Fedora SilverBlue might not be possible.

To install Guix, use the official install script: https://guix.gnu.org/manual/en/html_node/Binary-Installation.html

Can Guix run on macOS or Windows?

Not natively. You can run Guix builds on macOS inside a virtual machine (even on Apple Silicon). On Windows, it should be possible to install Guix on WSL2.

Can Guix run on aarch64 / riscv64 machines?

Yes. It even produces the same bit-identical release binaries as Guix run on a x86_64 machine. This isn't possible with Gitian.

Targets that don't currently build on non-x86_64: Android, FreeBSD.

Are Guix builds slower than Gitian?

Guix builds are only slower the first time, because it needs to build toolchains (or the entire package graph if --no-substitutes is used) from source. Subsequent runs just as fast (or faster) than Gitian due to caching.

Why Guix instead of Nix?

Nix packages are not bootstrappable.

What does bootstrappable mean in this context?

It means that the package graph for all packages included in our build environment is rooted in a single 357-byte heavily annotated program. We no longer have to trust binaries (downloaded from Ubuntu servers) for reproducible builds.

For more information: https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/

If a new version of Guix is released, does that mean our build environment is no longer reproducible?

No, builds remain reproducible indefinitely, assuming the source code for all packages is archived and remains available. The exact version of Guix, including all of its packages is pinned using time-machine.

More information:

How do we define which packages are included in the build environment?

In manifest.scm. In this file, we can choose packages that are already available in Guix or define packages ourselves.

When should we define packages in the manifest?

If a package, specific package version, or toolchain isn't available in Guix and it isn't possible to upstream or we can't we can't wait on that.

Is the build environment identical for all targets?

No, extra packages can be added for each target.

If we change the time-machine commit, does that mean our build environment changes?

Yes. The manifest generally does not specify which packages versions are included in the build environment. If a package was updated in Guix between the old and new commit, we will have the updated version in our build environment. Updating the time-machine can therefore cause breakage and should be done with caution.

How do I get shell access to the build environment for development purposes?

In contrib/guix/guix-build replace bash -c "cd /monero && bash contrib/guix/libexec/build.sh" with bash.

Then invoke with: FORCE_DIRTY_WORKTREE=1 ./contrib/guix/guix-build.

Where to start review?

contrib/guix/README.md

contrib/guix/guix-build

contrib/guix/manifest.scm

contrib/guix/libexec/build.sh

Troubleshooting

  • Might segfault during compilation on first generation Ryzen processors due to a hardware fault.
  • Ubuntu 24.04: If you run into mount "none" on "/tmp/guix-directory.": Permission denied you need to create an apparmor profile for Guix, see: Bootstrappable Builds #8929 (comment)

Status

This PR is ready for testing.

Target Builds Tested
x86_64-linux-gnu 🮱 🮱
arm-linux-gnueabihf 🮱
aarch64-linux-gnu 🮱
riscv64-linux-gnu 🮱
i686-linux-gnu 🮱
i686-w64-mingw32 🮱
x86_64-w64-mingw32 🮱 🮱
x86_64-unknown-freebsd 🮱
x86_64-apple-darwin 🮱
aarch64-apple-darwin 🮱
arm-linux-androideabi 🮱
aarch64-linux-android 🮱

Testing checklist

  • monero-wallet-cli:
    • create a new wallet file
    • open a wallet file that was created with v0.18.3.4
    • receive a transaction
    • send a transaction
    • save and reopen a wallet file
  • monerod
    • sync until completion without crashing

Follow-up PRs

@0xFFFC0000
Copy link
Collaborator

I cannot wait until we finalize and merge this. Thanks for your great work @tobtoht

@tobtoht
Copy link
Contributor Author

tobtoht commented Feb 25, 2024

I don't expect to make major changes to this PR, it's ready for testing. Reviews on any of the sub-PRs would help move this forward.

contrib/depends/Makefile Outdated Show resolved Hide resolved
#!/bin/bash
if [ "$1" != "-cc1" ]; then
- `dirname $0`/clang{version} {flags} "$@"
+ env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH -u LIBRARY_PATH `dirname $0`/clang{version} {flags} "$@"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to unset these environment variables here because they refer to Guix profile packages. We want clang to only include headers from the NDK. We can't unset them in build.sh because native_ package builds would fail to find the necessary include headers. Unsetting these variables does not affect non-Guix builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This patch will be removed in #9456

Comment on lines +11 to +14
+ #if $(real-version) < "4.0.0"
+ #{
+ # flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
+ #}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Boost 1.64.0 doesn't recognize that we're building with Clang and passes a flags that results in an error. We don't support GCC < 4.0 at all, so commenting out the lines here is fine. Patch can be dropped when we update Boost.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This patch will be removed in #9162

@@ -0,0 +1,76 @@
Note that this has been modified from the original commit, to use __has_include
Copy link
Contributor Author

Choose a reason for hiding this comment

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

riscv64-linux-gnu builds fail without this patch

Copy link

Choose a reason for hiding this comment

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

Is this the same issue with buggy gcc version 10-11 compiler? (Is this solved on gcc <=9 and >=12+?)

Copy link
Contributor Author

@tobtoht tobtoht Aug 11, 2024

Choose a reason for hiding this comment

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

Unrelated, patch fixes a missing include in glibc. Monero codebase doesn't contain __has_include__. Log for reference:

../sysdeps/unix/sysv/linux/riscv/flush-icache.c:24:10: fatal error: asm/syscalls.h: No such file or directory
   24 | #include <asm/syscalls.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Patch can be removed when we upgrade glibc to > 2.27.

@@ -0,0 +1,22 @@
Without ffile-prefix-map, the debug symbols will contain paths for the
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Building on aarch64 should produce bit-for-bit identical release binaries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It now does for linux, windows, and macos targets. FreeBSD and Android targets use pre-compiled x86_64 toolchains and libraries.

contrib/guix/manifest.scm Outdated Show resolved Hide resolved
contrib/guix/libexec/build.sh Show resolved Hide resolved
contrib/guix/libexec/build.sh Show resolved Hide resolved
contrib/gitian/docker/
contrib/gitian/sigs/
# guix
/guix
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finished builds are available in ./guix/guix-build-<COMMIT>/

├── guix-build-222ea1a30058
│   ├── build
│   │   └── distsrc-222ea1a30058-x86_64-linux-gnu  # build directory
│   ├── logs
│   │   └── x86_64-linux-gnu  # various logs for reproducibility debugging
│   │       ├── depends-gen_id-build.txt
│   │       ├── depends-gen_id-host.txt
│   │       ├── depends-hashes.txt
│   │       ├── depends-packages.txt
│   │       ├── guix-env.txt
│   │       ├── guix-hashes.txt
│   │       └── SHA256SUMS.part
│   ├── output
│   │   └── x86_64-linux-gnu
│   │       └── monero-x86_64-linux-gnu-222ea1a30058.tar.bz2  # binary tarball
│   └── var
│       ├── precious_dirs  # directories to keep when running `./contrib/guix/guix-clean`
│       └── profiles

@@ -267,4 +275,4 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$
$(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package))))

#special exception: if a toolchain package exists, all non-native packages depend on it
$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) ))
$(foreach package,$(packages),$(eval $($(package)_extracted): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) ))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

_unpacked target doesn't exist.

contrib/guix/manifest.scm Outdated Show resolved Hide resolved
contrib/guix/libexec/build.sh Show resolved Hide resolved
Comment on lines +3 to +22
$(1)_cc=$$($$($(1)_type)_CC)
$(1)_cxx=$$($$($(1)_type)_CXX)
$(1)_objc=$$($$($(1)_type)_OBJC)
$(1)_objcxx=$$($$($(1)_type)_OBJCXX)
$(1)_ar=$$($$($(1)_type)_AR)
$(1)_ranlib=$$($$($(1)_type)_RANLIB)
$(1)_libtool=$$($$($(1)_type)_LIBTOOL)
$(1)_nm=$$($$($(1)_type)_NM)
$(1)_cflags=$$($$($(1)_type)_CFLAGS) \
$$($$($(1)_type)_$$(release_type)_CFLAGS)
$(1)_cxxflags=$$($$($(1)_type)_CXXFLAGS) \
$$($$($(1)_type)_$$(release_type)_CXXFLAGS)
$(1)_arflags=$$($$($(1)_type)_ARFLAGS) \
$$($$($(1)_type)_$(release_type)_ARFLAGS)
$(1)_ldflags=$$($$($(1)_type)_LDFLAGS) \
$$($$($(1)_type)_$$(release_type)_LDFLAGS) \
-L$$($($(1)_type)_prefix)/lib
$(1)_cppflags=$$($$($(1)_type)_CPPFLAGS) \
$$($$($(1)_type)_$$(release_type)_CPPFLAGS) \
-I$$($$($(1)_type)_prefix)/include
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Delay expansion of package variables.

@@ -0,0 +1,63 @@
name: ci/gh-actions/guix

on: [push, pull_request]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed guix and depends package caching from the CI workflow because it uses too much space and causes evictions for other caches (10 GB limit). We only need to run it when there is a change to contrib/{depends,guix}, which happens infrequently and doesn't need to complete quickly.

on: [push, pull_request] is temporary for testing.

path: contrib/depends/sources
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
- name: install dependencies
run: sudo apt update; sudo apt -y install guix git ca-certificates
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may be worth investigating if using the installer script is faster.

https://guix.gnu.org/manual/en/html_node/Installation.html

(("-rpath=") "-rpath-link="))
#t))))))))

(define-public glibc-2.27
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The minimum glibc version for all Linux targets is now 2.27 (Ubuntu 18.04, Debian 10).

For more context, see: #9171 (comment)

contrib/guix/libexec/build.sh Outdated Show resolved Hide resolved
contrib/depends/packages/darwin_sdk.mk Show resolved Hide resolved
Comment on lines -81 to +84
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
SET(CMAKE_C_COMPILER @CC@)
SET(CMAKE_C_COMPILER_TARGET ${CLANG_TARGET})
SET(CMAKE_C_FLAGS_INIT -B${_CMAKE_TOOLCHAIN_PREFIX})
SET(CMAKE_CXX_COMPILER @prefix@/native/bin/clang++ -stdlib=libc++)
SET(CMAKE_CXX_COMPILER @CXX@ -stdlib=libc++)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're now using the system / guix-provided clang for darwin builds.

Comment on lines +87 to +88
SET(CMAKE_ASM_COMPILER clang)
SET(CMAKE_ASM-ATT_COMPILER as)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CMake automatically reduces CMAKE_CXX_COMPILER to the first command to derive CMAKE_ASM_COMPILER. This happens to be env instead of clang, so we need to set it explicitly.

contrib/guix/libexec/build.sh Show resolved Hide resolved
Comment on lines -49 to +57
final_build_id_long+=$($(package)_build_id_long)
final_build_id_long+=:[recipe]:$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type):[deps]$(foreach dep,$($(1)_build_id_deps),$(shell echo ":$(dep)")):[$($(1)_type)_id]:$($($(1)_type)_id_string):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Increase verbosity of final_build_id_long to ease debugging reproducibility issues.

Comment on lines +103 to +104
build_id_string:=$(realpath $(GUIX_ENVIRONMENT))
$(host_arch)_$(host_os)_id_string:=$(realpath $(GUIX_ENVIRONMENT))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any change to manifest.scm invalidates the cache.

@tobtoht tobtoht force-pushed the guix branch 2 times, most recently from b824f18 to dfd23c0 Compare August 11, 2024 11:25
fetch-depth: 0
submodules: recursive
- name: remove bundled packages
run: sudo rm -rf /usr/local
Copy link
Collaborator

Choose a reason for hiding this comment

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

Quick question. Do we need this if we are building with GUIX? Since the premise of GUIX is sandboxed builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just to free up disk space. See monero-project/monero-gui#4223


jobs:
cache-sources:
runs-on: ubuntu-24.04
Copy link

Choose a reason for hiding this comment

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

Should we switch to debian (12)?

Copy link
Contributor Author

@tobtoht tobtoht Aug 11, 2024

Choose a reason for hiding this comment

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

Oh, that might fix the AppArmor issue. Good suggestion, will try.

Nvm, GitHub only has Linux runners for Ubuntu.

@tobtoht tobtoht force-pushed the guix branch 2 times, most recently from a3d0081 to ee3782d Compare August 13, 2024 17:24
@tobtoht
Copy link
Contributor Author

tobtoht commented Aug 13, 2024

$ uname --machine && find guix/guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
x86_64
dcf87fdab805f5a0bb77e9656024caed41330c30c3ccc35efd02fbfd3a02dd3a  guix/guix-build-ee3782d83251/output/aarch64-apple-darwin/monero-aarch64-apple-darwin-ee3782d83251.tar.bz2
150cfc02d909ef604eec0a9494538ff8344cf430dec9308a0ab785d028200832  guix/guix-build-ee3782d83251/output/aarch64-linux-gnu/monero-aarch64-linux-gnu-ee3782d83251.tar.bz2
63130e0275501be716181d2c749f8d41d51a9986389243a0a0ab5391c9755c9b  guix/guix-build-ee3782d83251/output/arm-linux-gnueabihf/monero-arm-linux-gnueabihf-ee3782d83251.tar.bz2
e53cdca1094e7059dc2603fcc157b7b9ed9dd753c623259a08e3f80282a1a6a5  guix/guix-build-ee3782d83251/output/dist-archive/monero-source-ee3782d83251.tar.gz
fc58e7c0655d6af309fbdd0e7e3c1507a370767a41428f1b40b99d53ac9b32be  guix/guix-build-ee3782d83251/output/i686-linux-gnu/monero-i686-linux-gnu-ee3782d83251.tar.bz2
12433286439b89b4fa9f4da3565b3ed5394be019653b689c57f9679fe6e904b5  guix/guix-build-ee3782d83251/output/i686-w64-mingw32/monero-i686-w64-mingw32-ee3782d83251.zip
aaeeba15997fbe2e972376e3e8cf3ac171296805d46f84c64e0b92dbd008def5  guix/guix-build-ee3782d83251/output/riscv64-linux-gnu/monero-riscv64-linux-gnu-ee3782d83251.tar.bz2
2b88cd8204c49ebb84e5612ad45c16a7f9d5ddd4acee8323ad27a04b165481d6  guix/guix-build-ee3782d83251/output/x86_64-apple-darwin/monero-x86_64-apple-darwin-ee3782d83251.tar.bz2
d619cf45fbf40b897a2b335ecba4010f3435548ce379ee71bc864024b647264a  guix/guix-build-ee3782d83251/output/x86_64-linux-gnu/monero-x86_64-linux-gnu-ee3782d83251.tar.bz2
04d2fca7317c6b3ba8e3781b3ca21c4adf12f12f31d1d51e1930bb4567622ae1  guix/guix-build-ee3782d83251/output/x86_64-w64-mingw32/monero-x86_64-w64-mingw32-ee3782d83251.zip

aarch64
dcf87fdab805f5a0bb77e9656024caed41330c30c3ccc35efd02fbfd3a02dd3a  guix/guix-build-ee3782d83251/output/aarch64-apple-darwin/monero-aarch64-apple-darwin-ee3782d83251.tar.bz2
150cfc02d909ef604eec0a9494538ff8344cf430dec9308a0ab785d028200832  guix/guix-build-ee3782d83251/output/aarch64-linux-gnu/monero-aarch64-linux-gnu-ee3782d83251.tar.bz2
63130e0275501be716181d2c749f8d41d51a9986389243a0a0ab5391c9755c9b  guix/guix-build-ee3782d83251/output/arm-linux-gnueabihf/monero-arm-linux-gnueabihf-ee3782d83251.tar.bz2
e53cdca1094e7059dc2603fcc157b7b9ed9dd753c623259a08e3f80282a1a6a5  guix/guix-build-ee3782d83251/output/dist-archive/monero-source-ee3782d83251.tar.gz
fc58e7c0655d6af309fbdd0e7e3c1507a370767a41428f1b40b99d53ac9b32be  guix/guix-build-ee3782d83251/output/i686-linux-gnu/monero-i686-linux-gnu-ee3782d83251.tar.bz2
12433286439b89b4fa9f4da3565b3ed5394be019653b689c57f9679fe6e904b5  guix/guix-build-ee3782d83251/output/i686-w64-mingw32/monero-i686-w64-mingw32-ee3782d83251.zip
aaeeba15997fbe2e972376e3e8cf3ac171296805d46f84c64e0b92dbd008def5  guix/guix-build-ee3782d83251/output/riscv64-linux-gnu/monero-riscv64-linux-gnu-ee3782d83251.tar.bz2
2b88cd8204c49ebb84e5612ad45c16a7f9d5ddd4acee8323ad27a04b165481d6  guix/guix-build-ee3782d83251/output/x86_64-apple-darwin/monero-x86_64-apple-darwin-ee3782d83251.tar.bz2
d619cf45fbf40b897a2b335ecba4010f3435548ce379ee71bc864024b647264a  guix/guix-build-ee3782d83251/output/x86_64-linux-gnu/monero-x86_64-linux-gnu-ee3782d83251.tar.bz2
04d2fca7317c6b3ba8e3781b3ca21c4adf12f12f31d1d51e1930bb4567622ae1  guix/guix-build-ee3782d83251/output/x86_64-w64-mingw32/monero-x86_64-w64-mingw32-ee3782d83251.zip

Matching hashes for Linux, Windows, and macOS targets on x86_64 and aarch64 based machines.

@tobtoht tobtoht mentioned this pull request Aug 17, 2024
12 tasks
@plowsof
Copy link
Contributor

plowsof commented Aug 19, 2024

$ uname --machine && find guix/guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
x86_64
dcf87fdab805f5a0bb77e9656024caed41330c30c3ccc35efd02fbfd3a02dd3a  guix/guix-build-ee3782d83251/output/aarch64-apple-darwin/monero-aarch64-apple-darwin-ee3782d83251.tar.bz2
759bc05137dc076e846455ebbbcbbb6e419e52edb23fc53e40367fd782f2080f  guix/guix-build-ee3782d83251/output/aarch64-linux-android/monero-aarch64-linux-android-ee3782d83251.tar.bz2
150cfc02d909ef604eec0a9494538ff8344cf430dec9308a0ab785d028200832  guix/guix-build-ee3782d83251/output/aarch64-linux-gnu/monero-aarch64-linux-gnu-ee3782d83251.tar.bz2
14fb0cdd6c65bc8d91df5c2f6deccd94ab261d8a0d7825d401005ed702da0785  guix/guix-build-ee3782d83251/output/arm-linux-androideabi/monero-arm-linux-androideabi-ee3782d83251.tar.bz2
63130e0275501be716181d2c749f8d41d51a9986389243a0a0ab5391c9755c9b  guix/guix-build-ee3782d83251/output/arm-linux-gnueabihf/monero-arm-linux-gnueabihf-ee3782d83251.tar.bz2
e53cdca1094e7059dc2603fcc157b7b9ed9dd753c623259a08e3f80282a1a6a5  guix/guix-build-ee3782d83251/output/dist-archive/monero-source-ee3782d83251.tar.gz
fc58e7c0655d6af309fbdd0e7e3c1507a370767a41428f1b40b99d53ac9b32be  guix/guix-build-ee3782d83251/output/i686-linux-gnu/monero-i686-linux-gnu-ee3782d83251.tar.bz2
12433286439b89b4fa9f4da3565b3ed5394be019653b689c57f9679fe6e904b5  guix/guix-build-ee3782d83251/output/i686-w64-mingw32/monero-i686-w64-mingw32-ee3782d83251.zip
aaeeba15997fbe2e972376e3e8cf3ac171296805d46f84c64e0b92dbd008def5  guix/guix-build-ee3782d83251/output/riscv64-linux-gnu/monero-riscv64-linux-gnu-ee3782d83251.tar.bz2
2b88cd8204c49ebb84e5612ad45c16a7f9d5ddd4acee8323ad27a04b165481d6  guix/guix-build-ee3782d83251/output/x86_64-apple-darwin/monero-x86_64-apple-darwin-ee3782d83251.tar.bz2
d619cf45fbf40b897a2b335ecba4010f3435548ce379ee71bc864024b647264a  guix/guix-build-ee3782d83251/output/x86_64-linux-gnu/monero-x86_64-linux-gnu-ee3782d83251.tar.bz2
29558458e02045d43ca0d79322a09c284f101f965eb487e078361c60163e190c  guix/guix-build-ee3782d83251/output/x86_64-unknown-freebsd/monero-x86_64-unknown-freebsd-ee3782d83251.tar.bz2
04d2fca7317c6b3ba8e3781b3ca21c4adf12f12f31d1d51e1930bb4567622ae1  guix/guix-build-ee3782d83251/output/x86_64-w64-mingw32/monero-x86_64-w64-mingw32-ee3782d83251.zip

@iamamyth
Copy link

Quite a few of the inline comments on github would perhaps better aid future maintainers as source code comments (if it's non-trivial enough to comment, why confine the comments to github, rather than the actual source?)

@tobtoht
Copy link
Contributor Author

tobtoht commented Sep 1, 2024

Guix core-updates got merged yesterday, which bumped binutils to 2.41, which we'll need for #9440, so I have updated the time-machine. Another notable change is GCC 12.3.0 -> 12.4.0.

I have also added comments to the source where useful, as was suggested by @iamamyth.

Build failures:

Edit: I'd rather not patch clang as that would add a lot of extra build time for builders that use substitutes and updating clang is too involved for this PR, so I'm reverting the time-machine bump and rolling it into a separate PR.

@tobtoht
Copy link
Contributor Author

tobtoht commented Sep 2, 2024

$ uname --machine && find guix/guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
x86_64
8c3eb08d2412def637133c1fc03e3edbd030f77a79845312a05ad16a5936991b  guix/guix-build-f0800bf7ab91/output/aarch64-apple-darwin/monero-aarch64-apple-darwin-f0800bf7ab91.tar.bz2
790639688682dee168f4485a2a4c85cad93268c6502e513a8bfa77c83b9be2af  guix/guix-build-f0800bf7ab91/output/aarch64-linux-android/monero-aarch64-linux-android-f0800bf7ab91.tar.bz2
8291dff3d6ca0cac5a6896a2436745745e699ffa09d38bee398c9643127dd399  guix/guix-build-f0800bf7ab91/output/aarch64-linux-gnu/monero-aarch64-linux-gnu-f0800bf7ab91.tar.bz2
7ce9149eae71c5d39914f0f437f411667505f09d00852a8f2be1daac2098a220  guix/guix-build-f0800bf7ab91/output/arm-linux-androideabi/monero-arm-linux-androideabi-f0800bf7ab91.tar.bz2
ba2bf86383bc3b7447a2240477b17811d8e8ce46957139a8364927fec09401ab  guix/guix-build-f0800bf7ab91/output/arm-linux-gnueabihf/monero-arm-linux-gnueabihf-f0800bf7ab91.tar.bz2
7e82c5890574510ecfae041df8e171331cb850e650058f9d31c983fd1cea480a  guix/guix-build-f0800bf7ab91/output/dist-archive/monero-source-f0800bf7ab91.tar.gz
59e6ff448fdb5392c9963471fe06c014d66ffbb184c014ce36e4e0bd2adeda36  guix/guix-build-f0800bf7ab91/output/i686-linux-gnu/monero-i686-linux-gnu-f0800bf7ab91.tar.bz2
611c45fbdc93e7f98c291a91b8f9b7399e968890222a5e1c272f3b69922c0815  guix/guix-build-f0800bf7ab91/output/i686-w64-mingw32/monero-i686-w64-mingw32-f0800bf7ab91.zip
73a0146612932f15acbfe215b6d23228bf15fa6b9f18129f170f917adfb0dad2  guix/guix-build-f0800bf7ab91/output/riscv64-linux-gnu/monero-riscv64-linux-gnu-f0800bf7ab91.tar.bz2
005eca51f1c9312d73440bb49b99d61e0d47fcafdc21c85d473433a9d3e0d50c  guix/guix-build-f0800bf7ab91/output/x86_64-apple-darwin/monero-x86_64-apple-darwin-f0800bf7ab91.tar.bz2
7889b1aa4d87607aa295535c54aa3dff35c1d9af1f7134cd607c4ebafdc3c94e  guix/guix-build-f0800bf7ab91/output/x86_64-linux-gnu/monero-x86_64-linux-gnu-f0800bf7ab91.tar.bz2
be3df6507f5a1ff45134524582b0c430053cf5bb2d04849e4b313d93463ee4a4  guix/guix-build-f0800bf7ab91/output/x86_64-unknown-freebsd/monero-x86_64-unknown-freebsd-f0800bf7ab91.tar.bz2
e2d45a1f2cfff9fecfd45befeb748a1fbcf5206dad8171b966a40edca1653c36  guix/guix-build-f0800bf7ab91/output/x86_64-w64-mingw32/monero-x86_64-w64-mingw32-f0800bf7ab91.zip

aarch64
8c3eb08d2412def637133c1fc03e3edbd030f77a79845312a05ad16a5936991b  guix/guix-build-f0800bf7ab91/output/aarch64-apple-darwin/monero-aarch64-apple-darwin-f0800bf7ab91.tar.bz2
8291dff3d6ca0cac5a6896a2436745745e699ffa09d38bee398c9643127dd399  guix/guix-build-f0800bf7ab91/output/aarch64-linux-gnu/monero-aarch64-linux-gnu-f0800bf7ab91.tar.bz2
ba2bf86383bc3b7447a2240477b17811d8e8ce46957139a8364927fec09401ab  guix/guix-build-f0800bf7ab91/output/arm-linux-gnueabihf/monero-arm-linux-gnueabihf-f0800bf7ab91.tar.bz2
7e82c5890574510ecfae041df8e171331cb850e650058f9d31c983fd1cea480a  guix/guix-build-f0800bf7ab91/output/dist-archive/monero-source-f0800bf7ab91.tar.gz
59e6ff448fdb5392c9963471fe06c014d66ffbb184c014ce36e4e0bd2adeda36  guix/guix-build-f0800bf7ab91/output/i686-linux-gnu/monero-i686-linux-gnu-f0800bf7ab91.tar.bz2
611c45fbdc93e7f98c291a91b8f9b7399e968890222a5e1c272f3b69922c0815  guix/guix-build-f0800bf7ab91/output/i686-w64-mingw32/monero-i686-w64-mingw32-f0800bf7ab91.zip
73a0146612932f15acbfe215b6d23228bf15fa6b9f18129f170f917adfb0dad2  guix/guix-build-f0800bf7ab91/output/riscv64-linux-gnu/monero-riscv64-linux-gnu-f0800bf7ab91.tar.bz2
005eca51f1c9312d73440bb49b99d61e0d47fcafdc21c85d473433a9d3e0d50c  guix/guix-build-f0800bf7ab91/output/x86_64-apple-darwin/monero-x86_64-apple-darwin-f0800bf7ab91.tar.bz2
7889b1aa4d87607aa295535c54aa3dff35c1d9af1f7134cd607c4ebafdc3c94e  guix/guix-build-f0800bf7ab91/output/x86_64-linux-gnu/monero-x86_64-linux-gnu-f0800bf7ab91.tar.bz2
e2d45a1f2cfff9fecfd45befeb748a1fbcf5206dad8171b966a40edca1653c36  guix/guix-build-f0800bf7ab91/output/x86_64-w64-mingw32/monero-x86_64-w64-mingw32-f0800bf7ab91.zip

Matches GitHub CI.

@SChernykh
Copy link
Contributor

This is what I got:

x86_64
8c3eb08d2412def637133c1fc03e3edbd030f77a79845312a05ad16a5936991b  guix/guix-build-f0800bf7ab91/output/aarch64-apple-darwin/monero-aarch64-apple-darwin-f0800bf7ab91.tar.bz2
790639688682dee168f4485a2a4c85cad93268c6502e513a8bfa77c83b9be2af  guix/guix-build-f0800bf7ab91/output/aarch64-linux-android/monero-aarch64-linux-android-f0800bf7ab91.tar.bz2
8291dff3d6ca0cac5a6896a2436745745e699ffa09d38bee398c9643127dd399  guix/guix-build-f0800bf7ab91/output/aarch64-linux-gnu/monero-aarch64-linux-gnu-f0800bf7ab91.tar.bz2
7ce9149eae71c5d39914f0f437f411667505f09d00852a8f2be1daac2098a220  guix/guix-build-f0800bf7ab91/output/arm-linux-androideabi/monero-arm-linux-androideabi-f0800bf7ab91.tar.bz2
ba2bf86383bc3b7447a2240477b17811d8e8ce46957139a8364927fec09401ab  guix/guix-build-f0800bf7ab91/output/arm-linux-gnueabihf/monero-arm-linux-gnueabihf-f0800bf7ab91.tar.bz2
7e82c5890574510ecfae041df8e171331cb850e650058f9d31c983fd1cea480a  guix/guix-build-f0800bf7ab91/output/dist-archive/monero-source-f0800bf7ab91.tar.gz
59e6ff448fdb5392c9963471fe06c014d66ffbb184c014ce36e4e0bd2adeda36  guix/guix-build-f0800bf7ab91/output/i686-linux-gnu/monero-i686-linux-gnu-f0800bf7ab91.tar.bz2
611c45fbdc93e7f98c291a91b8f9b7399e968890222a5e1c272f3b69922c0815  guix/guix-build-f0800bf7ab91/output/i686-w64-mingw32/monero-i686-w64-mingw32-f0800bf7ab91.zip
73a0146612932f15acbfe215b6d23228bf15fa6b9f18129f170f917adfb0dad2  guix/guix-build-f0800bf7ab91/output/riscv64-linux-gnu/monero-riscv64-linux-gnu-f0800bf7ab91.tar.bz2
005eca51f1c9312d73440bb49b99d61e0d47fcafdc21c85d473433a9d3e0d50c  guix/guix-build-f0800bf7ab91/output/x86_64-apple-darwin/monero-x86_64-apple-darwin-f0800bf7ab91.tar.bz2
7889b1aa4d87607aa295535c54aa3dff35c1d9af1f7134cd607c4ebafdc3c94e  guix/guix-build-f0800bf7ab91/output/x86_64-linux-gnu/monero-x86_64-linux-gnu-f0800bf7ab91.tar.bz2
be3df6507f5a1ff45134524582b0c430053cf5bb2d04849e4b313d93463ee4a4  guix/guix-build-f0800bf7ab91/output/x86_64-unknown-freebsd/monero-x86_64-unknown-freebsd-f0800bf7ab91.tar.bz2
e2d45a1f2cfff9fecfd45befeb748a1fbcf5206dad8171b966a40edca1653c36  guix/guix-build-f0800bf7ab91/output/x86_64-w64-mingw32/monero-x86_64-w64-mingw32-f0800bf7ab91.zip

@DiosDelRayo
Copy link

JOBS=4 time ./contrib/guix/guix-build
....
building fonts directory...
building directory of Info manuals...
building profile with 32 packages...
guix environment: error: mount: mount "none" on "/tmp/guix-directory.Ile657": Permission denied
Command exited with non-zero status 1
1165.33user 44.35system 1:44:14elapsed 19%CPU (0avgtext+0avgdata 725688maxresident)k
526232inputs+3649664outputs (5937major+2972342minor)pagefaults 0swaps

Should I try to find the issue, simply run again or wait?

Do you need some additional input besides (k)ubuntu 24.04 based on debian version trixie/sid?

@tobtoht
Copy link
Contributor Author

tobtoht commented Sep 2, 2024

@DiosDelRayo Oh, that's annoying. It's this Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/guix/+bug/2064115

Let me check if there is a reliable workaround / fix.

Edit: the solution here works: https://bugs.launchpad.net/ubuntu/+source/guix/+bug/2064115/comments/2

# in a root shell

$ apt install apparmor-utils
$ cat <<EOL >> /etc/apparmor.d/guix
abi <abi/4.0>,
include <tunables/global>

profile guix /usr/bin/guix flags=(unconfined) {
  userns,
  include if exists <local/guix>
}
EOL

$ /etc/init.d/apparmor reload
$ aa-enforce guix

@plowsof
Copy link
Contributor

plowsof commented Sep 3, 2024

uname --machine && find guix/guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
x86_64
8c3eb08d2412def637133c1fc03e3edbd030f77a79845312a05ad16a5936991b  guix/guix-build-f0800bf7ab91/output/aarch64-apple-darwin/monero-aarch64-apple-darwin-f0800bf7ab91.tar.bz2
790639688682dee168f4485a2a4c85cad93268c6502e513a8bfa77c83b9be2af  guix/guix-build-f0800bf7ab91/output/aarch64-linux-android/monero-aarch64-linux-android-f0800bf7ab91.tar.bz2
8291dff3d6ca0cac5a6896a2436745745e699ffa09d38bee398c9643127dd399  guix/guix-build-f0800bf7ab91/output/aarch64-linux-gnu/monero-aarch64-linux-gnu-f0800bf7ab91.tar.bz2
7ce9149eae71c5d39914f0f437f411667505f09d00852a8f2be1daac2098a220  guix/guix-build-f0800bf7ab91/output/arm-linux-androideabi/monero-arm-linux-androideabi-f0800bf7ab91.tar.bz2
ba2bf86383bc3b7447a2240477b17811d8e8ce46957139a8364927fec09401ab  guix/guix-build-f0800bf7ab91/output/arm-linux-gnueabihf/monero-arm-linux-gnueabihf-f0800bf7ab91.tar.bz2
7e82c5890574510ecfae041df8e171331cb850e650058f9d31c983fd1cea480a  guix/guix-build-f0800bf7ab91/output/dist-archive/monero-source-f0800bf7ab91.tar.gz
59e6ff448fdb5392c9963471fe06c014d66ffbb184c014ce36e4e0bd2adeda36  guix/guix-build-f0800bf7ab91/output/i686-linux-gnu/monero-i686-linux-gnu-f0800bf7ab91.tar.bz2
611c45fbdc93e7f98c291a91b8f9b7399e968890222a5e1c272f3b69922c0815  guix/guix-build-f0800bf7ab91/output/i686-w64-mingw32/monero-i686-w64-mingw32-f0800bf7ab91.zip
73a0146612932f15acbfe215b6d23228bf15fa6b9f18129f170f917adfb0dad2  guix/guix-build-f0800bf7ab91/output/riscv64-linux-gnu/monero-riscv64-linux-gnu-f0800bf7ab91.tar.bz2
005eca51f1c9312d73440bb49b99d61e0d47fcafdc21c85d473433a9d3e0d50c  guix/guix-build-f0800bf7ab91/output/x86_64-apple-darwin/monero-x86_64-apple-darwin-f0800bf7ab91.tar.bz2
7889b1aa4d87607aa295535c54aa3dff35c1d9af1f7134cd607c4ebafdc3c94e  guix/guix-build-f0800bf7ab91/output/x86_64-linux-gnu/monero-x86_64-linux-gnu-f0800bf7ab91.tar.bz2
be3df6507f5a1ff45134524582b0c430053cf5bb2d04849e4b313d93463ee4a4  guix/guix-build-f0800bf7ab91/output/x86_64-unknown-freebsd/monero-x86_64-unknown-freebsd-f0800bf7ab91.tar.bz2
e2d45a1f2cfff9fecfd45befeb748a1fbcf5206dad8171b966a40edca1653c36  guix/guix-build-f0800bf7ab91/output/x86_64-w64-mingw32/monero-x86_64-w64-mingw32-f0800bf7ab91.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants