Subject: [bug#28600] [PATCH] tests: install: Switch to modifying the gc-root-service-type.

From: Christopher Baines <[email-masked]>
Date: Tue, 26 Sep 2017 09:00:48 +0100

On Tue, 26 Sep 2017 09:46:10 +0200
[email-masked] (Ludovic Courtès) wrote:

> Hi!
> 
> Christopher Baines <[email-masked]> skribis:
> 
> > Rather than adding the service to the system.
> >
> > The previous approach is causing the system tests to fail, as the
> > os already contains a service of type gc-root-service-type, and the
> > way that this service extends the system-service doesn't compose,
> > causing an error if its added twice.
> >
> >   ERROR: In procedure symlink: File exists  
> 
> Good catch!
> 
> > * gnu/tests/install.scm (operating-system-with-gc-roots): Modify
> > the existing gc-root-service, rather than adding another.
> > ---
> >  gnu/tests/install.scm | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
> > index 49743860e..28dfc3b8b 100644
> > --- a/gnu/tests/install.scm
> > +++ b/gnu/tests/install.scm
> > @@ -127,8 +127,9 @@
> >    "Return a variant of OS where ROOTS are registered as GC roots."
> >    (operating-system
> >      (inherit os)
> > -    (services (cons (service gc-root-service-type roots)
> > -                    (operating-system-user-services os)))))
> > +    (services
> > +     (modify-services (operating-system-user-services os)
> > +       (gc-root-service-type _ => roots)))))  
> 
> What about:
> 
>   (services (cons (simple-service 'extra-root
>                                   gc-root-service-type roots)
>                   (operating-system-user-services os)))
> 
> This would make sure there’s always a single ‘gc-root-service-type’
> instance, and we’re just extending it with additional roots, rather
> than overriding what it does.

That fixes this issue, but I'm not sure what it means for the tests. If
the roots are not replaced, then the bare-bones-os will be present as
well as the roots added for each test.

This is just a thought though, I'm fine with either fix.