unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 28399-done@debbugs.gnu.org
Subject: bug#28399: [PATCH 1/2] services: mysql: Fix missing modules on activation.
Date: Sun, 8 Oct 2017 17:34:31 +0100	[thread overview]
Message-ID: <20171008173431.0ff3299f@cbaines.net> (raw)
In-Reply-To: <87po9xek4y.fsf@gnu.org>

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

On Sun, 08 Oct 2017 17:26:05 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Heya,
> 
> Christopher Baines <mail@cbaines.net> skribis:
> 
> > On Wed, 20 Sep 2017 11:21:51 +0200
> > ludo@gnu.org (Ludovic Courtès) 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.
> >> 
> >> To work around it, we’d have to either ensure that
> >> ‘guile-static-stripped’ is on the root file system, or adjust the
> >> load path when we switch roots, or (simplest solution) pre-load
> >> (ice-9 popen) before ‘switch-root’.
> >> 
> >> To be continued…  
> >
> > 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’s not just that: the initrd embeds a self-contained store; it does
> not contain references to the “outer” 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.  
> 
> […]
> 
> > From f313f80407039efb215c18de99ee36696528e98a Mon Sep 17 00:00:00
> > 2001 From: Christopher Baines <mail@cbaines.net>
> > 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.  
> 
> [...]
> 
> > +          ;; 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))))  
> 
> That’s very smart!
> 
> I think you can remove ‘map’ 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!

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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

  reply	other threads:[~2017-10-08 16:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-09 14:39 [bug#28399] [PATCH]: Fix mysql activation, and add a basic test Christopher Baines
2017-09-09 14:53 ` [bug#28399] [PATCH 1/2] services: mysql: Fix missing modules on activation Christopher Baines
2017-09-09 14:53   ` [bug#28399] [PATCH 2/2] tests: databases: Add a simple test for MySQL Christopher Baines
2017-09-11  7:50   ` [bug#28399] [PATCH 1/2] services: mysql: Fix missing modules on activation Ludovic Courtès
2017-09-12 18:48     ` Christopher Baines
2017-09-15 22:02       ` Ludovic Courtès
2017-09-16 10:38         ` Christopher Baines
2017-09-20  9:21           ` Ludovic Courtès
2017-10-08  9:06             ` Christopher Baines
2017-10-08 15:26               ` Ludovic Courtès
2017-10-08 16:34                 ` Christopher Baines [this message]
2017-10-08 19:19                   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171008173431.0ff3299f@cbaines.net \
    --to=mail@cbaines.net \
    --cc=28399-done@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).