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: Thu, 1 Oct 2015 23:44:00 +0200	[thread overview]
Message-ID: <20151001234400.0d18c041@free-electrons.com> (raw)
In-Reply-To: <a594ac3858ea713de72610ad49566be4e20c176f.1443650034.git.yann.morin.1998@free.fr>

Hello,

On Wed, 30 Sep 2015 23:54:52 +0200, Yann E. MORIN wrote:
> Currently, after all packages have been installed into target/ , we run
> a sanitising pass called 'target-finalize' on that directory, to:
>   - apply overlays
>   - remove unnecessary files (man, .h, .a ...)
>   - strip files
> as well as a few other miscellanous cleanups.
> 
> This means that target/ no longer contains only package-installed files,
> and that target-finalize might not be idempotent (i.e. sucessive runs of
> target-finalize may yield different results in target/ ). We're trying
> pretty hard that all the internal target-finalize hooks are idempotent,
> whether they are from the core (e.g. installing glibc locales) or
> provided by packages (e.g. cleaning up perl files).
> 
> However, that might not be the case for packages from br2-external for
> example, or under complex situations where a combination of packages
> does not yield an idempotent sequence (quoting Wikipedia: "a combination
> of idempotent methods or subroutines is not necessrily idempotent"; see:
> https://en.wikipedia.org/wiki/Idempotence#Examples ).
> 
> Address this issue by copying target/ to a "landing" area where the
> finalising takes place.
> 
> This keeps the user-visible target/ directory to contain only what
> packages have installed, helps keeping target-finalize be idempotent by
> allowing packages to provide simpler target-finalize hooks.
> 
> For simplicity for packages, we have to allow them to use $(TARGET_DIR)
> everywhere, be it in target install commands or target finalize
> commands, without requiring them to know whether to use $(TARGET_DIR)
> or $(FINAL_TARGET_DIR). $(TARGET_DIR) always points to the directory in
> which to act.
> 
> So, for target-finalize, we override TARGET_DIR to point to the landing
> area. But since packages are dependencies of target-finalize, they
> would also inherit from this override. So, we over-override TARGET_DIR
> for packages, to point to the usual and currently used $(O)/target/
> directory.
> 
> Finally, filesystem images are generated from that landing area, of
> course. Similarly, we need to override TARGET_DIR for them.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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.

Having idem-potent post-build scripts seems like a good goal to
achieve. Your only arguments are:

 - "this might not be the case for br2-external", but it doesn't
   explain why

 - "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.

So with the current explanation/motivation, I'm inclined to say no to
this change. I'd be happy to revise my opinion if there are some clearer
benefits to balance the drawbacks of the additional complexity.

Thanks!

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

  reply	other threads:[~2015-10-01 21:44 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 [this message]
2015-10-02  7:46     ` Yann E. MORIN
2015-10-02  8:21       ` Thomas Petazzoni

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=20151001234400.0d18c041@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