Skip to content
Snippets Groups Projects
Unverified Commit afd06f60 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

environment: Disable profile collision checks.

Reported by Efraim Flashner.
This is a followup to a654dc4b.

* guix/profiles.scm (profile-derivation): Add #:allow-collisions? and
honor it.
* guix/scripts/environment.scm (inputs->profile-derivation): Pass
 #:allow-collisions? #f to 'profile-derivation'.
* tests/guix-environment.sh: Test "guix environment guix".
parent cba988ed
No related branches found
No related tags found
No related merge requests found
...@@ -1199,10 +1199,14 @@ (define* (profile-derivation manifest ...@@ -1199,10 +1199,14 @@ (define* (profile-derivation manifest
#:key #:key
(hooks %default-profile-hooks) (hooks %default-profile-hooks)
(locales? #t) (locales? #t)
(allow-collisions? #f)
system target) system target)
"Return a derivation that builds a profile (aka. 'user environment') with "Return a derivation that builds a profile (aka. 'user environment') with
the given MANIFEST. The profile includes additional derivations returned by the given MANIFEST. The profile includes additional derivations returned by
the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc. the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc.
Unless ALLOW-COLLISIONS? is true, a '&profile-collision-error' is raised if
entries in MANIFEST collide (for instance if there are two same-name packages
with a different version number.)
When LOCALES? is true, the build is performed under a UTF-8 locale; this adds When LOCALES? is true, the build is performed under a UTF-8 locale; this adds
a dependency on the 'glibc-utf8-locales' package. a dependency on the 'glibc-utf8-locales' package.
...@@ -1212,8 +1216,10 @@ (define* (profile-derivation manifest ...@@ -1212,8 +1216,10 @@ (define* (profile-derivation manifest
(mlet* %store-monad ((system (if system (mlet* %store-monad ((system (if system
(return system) (return system)
(current-system))) (current-system)))
(ok? (check-for-collisions manifest system (ok? (if allow-collisions?
#:target target)) (return #t)
(check-for-collisions manifest system
#:target target)))
(extras (if (null? (manifest-entries manifest)) (extras (if (null? (manifest-entries manifest))
(return '()) (return '())
(sequence %store-monad (sequence %store-monad
......
...@@ -323,6 +323,13 @@ (define (inputs->profile-derivation inputs system bootstrap?) ...@@ -323,6 +323,13 @@ (define (inputs->profile-derivation inputs system bootstrap?)
profile." profile."
(profile-derivation (packages->manifest inputs) (profile-derivation (packages->manifest inputs)
#:system system #:system system
;; Packages can have conflicting inputs, or explicit
;; inputs that conflict with implicit inputs (e.g., gcc,
;; gzip, etc.). Thus, do not error out when we
;; encounter collision.
#:allow-collisions? #t
#:hooks (if bootstrap? #:hooks (if bootstrap?
'() '()
%default-profile-hooks) %default-profile-hooks)
......
...@@ -105,6 +105,10 @@ else ...@@ -105,6 +105,10 @@ else
test $? = 42 test $? = 42
fi fi
# Make sure we can build the environment of 'guix'. There may be collisions
# in its profile (e.g., for 'gzip'), but we have to accept them.
guix environment guix --bootstrap -n
if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
then then
# Compute the build environment for the initial GNU Make. # Compute the build environment for the initial GNU Make.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment