Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv2] package/ustr: don't run ldconfig
@ 2016-08-14 14:13 Yann E. MORIN
  2016-08-14 20:13 ` Arnout Vandecappelle
  2016-08-19 10:22 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Yann E. MORIN @ 2016-08-14 14:13 UTC (permalink / raw)
  To: buildroot

The ustr Makefile.in (as introduced by the Debian patch we apply), is
probably not parallel-safe:

  402 install: install-opt install-dbg
  403
  404 install-opt: install-dirs install-opt-lib install-common
  405
  406 install-dbg: install-dirs install-dbg-lib install-common
  407
  408 install-opt-lib install-dbg-lib install-common: install-dirs
  [--SNIP--]
  424 install-opt-lib: $(OPT_LIB_STATIC) $(OPT_LIB_SHARED) ustr.pc
  425         @echo Installing files
  426         install -m 644 -t $(DESTDIR)$(libdir) $(OPT_LIB_STATIC)
  427         install -m 755 -t $(DESTDIR)$(libdir) $(OPT_LIB_SHARED)
  428         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
  429         ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
  430         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
  431         ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
  432         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO)
  433         ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO)
  434         $(LDCONFIG) -n $(DESTDIR)$(libdir)
  435         install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc
  436
  437 install-dbg-lib: $(DBG_LIB_STATIC) $(DBG_LIB_SHARED) ustr-debug.pc
  438         @echo Installing files
  439         install -m 644 -t $(DESTDIR)$(libdir) $(DBG_LIB_STATIC)
  440         install -m 755 -t $(DESTDIR)$(libdir) $(DBG_LIB_SHARED)
  441         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
  442         ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
  443         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
  444         ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
  445         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO)
  446         ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO)
  447         $(LDCONFIG) -n $(DESTDIR)$(libdir)
  448         install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr-debug.pc

As Thomas already noticed [0], the two interesting rules above are not
dependent one on the other, so can be run in parallel. So, while one is
doing its rm'n'ln dance, the other can be running an ldconfig, which has
the side effect of creating the missing symlinks. So, we can see this
sequence:

    install-opt-lib:                        install-dbg-lib:
                                                ldconfig
        rm -f .../$(OPT_LIB_SHAREDEV)            \
                                                  `-> symlink(..., .../$(OPT_LIB_SHAREDEV))
        ln -s .../$(OPT_LIB_SHAREDEV)

In this case, ldconfig uses the opportunity-window between the rm and
the ln to create the link; so the ln does not work, as the target
already exist.

We fix that by not running ldconfig at all in Buildroot, we just pass
LDCONFIG=/bin/true .

Fixes (hopefully, since I was not even able to reproduce the failure):
    http://autobuild.buildroot.org/?reason=ustr-1.0.4
    http://autobuild.buildroot.org/results/936/93626f55625ed7900c147bfd79ff7802366639b1/
    http://autobuild.buildroot.org/results/18b/18b6ec537da9e9055f58a8649c0719dc64df1bcf/
    [...]

[0] http://lists.busybox.net/pipermail/buildroot/2016-May/161923.html

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Cc: Arnout Vandecappelle <arnout@mind.be>

---
Changes v1 -> v2:
  - don't patch Makefile.in, it is not strictly needed for Buildroot
    since we pass LDCONFIG=/bin/true  (Arnout)
---
 package/ustr/ustr.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/ustr/ustr.mk b/package/ustr/ustr.mk
index 174f055..1d629ab 100644
--- a/package/ustr/ustr.mk
+++ b/package/ustr/ustr.mk
@@ -23,5 +23,7 @@ USTR_INSTALL_STAGING = YES
 # 'all-shared' to the default 'all' rule.
 USTR_MAKE_OPTS = all all-shared
 
+USTR_MAKE_OPTS += LDCONFIG=/bin/true
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCHv2] package/ustr: don't run ldconfig
  2016-08-14 14:13 [Buildroot] [PATCHv2] package/ustr: don't run ldconfig Yann E. MORIN
