From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#32184: =?UTF-8?Q?=E2=80=98guix?= pack =?UTF-8?Q?--bootstrap=E2=80=99?= is ineffective Date: Tue, 17 Jul 2018 11:24:32 +0200 Message-ID: <87k1pu9pv3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffMED-0007Pi-CN for bug-guix@gnu.org; Tue, 17 Jul 2018 05:25:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffMEA-0007qI-8E for bug-guix@gnu.org; Tue, 17 Jul 2018 05:25:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:39403) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffMEA-0007q9-41 for bug-guix@gnu.org; Tue, 17 Jul 2018 05:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ffME9-0000rI-Tv for bug-guix@gnu.org; Tue, 17 Jul 2018 05:25:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffMDo-0007Ly-Su for bug-guix@gnu.org; Tue, 17 Jul 2018 05:24:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffMDo-0007em-09 for bug-guix@gnu.org; Tue, 17 Jul 2018 05:24:40 -0400 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 32184@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, While preparing the 0.15 release I realized that =E2=80=98guix pack --boots= trap=E2=80=99 had become ineffective. Concretely, =E2=80=98tests/guix-pack.sh=E2=80=99 w= ould 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=E2=80=99t actually produce a =E2=80=98db.sqlite=E2= =80=99 file in there. I started looking for solutions, which led me to the patch below. That=E2=80=99s quite intrusive and it doesn=E2=80=99t work because then we = have a similar issue with (guix hash) trying to dlopen libgcrypt. I=E2=80=99m not sure how to best address it. Another approach would be to = do away with =E2=80=98--bootstrap=E2=80=99 and instead write those tests as = =E2=80=9Csystem tests=E2=80=9D in a VM, though that=E2=80=99s maybe less satisfactory. Thoughts? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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?) --=-=-=--