Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 9/9] core: finalise target in its own location
Date: Fri, 2 Oct 2015 10:21:49 +0200	[thread overview]
Message-ID: <20151002102149.418fb8e4@free-electrons.com> (raw)
In-Reply-To: <20151002074632.GA3908@free.fr>

Hello,

On Fri, 2 Oct 2015 09:46:33 +0200, Yann E. MORIN wrote:

> > To be honest, my initial reaction is: why? What is the benefit? It's
> > additional complexity (not so much in the code), but in the user
> > visible output directories.
> 
> Well, I would say that the user-visible target/ directory, the one we
> are currently exposing, is still user-visible, and the only one we want
> to expose to users. The new build/target-finalise/ directory introduced
> here is not meant to be user-visible. If having that directory in build/
> is considered to be user-visible, then I agree this is not that good; we
> should really have this directory hidden to the user. It is an internal
> step which the user should not meddle with.

Well I personally dislike precisely the fact that what the user sees in
output/target/ is not really what goes into the root filesystem image.
It will remain cluttered with header files, static libraries, locales
and zillions of other crappy things. Users will wonder what's going on,
etc. If there's one thing that users should not see, it is precisely
that.

> A trivial example of a non-idempotent target-finalise hook could be:
> 
>     define FOO_CREATE_MY_USER
>         echo "user:x:1234:5678::/home/user:/bin/sh" >>$(TARGET_DIR)/etc/passwd
>     endef
>     TARGET_FINALIZE_HOOKS += FOO_CREATE_MY_USER

This is trivially fixed with:

 1/ Using the proper mechanism for that: the users table.

 2/ If it's not about creating a user but something else, then a simple
    grep addition will make it work.

> Yes, this is badly written, but we can't expect this kind of situation
> won't happen in real life, especially with br2-external stuff which we
> by design can not review. It has hapenned; it will happen again.

Right, but such mistakes are seen quite quickly I believe. The user
will soon enough realize that his post-build script or
TARGET_FINALIZE_HOOKS is executed each time "make" is called, and that
they have to be idempotent.

> >  - "under complex situations where a combination of packages does not
> >    yield an idempotent sequence", which doesn't come with a real-life
> >    example of such a situation.
> 
> Indeed, I have no first-hand example. However, I really said "under
> complex situations" just because if such a situation exists, it is
> complex by nature and will be difficult to debug.

Sorry for turning down the patch, but I am not a big fan of taking new
features just because an unknown, supposedly complex situation by
nature, may hypothetically exists.

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

      reply	other threads:[~2015-10-02  8:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 21:54 [Buildroot] [PATCH 0/9] fs: cleanups and enhancements (branch yem/fs) Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 1/9] core: sort packages and eliminate duplicates before building Yann E. MORIN
2015-10-01  6:19   ` Thomas Petazzoni
2015-10-01 16:32     ` Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 2/9] linux: split overly-long dependency line for readability Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 3/9] linux: meddle not in the affairs of filesystems, for you are tasty with bacon Yann E. MORIN
2015-10-01  6:20   ` Thomas Petazzoni
2015-10-01 16:41     ` Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 4/9] fs/initramfs: cleanup and enhance comments Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 5/9] fs/ext2: use a post-gen hook rather than a post-target rule Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 6/9] fs/cpio: " Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 7/9] fs/common: get rid of post-target rules Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 8/9] fs/common: move actions common to all filesystems to their own rule Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 9/9] core: finalise target in its own location Yann E. MORIN
2015-10-01 21:44   ` Thomas Petazzoni
2015-10-02  7:46     ` Yann E. MORIN
2015-10-02  8:21       ` Thomas Petazzoni [this message]

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=20151002102149.418fb8e4@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --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