@ 2016-08-14 20:13 ` Arnout Vandecappelle
  2016-08-14 21:44   ` Yann E. MORIN
  2016-08-19 10:22 ` Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 20:13 UTC (permalink / raw)
  To: buildroot

On 14-08-16 16:13, Yann E. MORIN wrote:
> The ustr Makefile.in (as introduced by the Debian patch we apply), is
> probably not parallel-safe:
> 
>   402 install: install-opt install-dbg
>   403
>   404 install-opt: install-dirs install-opt-lib install-common
>   405
>   406 install-dbg: install-dirs install-dbg-lib install-common
>   407
>   408 install-opt-lib install-dbg-lib install-common: install-dirs
>   [--SNIP--]
>   424 install-opt-lib: $(OPT_LIB_STATIC) $(OPT_LIB_SHARED) ustr.pc
>   425         @echo Installing files
>   426         install -m 644 -t $(DESTDIR)$(libdir) $(OPT_LIB_STATIC)
>   427         install -m 755 -t $(DESTDIR)$(libdir) $(OPT_LIB_SHARED)
>   428         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
>   429         ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
>   430         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
>   431         ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
>   432         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO)
>   433         ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO)
>   434         $(LDCONFIG) -n $(DESTDIR)$(libdir)
>   435         install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc
>   436
>   437 install-dbg-lib: $(DBG_LIB_STATIC) $(DBG_LIB_SHARED) ustr-debug.pc
>   438         @echo Installing files
>   439         install -m 644 -t $(DESTDIR)$(libdir) $(DBG_LIB_STATIC)
>   440         install -m 755 -t $(DESTDIR)$(libdir) $(DBG_LIB_SHARED)
>   441         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
>   442         ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
>   443         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
>   444         ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
>   445         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO)
>   446         ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO)
>   447         $(LDCONFIG) -n $(DESTDIR)$(libdir)
>   448         install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr-debug.pc
> 
> As Thomas already noticed [0], the two interesting rules above are not
> dependent one on the other, so can be run in parallel. So, while one is
> doing its rm'n'ln dance, the other can be running an ldconfig, which has
> the side effect of creating the missing symlinks. So, we can see this
> sequence:
> 
>     install-opt-lib:                        install-dbg-lib:
>                                                 ldconfig
>         rm -f .../$(OPT_LIB_SHAREDEV)            \
>                                                   `-> symlink(..., .../$(OPT_LIB_SHAREDEV))
>         ln -s .../$(OPT_LIB_SHAREDEV)
> 
> In this case, ldconfig uses the opportunity-window between the rm and
> the ln to create the link; so the ln does not work, as the target
> already exist.
> 
> We fix that by not running ldconfig at all in Buildroot, we just pass
> LDCONFIG=/bin/true .
> 
> Fixes (hopefully, since I was not even able to reproduce the failure):
>     http://autobuild.buildroot.org/?reason=ustr-1.0.4
>     http://autobuild.buildroot.org/results/936/93626f55625ed7900c147bfd79ff7802366639b1/
>     http://autobuild.buildroot.org/results/18b/18b6ec537da9e9055f58a8649c0719dc64df1bcf/
>     [...]
> 
> [0] http://lists.busybox.net/pipermail/buildroot/2016-May/161923.html
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 However...

> 
> ---
> Changes v1 -> v2:
>   - don't patch Makefile.in, it is not strictly needed for Buildroot
>     since we pass LDCONFIG=/bin/true  (Arnout)
> ---
>  package/ustr/ustr.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/ustr/ustr.mk b/package/ustr/ustr.mk
> index 174f055..1d629ab 100644
> --- a/package/ustr/ustr.mk
> +++ b/package/ustr/ustr.mk
> @@ -23,5 +23,7 @@ USTR_INSTALL_STAGING = YES
>  # 'all-shared' to the default 'all' rule.
>  USTR_MAKE_OPTS = all all-shared
>  
> +USTR_MAKE_OPTS += LDCONFIG=/bin/true

 So you don't agree that it's better on one line?

USTR_MAKE_OPTS = LDCONFIG=/bin/true all all-shared


 Regards,
 Arnout


> +
>  $(eval $(autotools-package))
>  $(eval $(host-autotools-package))
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCHv2] package/ustr: don't run ldconfig
  2016-08-14 20:13 ` Arnout Vandecappelle
@ 2016-08-14 21:44   ` Yann E. MORIN
  0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2016-08-14 21:44 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2016-08-14 22:13 +0200, Arnout Vandecappelle spake thusly:
> On 14-08-16 16:13, Yann E. MORIN wrote:
> > The ustr Makefile.in (as introduced by the Debian patch we apply), is
> > probably not parallel-safe:
[--SNIP--]
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
> > Cc: Arnout Vandecappelle <arnout@mind.be>
> 
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
>  However...
[--SNIP--]
> > diff --git a/package/ustr/ustr.mk b/package/ustr/ustr.mk
> > index 174f055..1d629ab 100644
> > --- a/package/ustr/ustr.mk
> > +++ b/package/ustr/ustr.mk
> > @@ -23,5 +23,7 @@ USTR_INSTALL_STAGING = YES
> >  # 'all-shared' to the default 'all' rule.
> >  USTR_MAKE_OPTS = all all-shared
> >  
> > +USTR_MAKE_OPTS += LDCONFIG=/bin/true
> 
>  So you don't agree that it's better on one line?
> 
> USTR_MAKE_OPTS = LDCONFIG=/bin/true all all-shared

