summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-03-08 12:53:20 +0100
committerLudovic Courtès <ludo@gnu.org>2023-03-13 15:08:33 +0100
commiteee95b5a879b7096dffd533f24107cf8926b621e (patch)
treeb6cef032a6e3a103374bfd0cf47bf2ad8046ed0c /doc
parent5dd0d7f99f4a71a6ed4a2dab66d32e4b7ed2b70c (diff)
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')
-rw-r--r--doc/guix.texi21
1 files changed, 12 insertions, 9 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 3814e604679..95c954bfcf9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8331,10 +8331,13 @@ be replaced by name rather than by identity.
8331@deffn {Scheme Procedure} package-input-rewriting/spec @var{replacements} [#:deep? #t] 8331@deffn {Scheme Procedure} package-input-rewriting/spec @var{replacements} [#:deep? #t]
8332Return a procedure that, given a package, applies the given 8332Return a procedure that, given a package, applies the given
8333@var{replacements} to all the package graph, including implicit inputs 8333@var{replacements} to all the package graph, including implicit inputs
8334unless @var{deep?} is false. @var{replacements} is a list of 8334unless @var{deep?} is false.
8335spec/procedures pair; each spec is a package specification such as 8335
8336@code{"gcc"} or @code{"guile@@2"}, and each procedure takes a matching 8336@var{replacements} is a list of spec/procedures pair; each spec is a
8337package and returns a replacement for that package. 8337package specification such as @code{"gcc"} or @code{"guile@@2"}, and
8338each procedure takes a matching package and returns a replacement for
8339that package. Matching packages that have the @code{hidden?} property
8340set are not replaced.
8338@end deffn 8341@end deffn
8339 8342
8340The example above could be rewritten this way: 8343The example above could be rewritten this way:
@@ -12664,18 +12667,18 @@ or @code{guile@@1.8}.
12664 12667
12665For instance, the following command builds Guix, but replaces its 12668For instance, the following command builds Guix, but replaces its
12666dependency on the current stable version of Guile with a dependency on 12669dependency on the current stable version of Guile with a dependency on
12667the legacy version of Guile, @code{guile@@2.0}: 12670the legacy version of Guile, @code{guile@@2.2}:
12668 12671
12669@example 12672@example
12670guix build --with-input=guile=guile@@2.0 guix 12673guix build --with-input=guile=guile@@2.2 guix
12671@end example 12674@end example
12672 12675
12673This is a recursive, deep replacement. So in this example, both 12676This is a recursive, deep replacement. So in this example, both
12674@code{guix} and its dependency @code{guile-json} (which also depends on 12677@code{guix} and its dependency @code{guile-json} (which also depends on
12675@code{guile}) get rebuilt against @code{guile@@2.0}. 12678@code{guile}) get rebuilt against @code{guile@@2.2}.
12676 12679
12677This is implemented using the @code{package-input-rewriting} Scheme 12680This is implemented using the @code{package-input-rewriting/spec} Scheme
12678procedure (@pxref{Defining Packages, @code{package-input-rewriting}}). 12681procedure (@pxref{Defining Packages, @code{package-input-rewriting/spec}}).
12679 12682
12680@item --with-graft=@var{package}=@var{replacement} 12683@item --with-graft=@var{package}=@var{replacement}
12681This is similar to @option{--with-input} but with an important difference: 12684This is similar to @option{--with-input} but with an important difference: