diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-12-05 16:32:40 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-12-05 16:32:40 +0100 |
| commit | 91c9b5d016ac8bed127557d378c70fbc56cec0e5 (patch) | |
| tree | 5f2b318d1a857f647406504b69f4122f072eb34a /tests/packages.scm | |
| parent | f3e3f4d934ee0ecd71f5c73a57252ed1d0bad88e (diff) | |
packages: 'package-grafts' trims native inputs.
'package-grafts' returns a list of potentially applicable grafts, which
'cumulative-grafts' then narrows by looking at store item references and
determining the subset of the grafts that's actually applicable.
Until now, 'package-grafts' would traverse native inputs and would thus
return a large superset of the applicable grafts, since native inputs
are not in the reference graph by definition. This patch fixes that by
having 'package-grafts' ignore entirely native inputs from the
dependency graph.
* guix/packages.scm (fold-bag-dependencies)[bag-direct-inputs*]: Add
special case for libc.
* guix/packages.scm (bag-grafts)[native-grafts, target-grafts]: Remove.
[grafts]: New procedure.
Use it.
* tests/packages.scm ("package-grafts, grafts of native inputs
ignored"): New test.
Diffstat (limited to 'tests/packages.scm')
| -rw-r--r-- | tests/packages.scm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm index 930374dabfa..fe7bd1ded69 100644 --- a/tests/packages.scm +++ b/tests/packages.scm | |||
| @@ -660,6 +660,24 @@ | |||
| 660 | ;; (package-cross-derivation %store p "mips64el-linux-gnu" | 660 | ;; (package-cross-derivation %store p "mips64el-linux-gnu" |
| 661 | ;; #:graft? #t))) | 661 | ;; #:graft? #t))) |
| 662 | 662 | ||
| 663 | ;; It doesn't make sense for 'package-grafts' to look at native inputs since, | ||
| 664 | ;; by definition, they are not referenced at run time. Make sure | ||
| 665 | ;; 'package-grafts' respects this. | ||
| 666 | (test-equal "package-grafts, grafts of native inputs ignored" | ||
| 667 | '() | ||
| 668 | (let* ((new (dummy-package "native-dep" | ||
| 669 | (version "0.1") | ||
| 670 | (arguments '(#:implicit-inputs? #f)))) | ||
| 671 | (ndep (package (inherit new) (version "0.0") | ||
| 672 | (replacement new))) | ||
| 673 | (dep (dummy-package "dep" | ||
| 674 | (arguments '(#:implicit-inputs? #f)))) | ||
| 675 | (dummy (dummy-package "dummy" | ||
| 676 | (arguments '(#:implicit-inputs? #f)) | ||
| 677 | (native-inputs `(("ndep" ,ndep))) | ||
| 678 | (inputs `(("dep" ,dep)))))) | ||
| 679 | (package-grafts %store dummy))) | ||
| 680 | |||
| 663 | (test-assert "package-grafts, indirect grafts" | 681 | (test-assert "package-grafts, indirect grafts" |
| 664 | (let* ((new (dummy-package "dep" | 682 | (let* ((new (dummy-package "dep" |
| 665 | (arguments '(#:implicit-inputs? #f)))) | 683 | (arguments '(#:implicit-inputs? #f)))) |
