From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1EXi-0002Vl-Uw for guix-patches@gnu.org; Sun, 08 Oct 2017 12:35:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1EXe-0002sf-S3 for guix-patches@gnu.org; Sun, 08 Oct 2017 12:35:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1EXe-0002sT-PP for guix-patches@gnu.org; Sun, 08 Oct 2017 12:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e1EXe-0006XM-I8 for guix-patches@gnu.org; Sun, 08 Oct 2017 12:35:02 -0400 Subject: bug#28399: [PATCH 1/2] services: mysql: Fix missing modules on activation. Resent-To: guix-patches@gnu.org Resent-Message-ID: Date: Sun, 8 Oct 2017 17:34:31 +0100 From: Christopher Baines Message-ID: <20171008173431.0ff3299f@cbaines.net> In-Reply-To: <87po9xek4y.fsf@gnu.org> 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> <87po9xek4y.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/n4nXLqQuTO2LiRtiGaphm3G"; protocol="application/pgp-signature" 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 28399-done@debbugs.gnu.org --Sig_/n4nXLqQuTO2LiRtiGaphm3G Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, 08 Oct 2017 17:26:05 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Heya, >=20 > Christopher Baines skribis: >=20 > > On Wed, 20 Sep 2017 11:21:51 +0200 > > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > > =20 > >> 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= adjust 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 =20 > > > > 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, =20 >=20 > It=E2=80=99s not just that: the initrd embeds a self-contained store; it = does > not contain references to the =E2=80=9Couter=E2=80=9D store. >=20 > > 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. =20 >=20 > [=E2=80=A6] >=20 > > 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 present 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. =20 >=20 > [...] >=20 > > + ;; 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 the > > + ;; store, so that module loading works once > > the root is > > + ;; switched. > > + #$guile)))) =20 >=20 > That=E2=80=99s very smart! >=20 > I think you can remove =E2=80=98map=E2=80=99 here since Guile will probab= ly be the > only thing we want to refer to. >=20 > Make sure to refer to this bug in the commit message and in the > comment. >=20 > OK to push with these changes, thank you! Awesome :) I think I've made these changes, and I've now pushed this change, along with the simple MySQL test that now passes. I'm very glad that this issue should be resolved now. --Sig_/n4nXLqQuTO2LiRtiGaphm3G Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlnaU5dfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xc5DA//YQs81RGSADdLH3taTKyrkUtkUeg6xf1jRXcfvAIlmjh7Ezn9GjdKWN6f GH3sqb4ajFMviH185ZYfuu2cn8URBMKUc/cqytImXeqXBtd4od09dKARb9eiMNqY Tyj5pU6g66FVTszZI/8yY5VgquVfghWFc++WBFpBBIZ5eNULyVy8C5RaMKEHmbp9 0jzIFbUzAMr3Y9w9JHiM/jjnrfQchsAFxRppS7sVHlIRk2/cJ4X9lmdZz/bzXUY3 WRcFPKH77EJT6gNW4eYrF0uNYD64T2aW21iO3BvdO29CUYQpGviwdN/yPPdlAr2O c3I7y3XLqj3Qcd8NmFpix13tJ7+XK37jEO2g+derdkLC4UNL1NF/8eUBAx5c0Uld de973iIeqMz3WduAcscQ2eh+96qjcZ8UC15d1JGkuso1XbE467A2hLQfVa4fo0C1 v+Zad/BszqEqRQm4BqWbNEmKWjJu0JXfCFMKWJ78eeRSwdwctOF/zAiRzVMVtiq4 FKRFPyoF2RUYzn8Uyh/tk6+VW6OINYlRuIa5qaPvzD2/HGubGEcWwgdgCEJqTET6 OrSL8v0135zGHsuzQpyxyD0eBdl4RlOjhCyTmMeptE067vLfqLjPnOXJNx9/uLdh VDRmpQPBc3LszCxj7Rve33sqW3cucAd+aewUIERqcT2BuDGs+kg= =+Wzr -----END PGP SIGNATURE----- --Sig_/n4nXLqQuTO2LiRtiGaphm3G--