guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: environment: Disable profile collision checks.


From: Ludovic Courtès
Subject: 03/03: environment: Disable profile collision checks.
Date: Wed, 21 Jun 2017 10:53:47 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit afd06f605bf88a796acefc7ed598b43879346a6b
Author: Ludovic Courtès <address@hidden>
Date:   Wed Jun 21 16:50:59 2017 +0200

    environment: Disable profile collision checks.
    
    Reported by Efraim Flashner.
    This is a followup to a654dc4bcf7c8e205bdefa1a1d5f23444dd22778.
    
    * 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".
---
 guix/profiles.scm            | 10 ++++++++--
 guix/scripts/environment.scm |  7 +++++++
 tests/guix-environment.sh    |  4 ++++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 0c70975..dcb5186 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1199,10 +1199,14 @@ the entries in MANIFEST."
                              #:key
                              (hooks %default-profile-hooks)
                              (locales? #t)
+                             (allow-collisions? #f)
                              system target)
   "Return a derivation that builds a profile (aka. 'user environment') with
 the given MANIFEST.  The profile includes additional derivations returned by
 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
 a dependency on the 'glibc-utf8-locales' package.
@@ -1212,8 +1216,10 @@ are cross-built for TARGET."
   (mlet* %store-monad ((system (if system
                                    (return system)
                                    (current-system)))
-                       (ok?    (check-for-collisions manifest system
-                                                     #:target target))
+                       (ok?    (if allow-collisions?
+                                   (return #t)
+                                   (check-for-collisions manifest system
+                                                         #:target target)))
                        (extras (if (null? (manifest-entries manifest))
                                    (return '())
                                    (sequence %store-monad
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index af69e2b..0abc509 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -323,6 +323,13 @@ BOOTSTRAP?  specifies whether to use the bootstrap Guile 
to build the
 profile."
   (profile-derivation (packages->manifest inputs)
                       #: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?
                                   '()
                                   %default-profile-hooks)
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index 9115949..bf5ca17 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -105,6 +105,10 @@ else
     test $? = 42
 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
 then
     # Compute the build environment for the initial GNU Make.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]