From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1DTq-0005qE-Rj for guix-patches@gnu.org; Sun, 08 Oct 2017 11:27:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1DTp-0002dn-T1 for guix-patches@gnu.org; Sun, 08 Oct 2017 11:27:02 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1DTp-0002dW-PH for guix-patches@gnu.org; Sun, 08 Oct 2017 11:27:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e1DTp-0004pQ-J5 for guix-patches@gnu.org; Sun, 08 Oct 2017 11:27:01 -0400 Subject: [bug#28399] [PATCH 1/2] services: mysql: Fix missing modules on activation. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170909153905.087c013f@cbaines.net> <20170909145343.14851-1-mail@cbaines.net> <87shftd67d.fsf@gnu.org> <20170912194825.70eb4436@cbaines.net> <87377nlixr.fsf@gnu.org> <20170916113811.3c7d1b33@cbaines.net> <87tvzxu3m8.fsf@gnu.org> <20171008100607.5c175cf8@cbaines.net> Date: Sun, 08 Oct 2017 17:26:05 +0200 In-Reply-To: <20171008100607.5c175cf8@cbaines.net> (Christopher Baines's message of "Sun, 8 Oct 2017 10:06:07 +0100") Message-ID: <87po9xek4y.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 28399@debbugs.gnu.org Heya, Christopher Baines skribis: > On Wed, 20 Sep 2017 11:21:51 +0200 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > >> As you can see, >> /gnu/store/9whwwppmb2sjfsy0967s627bzgdfl8bc-guile-static-stripped-2.2.2/= share/guile/2.2, >> which is at the tail of %load-path, is missing from the root file >> system, hence the failure. >>=20 >> To work around it, we=E2=80=99d have to either ensure that >> =E2=80=98guile-static-stripped=E2=80=99 is on the root file system, or a= djust the load >> path when we switch roots, or (simplest solution) pre-load (ice-9 >> popen) before =E2=80=98switch-root=E2=80=99. >>=20 >> To be continued=E2=80=A6 > > Awesome investigation Ludo. This explanation could match what I was > experiencing when using the mysql service on GuixSD. Sometimes after > running guix gc, the system wouldn't boot. This could have been because > the guile package needed by the initrd was removed from the store. > > Given that the initrd has a dependency on this guile, but it doesn't > reference it because its compressed, It=E2=80=99s not just that: the initrd embeds a self-contained store; it do= es not contain references to the =E2=80=9Couter=E2=80=9D store. > how about adding a explicit reference to the guile used? I've attached > a patch, and this looks to fix the issue as far as the mysql service > is concerned. [=E2=80=A6] > From f313f80407039efb215c18de99ee36696528e98a Mon Sep 17 00:00:00 2001 > From: Christopher Baines > Date: Sun, 8 Oct 2017 09:52:24 +0100 > Subject: [PATCH] linux-initrd: Ensure that the guile used in the initrd > referenced. > > By referencing guile from the initrd, it will be present in the store when > this initrd is used. If the exact guile used within the initrd isn't pres= ent > in the store, then after root is switched during the boot process, loading > modules (such as (ice-9 popen)) won't work. > > * gnu/system/linux-initrd.scm (expression->initrd)[builder]: Write out a = file > called references in to the initrd derivation, which includes the store= path > for guile. [...] > + ;; Due to the compression, the references to the dependencies = are > + ;; obscured, so write them out uncompressed to a file. > + (call-with-output-file (string-append #$ output "/references") > + (lambda (port) > + (map (lambda (reference) > + (simple-format port "~A\n" reference)) > + (list > + ;; The guile used in the initrd must be present in t= he > + ;; store, so that module loading works once the root= is > + ;; switched. > + #$guile)))) That=E2=80=99s very smart! I think you can remove =E2=80=98map=E2=80=99 here since Guile will probably= be the only thing we want to refer to. Make sure to refer to this bug in the commit message and in the comment. OK to push with these changes, thank you! Ludo=E2=80=99.