GNU bug report logs - #28399
[PATCH]: Fix mysql activation, and add a basic test.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sat, 9 Sep 2017 14:40:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Christopher Baines <mail <at> cbaines.net>
Subject: bug#28399: closed (Re: [bug#28399] [PATCH 1/2] services: mysql:
 Fix missing modules on activation.)
Date: Sun, 08 Oct 2017 16:35:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#28399: [PATCH]: Fix mysql activation, and add a basic test.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 28399 <at> debbugs.gnu.org.

-- 
28399: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28399
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Christopher Baines <mail <at> cbaines.net>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 28399-done <at> debbugs.gnu.org
Subject: Re: [bug#28399] [PATCH 1/2] services: mysql: Fix missing modules on
 activation.
Date: Sun, 8 Oct 2017 17:34:31 +0100
[Message part 3 (text/plain, inline)]
On Sun, 08 Oct 2017 17:26:05 +0200
ludo <at> gnu.org (Ludovic Courtès) wrote:

> Heya,
> 
> Christopher Baines <mail <at> cbaines.net> skribis:
> 
> > On Wed, 20 Sep 2017 11:21:51 +0200
> > ludo <at> 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 <at> 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.
[Message part 4 (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH]: Fix mysql activation, and add a basic test.
Date: Sat, 9 Sep 2017 15:39:05 +0100
[Message part 6 (text/plain, inline)]
Christopher Baines (2):
  services: mysql: Fix missing modules on activation.
  tests: databases: Add a simple test for MySQL.

 gnu/services/databases.scm | 92 +++++++++++++++++++++++-----------------------
 gnu/tests/databases.scm    | 61 +++++++++++++++++++++++++++++-
 2 files changed, 107 insertions(+), 46 deletions(-)
[Message part 7 (application/pgp-signature, inline)]

This bug report was last modified 7 years and 231 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.