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 | |
| parent | 5dd0d7f99f4a71a6ed4a2dab66d32e4b7ed2b70c (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.texi | 21 |
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] |
| 8332 | Return a procedure that, given a package, applies the given | 8332 | Return 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 |
| 8334 | unless @var{deep?} is false. @var{replacements} is a list of | 8334 | unless @var{deep?} is false. |
| 8335 | spec/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 |
| 8337 | package and returns a replacement for that package. | 8337 | package specification such as @code{"gcc"} or @code{"guile@@2"}, and |
| 8338 | each procedure takes a matching package and returns a replacement for | ||
| 8339 | that package. Matching packages that have the @code{hidden?} property | ||
| 8340 | set are not replaced. | ||
| 8338 | @end deffn | 8341 | @end deffn |
| 8339 | 8342 | ||
| 8340 | The example above could be rewritten this way: | 8343 | The example above could be rewritten this way: |
| @@ -12664,18 +12667,18 @@ or @code{guile@@1.8}. | |||
| 12664 | 12667 | ||
| 12665 | For instance, the following command builds Guix, but replaces its | 12668 | For instance, the following command builds Guix, but replaces its |
| 12666 | dependency on the current stable version of Guile with a dependency on | 12669 | dependency on the current stable version of Guile with a dependency on |
| 12667 | the legacy version of Guile, @code{guile@@2.0}: | 12670 | the legacy version of Guile, @code{guile@@2.2}: |
| 12668 | 12671 | ||
| 12669 | @example | 12672 | @example |
| 12670 | guix build --with-input=guile=guile@@2.0 guix | 12673 | guix build --with-input=guile=guile@@2.2 guix |
| 12671 | @end example | 12674 | @end example |
| 12672 | 12675 | ||
| 12673 | This is a recursive, deep replacement. So in this example, both | 12676 | This 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 | ||
| 12677 | This is implemented using the @code{package-input-rewriting} Scheme | 12680 | This is implemented using the @code{package-input-rewriting/spec} Scheme |
| 12678 | procedure (@pxref{Defining Packages, @code{package-input-rewriting}}). | 12681 | procedure (@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} |
| 12681 | This is similar to @option{--with-input} but with an important difference: | 12684 | This is similar to @option{--with-input} but with an important difference: |