Indeed no, because it serves two different purposes: one specifies the
make targets, the other specifies a workaround for a deficient
buildsystem.

That way, it makes both stand out, and it's easier to see what to
change^Wfix in the future when upstream has applied the patches I sent
them. ;-)
Regards,
Yann E. MORIN.


-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCHv2] package/ustr: don't run ldconfig
  2016-08-14 14:13 [Buildroot] [PATCHv2] package/ustr: don't run ldconfig Yann E. MORIN
  2016-08-14 20:13 ` Arnout Vandecappelle
@ 2016-08-19 10:22 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-08-19 10:22 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 14 Aug 2016 16:13:33 +0200, Yann E. MORIN wrote:
> The ustr Makefile.in (as introduced by the Debian patch we apply), is
> probably not parallel-safe:
> 
>   402 install: install-opt install-dbg
>   403
>   404 install-opt: install-dirs install-opt-lib install-common
>   405
>   406 install-dbg: install-dirs install-dbg-lib install-common
>   407
>   408 install-opt-lib install-dbg-lib install-common: install-dirs
>   [--SNIP--]
>   424 install-opt-lib: $(OPT_LIB_STATIC) $(OPT_LIB_SHARED) ustr.pc
>   425         @echo Installing files
>   426         install -m 644 -t $(DESTDIR)$(libdir) $(OPT_LIB_STATIC)
>   427         install -m 755 -t $(DESTDIR)$(libdir) $(OPT_LIB_SHARED)
>   428         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
>   429         ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
>   430         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
>   431         ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
>   432         -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO)
>   433         ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV_BSO)
>   434         $(LDCONFIG) -n $(DESTDIR)$(libdir)
>   435         install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc
>   436
>   437 install-dbg-lib: $(DBG_LIB_STATIC) $(DBG_LIB_SHARED) ustr-debug.pc
>   438         @echo Installing files
>   439         install -m 644 -t $(DESTDIR)$(libdir) $(DBG_LIB_STATIC)
>   440         install -m 755 -t $(DESTDIR)$(libdir) $(DBG_LIB_SHARED)
>   441         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
>   442         ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
>   443         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
>   444         ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
>   445         -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO)
>   446         ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV_BSO)
>   447         $(LDCONFIG) -n $(DESTDIR)$(libdir)
>   448         install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr-debug.pc
> 
> As Thomas already noticed [0], the two interesting rules above are not
> dependent one on the other, so can be run in parallel. So, while one is
> doing its rm'n'ln dance, the other can be running an ldconfig, which has
> the side effect of creating the missing symlinks. So, we can see this
> sequence:
> 
>     install-opt-lib:                        install-dbg-lib:
>                                                 ldconfig
>         rm -f .../$(OPT_LIB_SHAREDEV)            \
>                                                   `-> symlink(..., .../$(OPT_LIB_SHAREDEV))
>         ln -s .../$(OPT_LIB_SHAREDEV)
> 
> In this case, ldconfig uses the opportunity-window between the rm and
> the ln to create the link; so the ln does not work, as the target
> already exist.
> 
> We fix that by not running ldconfig at all in Buildroot, we just pass
> LDCONFIG=/bin/true .
> 
> Fixes (hopefully, since I was not even able to reproduce the failure):
>     http://autobuild.buildroot.org/?reason=ustr-1.0.4
>     http://autobuild.buildroot.org/results/936/93626f55625ed7900c147bfd79ff7802366639b1/
>     http://autobuild.buildroot.org/results/18b/18b6ec537da9e9055f58a8649c0719dc64df1bcf/
>     [...]
> 
> [0] http://lists.busybox.net/pipermail/buildroot/2016-May/161923.html
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
> 
> ---
> Changes v1 -> v2:
>   - don't patch Makefile.in, it is not strictly needed for Buildroot
>     since we pass LDCONFIG=/bin/true  (Arnout)
> ---
>  package/ustr/ustr.mk | 2 ++
>  1 file changed, 2 insertions(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-19 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-14 14:13 [Buildroot] [PATCHv2] package/ustr: don't run ldconfig Yann E. MORIN
2016-08-14 20:13 ` Arnout Vandecappelle
2016-08-14 21:44   ` Yann E. MORIN
2016-08-19 10:22 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox