Skip to content
Snippets Groups Projects
  • Ludovic Courtès's avatar
    2bf6f962
    packages: 'package-input-rewriting/spec' can rewrite implicit dependencies. · 2bf6f962
    Ludovic Courtès authored
    With this change, '--with-input', '--with-graft', etc. also apply to
    implicit dependencies.  Thus, it's now possible to do:
    
      guix build python-itsdangerous --with-input=python-wrapper=python@2
    
    or:
    
      guix build hello --with-graft=glibc=glibc@2.29
    
    Additionally, before, implicit inputs were not rewritten, which could
    lead to duplicates in the output of 'bag-transitive-inputs' (packages
    that are not 'eq?' but lead to the same derivation).  This in turn would
    lead to unnecessary rebuilds when using '--with-input' & co.  This
    change fixes it by ensuring even implicit inputs are rewritten.
    
    Fixes <https://bugs.gnu.org/42156>.
    
    * guix/packages.scm (package-input-rewriting/spec): Add #:deep?
    defaulting to #true, and pass it to 'package-mapping'.
    [replacement-property]: New variable.
    [rewrite]: Check that property and set it on the result of PROC.
    [cut?]: New procedure.
    * tests/packages.scm ("package-input-rewriting/spec"): Ensure implicit
    inputs were unchanged.
    ("package-input-rewriting/spec, partial match"): Pass #:deep? #f.
    ("package-input-rewriting/spec, deep")
    ("package-input-rewriting/spec, no duplicates"): New tests.
    (package/inherit): Move before use.
    * tests/guix-build.sh: Add tests.
    * tests/scripts-build.scm ("options->transformation, with-graft"):
    Compare dependencies by package name or derivation file name.
    * doc/guix.texi (Defining Packages): Adjust accordingly.
    packages: 'package-input-rewriting/spec' can rewrite implicit dependencies.
    Ludovic Courtès authored
    With this change, '--with-input', '--with-graft', etc. also apply to
    implicit dependencies.  Thus, it's now possible to do:
    
      guix build python-itsdangerous --with-input=python-wrapper=python@2
    
    or:
    
      guix build hello --with-graft=glibc=glibc@2.29
    
    Additionally, before, implicit inputs were not rewritten, which could
    lead to duplicates in the output of 'bag-transitive-inputs' (packages
    that are not 'eq?' but lead to the same derivation).  This in turn would
    lead to unnecessary rebuilds when using '--with-input' & co.  This
    change fixes it by ensuring even implicit inputs are rewritten.
    
    Fixes <https://bugs.gnu.org/42156>.
    
    * guix/packages.scm (package-input-rewriting/spec): Add #:deep?
    defaulting to #true, and pass it to 'package-mapping'.
    [replacement-property]: New variable.
    [rewrite]: Check that property and set it on the result of PROC.
    [cut?]: New procedure.
    * tests/packages.scm ("package-input-rewriting/spec"): Ensure implicit
    inputs were unchanged.
    ("package-input-rewriting/spec, partial match"): Pass #:deep? #f.
    ("package-input-rewriting/spec, deep")
    ("package-input-rewriting/spec, no duplicates"): New tests.
    (package/inherit): Move before use.
    * tests/guix-build.sh: Add tests.
    * tests/scripts-build.scm ("options->transformation, with-graft"):
    Compare dependencies by package name or derivation file name.
    * doc/guix.texi (Defining Packages): Adjust accordingly.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.