unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32184: ‘guix pack --bootstrap’ is ineffective
@ 2018-07-17  9:24 Ludovic Courtès
  2018-07-18  6:11 ` Chris Marusich
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2018-07-17  9:24 UTC (permalink / raw)
  To: 32184

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

Hello,

While preparing the 0.15 release I realized that ‘guix pack --bootstrap’
had become ineffective.  Concretely, ‘tests/guix-pack.sh’ would attempt
to build the world.

This is a consequence of c45477d2a1a651485feede20fe0f3d15aec48b39, which
introduced a dependency on guile-sqlite3 in derivations that build
packs, even if they don’t actually produce a ‘db.sqlite’ file in there.

I started looking for solutions, which led me to the patch below.
That’s quite intrusive and it doesn’t work because then we have a
similar issue with (guix hash) trying to dlopen libgcrypt.

I’m not sure how to best address it.  Another approach would be to do
away with ‘--bootstrap’ and instead write those tests as “system tests”
in a VM, though that’s maybe less satisfactory.

Thoughts?

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2728 bytes --]

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 6d5d745bc..45eeb2e7b 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -98,8 +98,25 @@ found."
 
 (define guile-sqlite3&co
   ;; Guile-SQLite3 and its propagated inputs.
-  (cons guile-sqlite3
-        (package-transitive-propagated-inputs guile-sqlite3)))
+  (make-parameter
+   (cons guile-sqlite3
+         (package-transitive-propagated-inputs guile-sqlite3))))
+
+(define guile-sqlite3/mock
+  ;; Mock of Guile-SQLite3 used by '--bootstrap', for testing purposes.
+  (computed-file "guile-sqlite3-mock"
+                 (with-imported-modules '((guix build utils))
+                   #~(begin
+                       (use-modules (guix build utils))
+
+                       (let ((modules (string-append
+                                       #$output "/share/guile/site/2.0")))
+                         (mkdir-p modules)
+                         (call-with-output-file (string-append modules
+                                                               "/sqlite3.scm")
+                           (lambda (port)
+                             (display "(define-module (sqlite3))\n" port))))))
+                 #:guile %bootstrap-guile))
 
 (define* (self-contained-tarball name profile
                                  #:key target
@@ -134,7 +151,7 @@ added to the pack."
                                   (guix build store-copy)
                                   (gnu build install))
                                 #:select? not-config?))
-      (with-extensions guile-sqlite3&co
+      (with-extensions (guile-sqlite3&co)
         #~(begin
             (use-modules (guix build utils)
                          ((guix build union) #:select (relative-file-name))
@@ -267,7 +284,7 @@ added to the pack."
                                   (guix build store-copy)
                                   (gnu build install))
                                 #:select? not-config?))
-      (with-extensions guile-sqlite3&co
+      (with-extensions (guile-sqlite3&co)
         #~(begin
             (use-modules (guix build utils)
                          (gnu build install)
@@ -717,6 +734,9 @@ Create a bundle of PACKAGE.\n"))
       (set-build-options-from-command-line store opts)
 
       (parameterize ((%graft? (assoc-ref opts 'graft?))
+                     (guile-sqlite3&co (if (assoc-ref opts 'bootstrap?)
+                                           (list guile-sqlite3/mock)
+                                           (guile-sqlite3&co)))
                      (%guile-for-build (package-derivation
                                         store
                                         (if (assoc-ref opts 'bootstrap?)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-19 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17  9:24 bug#32184: ‘guix pack --bootstrap’ is ineffective Ludovic Courtès
2018-07-18  6:11 ` Chris Marusich
2018-07-26 13:26   ` Ludovic Courtès
2018-10-19 16:43   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).