[CRIU] [PATCH 1/2] build: only generate soccr config.h if necessary

Tycho Andersen tycho.andersen at canonical.com
Tue Oct 18 15:11:08 PDT 2016


On Wed, Oct 19, 2016 at 01:08:54AM +0300, Dmitry Safonov wrote:
> Hi Tycho,
> 
> 2016-10-19 0:53 GMT+03:00 Tycho Andersen <tycho.andersen at canonical.com>:
> > Without this, any rebuild fails with:
> >
> > make[1]: Entering directory '/home/ubuntu/criu'
> > make[1]: Entering directory '/home/ubuntu/criu'
> >   GEN      .gitid
> >   GEN      criu/include/config.h
> >   GEN      /home/ubuntu/criu/criu/include/version.h
> > make[1]: 'compel/plugins/std.built-in.o' is up to date.
> > make[1]: Leaving directory '/home/ubuntu/criu'
> > ln: failed to create symbolic link '/home/ubuntu/criu/soccr/config.h': File exists
> > Makefile:217: recipe for target '/home/ubuntu/criu/soccr/config.h' failed
> > make: *** [/home/ubuntu/criu/soccr/config.h] Error 1
> > make: *** Waiting for unfinished jobs....
> > make[1]: Entering directory '/home/ubuntu/criu'
> > make[1]: 'compel/compel-host' is up to date.
> > make[1]: Leaving directory '/home/ubuntu/criu'
> > make[1]: Leaving directory '/home/ubuntu/criu'
> >
> > Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> > ---
> >  Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 803b3bf..6947d9c 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -214,7 +214,7 @@ include Makefile.compel
> >  SOCCR_A := soccr/libsoccr.a
> >  SOCCR_CONFIG := $(SRC_DIR)/soccr/config.h
> >  $(SOCCR_CONFIG): $(CONFIG_HEADER)
> > -       $(Q) ln -s ../$(CONFIG_HEADER) $@
> > +       $(Q) test -f $@ || ln -s ../$(CONFIG_HEADER) $@
> 
> thanks on spotting that :)
> Is it better than ignore ln fails?
> >        -$(Q) ln -s ../$(CONFIG_HEADER) $@
> 
> It's up to you, I don't mind any version,

I guess ln could fail for reasons other than EEXIST, but I'm also not
picky, if ignoring failures is better then we can drop this patch in
favor of that.

> Reviewed-by: Dmitry Safonov <dsafonov at virtuozzo.com>

Thanks!

Tycho

> -- 
>              Dmitry


More information about the CRIU mailing list