Skip to content
Snippets Groups Projects
  • Ludovic Courtès's avatar
    e85d4cec
    gnu: commencement: Memoize packages as a function of the system. · e85d4cec
    Ludovic Courtès authored
    Previous, things like 'ld-wrapper-boot0' would be memoized with
    (mlambda () …).  However, the definition of 'ld-wrapper-boot0' depends
    on the result of (%boot0-inputs), which is itself a function
    of (%current-system).  Thus, if one first calls:
    
      (parameterize ((%current-system "x86_64-linux"))
        (ld-wrapper-boot0))
    
    then, in all subsequent calls to 'ld-wrapper-boot0', the value
    of (%current-system) would be ignored because the result is already
    memoized.  Concretely, 'ld-wrapper-boot0' would always have the
    dependencies it has on x86_64-linux, even though they are different than
    those on armhf-linux, say ("bash-mesboot" vs. "bootstrap-binaries").
    
    Fixes <https://bugs.gnu.org/40482>.
    Reported by Marius Bakke <mbakke@fastmail.com>.
    
    * gnu/packages/commencement.scm (define/system-dependent): New macro.
    (linux-libre-headers-boot0, hurd-core-headers-boot0, ld-wrapper-boot0)
    (gcc-boot0-intermediate-wrapped, gcc-boot0-wrapped, ld-wrapper-boot3):
    Define using 'define/system-dependent' instead of 'define' + 'mlambda'.
    Adjust users so they no longer look like procedure calls.
    * tests/guix-build.sh: Add test.
    e85d4cec
    History
    gnu: commencement: Memoize packages as a function of the system.
    Ludovic Courtès authored
    Previous, things like 'ld-wrapper-boot0' would be memoized with
    (mlambda () …).  However, the definition of 'ld-wrapper-boot0' depends
    on the result of (%boot0-inputs), which is itself a function
    of (%current-system).  Thus, if one first calls:
    
      (parameterize ((%current-system "x86_64-linux"))
        (ld-wrapper-boot0))
    
    then, in all subsequent calls to 'ld-wrapper-boot0', the value
    of (%current-system) would be ignored because the result is already
    memoized.  Concretely, 'ld-wrapper-boot0' would always have the
    dependencies it has on x86_64-linux, even though they are different than
    those on armhf-linux, say ("bash-mesboot" vs. "bootstrap-binaries").
    
    Fixes <https://bugs.gnu.org/40482>.
    Reported by Marius Bakke <mbakke@fastmail.com>.
    
    * gnu/packages/commencement.scm (define/system-dependent): New macro.
    (linux-libre-headers-boot0, hurd-core-headers-boot0, ld-wrapper-boot0)
    (gcc-boot0-intermediate-wrapped, gcc-boot0-wrapped, ld-wrapper-boot3):
    Define using 'define/system-dependent' instead of 'define' + 'mlambda'.
    Adjust users so they no longer look like procedure calls.
    * tests/guix-build.sh: Add test.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.