diff options
author | Ludovic Courtès <ludo@gnu.org> | 2023-03-08 12:53:20 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2023-03-13 15:08:33 +0100 |
commit | eee95b5a879b7096dffd533f24107cf8926b621e (patch) | |
tree | b6cef032a6e3a103374bfd0cf47bf2ad8046ed0c /doc/guix.texi | |
parent | 5dd0d7f99f4a71a6ed4a2dab66d32e4b7ed2b70c (diff) | |
download | guix-eee95b5a879b7096dffd533f24107cf8926b621e.tar.gz |
packages: 'package-input-rewriting/spec' ignores hidden packages.
The primary motivation is to support things like: guix build guix --with-input=guile=guile-next without triggering a rebuild of (@@ (gnu packages commencement) guile-final) and similar things. It is also consistent with package name resolution on the command line: a package that cannot be named cannot be replaced. * guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is hidden, return it as-is. * tests/packages.scm ("package-input-rewriting/spec, hidden package"): New test. * doc/guix.texi (Defining Package Variants): Update. (Package Transformation Options): Update '--with-input' example.
Diffstat (limited to 'doc/guix.texi')
-rw-r--r-- | doc/guix.texi | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 3814e60467..95c954bfcf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8331,10 +8331,13 @@ be replaced by name rather than by identity. @deffn {Scheme Procedure} package-input-rewriting/spec @var{replacements} [#:deep? #t] Return a procedure that, given a package, applies the given @var{replacements} to all the package graph, including implicit inputs -unless @var{deep?} is false. @var{replacements} is a list of -spec/procedures pair; each spec is a package specification such as -@code{"gcc"} or @code{"guile@@2"}, and each procedure takes a matching -package and returns a replacement for that package. +unless @var{deep?} is false. + +@var{replacements} is a list of spec/procedures pair; each spec is a +package specification such as @code{"gcc"} or @code{"guile@@2"}, and +each procedure takes a matching package and returns a replacement for +that package. Matching packages that have the @code{hidden?} property +set are not replaced. @end deffn The example above could be rewritten this way: @@ -12664,18 +12667,18 @@ or @code{guile@@1.8}. For instance, the following command builds Guix, but replaces its dependency on the current stable version of Guile with a dependency on -the legacy version of Guile, @code{guile@@2.0}: +the legacy version of Guile, @code{guile@@2.2}: @example -guix build --with-input=guile=guile@@2.0 guix +guix build --with-input=guile=guile@@2.2 guix @end example This is a recursive, deep replacement. So in this example, both @code{guix} and its dependency @code{guile-json} (which also depends on -@code{guile}) get rebuilt against @code{guile@@2.0}. +@code{guile}) get rebuilt against @code{guile@@2.2}. -This is implemented using the @code{package-input-rewriting} Scheme -procedure (@pxref{Defining Packages, @code{package-input-rewriting}}). +This is implemented using the @code{package-input-rewriting/spec} Scheme +procedure (@pxref{Defining Packages, @code{package-input-rewriting/spec}}). @item --with-graft=@var{package}=@var{replacement} This is similar to @option{--with-input} but with an important difference: |