guix, depends: Omit `GUIX_ENVIRONMENT` from `gen_id` calculations #35929

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:260807-guix-depends changing 2 files +4 −2
  1. hebasto commented at 1:22 PM on August 7, 2026: member

    This PR fixes a performance regression noticed during the review of #35537.

    Since commit 008a3e29c8844c0be4457279f5c27c1bc57401c7 ("guix: split builds into Linux(gui) and macOS/Windows"), each host is built in two containers: one instantiated from manifest_build.scm and the other from the union of manifest_build.scm and manifest_gui.scm. The resulting Guix profiles necessarily differ, and because $(realpath $(GUIX_ENVIRONMENT)) is hashed into every depends package id, the built-package cache is invalidated whenever the profile changes:

    1. All non-GUI packages are built twice per host, as the GUI container cannot reuse the packages just cached by the base container.
    2. All depends are rebuilt when switching to another branch with identical Guix scripts and the depends subdirectory.

    Drop GUIX_ENVIRONMENT from the gen_id inputs. The toolchain remains fully accounted for: the verbose compiler output hashed by gen_id embeds the store paths of the toolchain packages themselves, so any change to the toolchain still invalidates the cache. Given the pinned time-machine commit and the manifests, the only remaining user-provided inputs that can alter the build environment are the ADDITIONAL_GUIX_*_FLAGS, which are now conservatively folded into the ids by passing them to gen_id via the {BUILD,HOST}_ID_SALT variables.

    Related: #34228.

  2. guix, depends: Omit `GUIX_ENVIRONMENT` from `gen_id` calculations
    Since commit 008a3e29c8844c0be4457279f5c27c1bc57401c7 ("guix: split
    builds into Linux(gui) and macOS/Windows"), each host is built in two
    containers: one instantiated from `manifest_build.scm` and the other
    from the union of `manifest_build.scm` and `manifest_gui.scm`. The
    resulting Guix profiles necessarily differ, and because
    `$(realpath $(GUIX_ENVIRONMENT))` is hashed into every depends package
    id, the built-package cache is invalidated whenever the profile
    changes:
    1. All non-GUI packages are built twice per host, as the GUI container
       cannot reuse the packages just cached by the base container.
    2. All depends are rebuilt when switching to another branch with
       identical Guix scripts and the depends subdirectory.
    
    Drop `GUIX_ENVIRONMENT` from the `gen_id` inputs. The toolchain remains
    fully accounted for: the verbose compiler output hashed by `gen_id`
    embeds the store paths of the toolchain packages themselves, so any
    change to the toolchain still invalidates the cache. Given the pinned
    time-machine commit and the manifests, the only remaining user-provided
    inputs that can alter the build environment are the
    `ADDITIONAL_GUIX_*_FLAGS`, which are now conservatively folded into the
    ids by passing them to `gen_id` via the `{BUILD,HOST}_ID_SALT`
    variables.
    488f4e1bd8
  3. hebasto added the label Build system on Aug 7, 2026
  4. DrahtBot commented at 1:22 PM on August 7, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35929.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. hebasto added this to the milestone 32.0 on Aug 7, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-10 21:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me