All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 02/12] package: enhance infrastructure to support source dir override
Date: Wed, 20 Jul 2011 20:16:23 +0200	[thread overview]
Message-ID: <20110720201623.6093dff9@skate> (raw)
In-Reply-To: <CAAXf6LU0J60ycOfqtgUcy2K4ejVCk71oQiJ6YiWzOxfse8w__Q@mail.gmail.com>

Hello Thomas,

Thanks for the feedback!

Le Wed, 20 Jul 2011 08:42:36 +0200,
Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> a ?crit :

> In one project package .mk file I added, I added support for an
> external source directory myself. The external source was under
> revision control. Because originally the build was made in that source
> directory, the 'status' command of the version control system would
> show a bunch of files created by the build system. You'd have to
> update the ignore file to add all these build objects (some of which
> don't follow a pattern like *.o).
> There was another problem with the in-tree building: you couldn't use
> the same source dir from two buildroot trees, as the configuration may
> be different and there would be continuous rebuilding necessary.
> 
> When you say 'out-of-tree builds [..] wouldn't work well in a generic
> way for GENTARGETS', you mean that not all packages support this? What
> are the typical problems that arise?

Try with any random package that does not use autotools or CMake do not
out-of-tree build. Even a simple package such as zlib does not build
out-of-tree, even in native compilation. Basically, all packages that
are supported with the GENTARGETS infrastructure use some sort of
custom/home-made build system, and 99% of the time, this build system
does not support out-of-tree build.

> I think it would be a very good improvement if we could decouple the
> source from the build directory.

It would, but I don't see a good way of implementing this without
fighting with hundreds of upstream projects to get their build system
fixed.

> One workaround is to copy the source directory to output/build and
> do 'in-tree' building there. Ideally
> this would only be done for packages that have problems with
> out-of-tree building (and even more ideally these packages would be
> fixed). The disadvantages of this are obviously the extra time that it
> takes to make the copy, but also that it becomes more difficult to
> detect any changes in the original sources: when do you have to
> recopy?

Yes, I don't see this how this can work. The "source dir override"
feature is precisely here to help when Buildroot is used during
development, when you are hacking on your kernel, on a library or an
application. And in this case, you want a simple "make foobar-rebuild"
in Buildroot to rebuild the "foobar" package, without having to do
anything else.

> This brings me to the following point: for non-local packages, the
> whole package compilation process is restarted if a change in the
> source is detected (i.e. when the tarball is newer than the stamp
> files). How does this go about now?

Unless I missed something, I think the statement you are making is not
true. The dependencies between the various steps in the package build
process are expressed using phony targets, so I don't think changing
the tarball is going to re-trigger the build process of a particular
package.

When it comes to packages whose source directory has been overridden by
this new feature, it's up to the user to do "make foobar-rebuild".
Buildroot cannot guess which packages have changed, and redoing the
make + make install steps for all packages just in case would be
horribly slow.

> As far as I can see in the current patch, there is no such detection.
> If the original sources are changed, the developer has to force
> recompilation of the package (e.g. with the upcoming xxx-reconfigure
> targets). Is that correct, or is there another way?

This is correct, and I don't see another way of doing this. We could of
course add a new variable like BR_FORCED_PACKAGES, in which you could
list the packages that you want to be rebuilt+reinstall at every make
invocation. But this has a really nasty semantic, and I'd prefer not to
implement something like this.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2011-07-20 18:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20  5:51 [Buildroot] [pull request] Pull request for branch for-2011.08/pkg-infra Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 01/12] package: show complete URL for external-deps Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 02/12] package: enhance infrastructure to support source dir override Thomas Petazzoni
2011-07-20  6:42   ` Thomas De Schampheleire
2011-07-20 18:16     ` Thomas Petazzoni [this message]
2011-07-24 15:03       ` Thomas De Schampheleire
2011-07-20  5:52 ` [Buildroot] [PATCH 03/12] package: add configuration option to specify a local override file Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 04/12] package: add <pkg>-rebuild and <pkg>-reconfigure Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 05/12] package: implement a 'local' site method Thomas Petazzoni
2011-07-20  6:29   ` Thomas De Schampheleire
2011-07-20 18:19     ` Thomas Petazzoni
2011-07-24 14:50       ` Thomas De Schampheleire
2011-07-25  7:11         ` Thomas Petazzoni
2011-07-25  7:20           ` Yann E. MORIN
2011-07-25  8:37             ` Thomas De Schampheleire
2011-07-25  8:41               ` Yann E. MORIN
2011-07-25  8:47                 ` Thomas De Schampheleire
2011-07-25  8:42           ` Thomas De Schampheleire
2011-07-25  9:00             ` Thomas Petazzoni
2011-07-28  7:52               ` Arnout Vandecappelle
2011-07-20  5:52 ` [Buildroot] [PATCH 06/12] package: add helper functions to get package name and directory magically Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 07/12] package: remove useless arguments from GENTARGETS Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 08/12] package: remove useless arguments from AUTOTARGETS Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 09/12] package: remove useless arguments from CMAKETARGETS Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 10/12] Makefile.package.in: Pass non-prefixed name as argument to GENTARGETS_INNER Thomas Petazzoni
2011-07-20 16:03   ` Quotient Remainder
2011-07-20 19:19     ` Thomas Petazzoni
2011-07-20  5:52 ` [Buildroot] [PATCH 11/12] Add support for local packages through 'file://' pseudo-protocol Thomas Petazzoni
2011-07-20  9:38   ` Thomas De Schampheleire
2011-07-20  5:52 ` [Buildroot] [PATCH 12/12] fakeroot: remove target packages Thomas Petazzoni
2011-07-20  6:02 ` [Buildroot] [pull request] Pull request for branch for-2011.08/pkg-infra 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=20110720201623.6093dff9@skate \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.