diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2021-06-22 16:42:06 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2021-06-22 17:55:05 +0200 |
| commit | b9a95420abdf4ae7fe9a347031278a44ad6a1cce (patch) | |
| tree | 6df8009947a967e7ca756625f4b85b952f874ae0 /tests | |
| parent | c7a5c3e0bba2ac3d197b219d21527863308b75dd (diff) | |
profiles: Build union of inputs in the right order.
Fixes <https://bugs.gnu.org/49102>.
Reported by Mathieu Othacehe <othacehe@gnu.org>
and Tobias Geerinckx-Rice <me@tobias.gr>.
Fixes a regression introduced in
8cef92d0633850d97c1a1d4521812268f56672be, whereby in case of file
collisions, the "wrong" one would take precedence.
* guix/build/profiles.scm (manifest-sexp->inputs+search-paths): Perform
a breadth-first traversal. Reverse INPUTS and SEARCH-PATHS in the base
case.
* tests/profiles.scm ("profile-derivation, ordering & collisions"):
New test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/profiles.scm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm index 1a06ff88f34..06a03872213 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm | |||
| @@ -279,6 +279,36 @@ | |||
| 279 | (string=? (dirname (readlink bindir)) | 279 | (string=? (dirname (readlink bindir)) |
| 280 | (derivation->output-path guile)))))) | 280 | (derivation->output-path guile)))))) |
| 281 | 281 | ||
| 282 | (test-assertm "profile-derivation, ordering & collisions" | ||
| 283 | ;; ENTRY1 and ENTRY2 both provide 'bin/guile'--a collision. Make sure | ||
| 284 | ;; ENTRY1 "wins" over ENTRY2. See <https://bugs.gnu.org/49102>. | ||
| 285 | (mlet* %store-monad | ||
| 286 | ((entry1 -> (package->manifest-entry %bootstrap-guile)) | ||
| 287 | (entry2 -> (manifest-entry | ||
| 288 | (name "fake-guile") | ||
| 289 | (version "0") | ||
| 290 | (item (computed-file | ||
| 291 | "fake-guile" | ||
| 292 | #~(begin | ||
| 293 | (mkdir #$output) | ||
| 294 | (mkdir (string-append #$output "/bin")) | ||
| 295 | (call-with-output-file | ||
| 296 | (string-append #$output "/bin/guile") | ||
| 297 | (lambda (port) | ||
| 298 | (display "Fake!\n" port)))))))) | ||
| 299 | (guile (package->derivation %bootstrap-guile)) | ||
| 300 | (drv (profile-derivation (manifest (list entry1 entry2)) | ||
| 301 | #:hooks '() | ||
| 302 | #:locales? #f)) | ||
| 303 | (profile -> (derivation->output-path drv)) | ||
| 304 | (bindir -> (string-append profile "/bin")) | ||
| 305 | (file -> (string-append bindir "/guile")) | ||
| 306 | (_ (built-derivations (list drv)))) | ||
| 307 | (return (string=? (readlink file) | ||
| 308 | (string-append | ||
| 309 | (derivation->output-path guile) | ||
| 310 | "/bin/guile"))))) | ||
| 311 | |||
| 282 | (test-assertm "load-profile" | 312 | (test-assertm "load-profile" |
| 283 | (mlet* %store-monad | 313 | (mlet* %store-monad |
| 284 | ((entry -> (package->manifest-entry %bootstrap-guile)) | 314 | ((entry -> (package->manifest-entry %bootstrap-guile)) |
