Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC 1/2] busybox: avoid conflict with other packages
Date: Fri, 29 Dec 2017 10:38:18 +0100	[thread overview]
Message-ID: <20171229093818.GA3176@scaer> (raw)
In-Reply-To: <20171229055921.abdwvjddkvcuncyr@tarshish>

Baruch, All,

On 2017-12-29 07:59 +0200, Baruch Siach spake thusly:
> On Thu, Dec 28, 2017 at 11:56:39PM +0100, Yann E. MORIN wrote:
> > On 2017-12-28 17:23 +0100, Yann E. MORIN spake thusly:
> > > On 2017-12-14 08:58 +0200, Baruch Siach spake thusly:
> > [--SNIP--]
> > > > Quoting busybox.mk:
> > > > 
> > > > # Enable "noclobber" in install.sh, to prevent BusyBox from overwriting any
> > > > # full-blown versions of apps installed by other packages with sym/hard links.
> > > > 
> > > > Unfortunately, the noclobber implementation is racy.
> > > 
> > > How is it racy?
> > > 
> > > At the moment we're gonna call it, no other package will be installing
> > > at the same time (in the location seen by busybox at least), so there
> > > should be no race.
> > 
> > Yet there were some issues with that part, so I've sent a small
> > patch-series to busybox to fix the noclobber stuff:
> >     http://lists.busybox.net/pipermail/busybox/2017-December/086039.html
> > 
> > So, with this, we should be able to:
> > 
> >   - invert the dependency chain, so thatr busybox now depends on all
> >     otehr packages that it may install applets of;
> 
> Why would we need a dependency at all? Either busybox builds before that other 
> package (like we do today) in which case the other package overwrites the 
> busybox symlink, or that other package builds before busybox, and then the  
> noclobber option does the right thing.

As was discussed during the DevDays in Pragues about top-level parallel
build, we've concluded that we could not have two packages that touch
the same file.

When we are doing top-level parallel build, we no longer have any
guarantee of the ordering, especially the order packages install in
target/, so we loose the reproducibility that sequentiallity currently
provides.

So we have to ensure proper install ordering, so that we guarantee what
files are in target/.

So we either go with the current dependencies, added to all packages to
ensure they get installed after busybox, or we add them to busybox so it
gets installed after all the packages for which it may provide applets.

I prefer the second option, because it concentrates the dependency chain
in a single package, and it becomes very easy to write:

    BUSYBOX_DEPENDENCIES = \
        $(if $(BR2_PACKAGE_COREUTILS),coreutils) \
        $(if $(BR2_PACKAGE_UTIL_LINUX),util-linux) \
    [...]

Rather than duplicate the optional dependency on Busybox in all the
packages (and as Thomas demonstrated, there are quite a few of them).

I may even go further: we could even make busybox depend on *all*
packages, irrespective on whether it provides applets for them or not,
since busybiox is pretty fast to build and does build in parallel quite
nicely anyway. That would nicely solve the issue.

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.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2017-12-29  9:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 13:01 [Buildroot] [RFC 0/2] Handle conflicting files with Busybox Thomas Petazzoni
2017-12-13 13:01 ` [Buildroot] [RFC 1/2] busybox: avoid conflict with other packages Thomas Petazzoni
2017-12-13 14:43   ` Baruch Siach
2017-12-14  5:18     ` Thomas Petazzoni
2017-12-14  6:58       ` Baruch Siach
2017-12-14  7:17         ` Thomas Petazzoni
2017-12-28 16:23         ` Yann E. MORIN
2017-12-28 22:56           ` Yann E. MORIN
2017-12-29  5:59             ` Baruch Siach
2017-12-29  9:38               ` Yann E. MORIN [this message]
2017-12-29  9:42                 ` Thomas Petazzoni
2017-12-29  9:52                   ` Yann E. MORIN
2017-12-29  9:55                     ` Thomas Petazzoni
2018-01-04 15:20                       ` Yann E. MORIN
2018-01-04 15:29                         ` Thomas Petazzoni
2018-01-04 15:39                           ` Yann E. MORIN
2017-12-29 19:54                 ` Trent Piepho
2017-12-29 20:18                   ` Yann E. MORIN
2017-12-29 21:50                     ` Trent Piepho
2017-12-13 13:01 ` [Buildroot] [RFC 2/2] packages: drop no longer needed busybox dependencies Thomas Petazzoni
2017-12-28 17:00 ` [Buildroot] [RFC 0/2] Handle conflicting files with Busybox Yann E. MORIN
2017-12-28 17:04   ` Thomas Petazzoni
2017-12-28 17:20     ` Yann E. MORIN
     [not found]       ` <CANQCQpZ-qO6v+K4kdqmAEdk2+Dk1Yca1fBqyNwfAjau=50cY7A@mail.gmail.com>
     [not found]         ` <CANQCQpYmpCKopmh_5yYV74kOyezJSCLxp6T1mUiqnocHLZV92A@mail.gmail.com>
2017-12-28 17:36           ` Matthew Weber
2017-12-28 18:01       ` Baruch Siach
2017-12-28 19:11         ` Yann E. MORIN

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

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

  git send-email \
    --in-reply-to=20171229093818.GA3176@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox