[Buildroot] [PATCH] core/pkg-infra: really build all dependencies of foo with foo-depends

Arnout Vandecappelle arnout at mind.be
Wed Jul 3 21:28:59 UTC 2019

On 02/07/2019 22:12, Yann E. MORIN wrote:
> Currently, foo-depends only builds build dependencies. This means that
> download and extract dependencies are not built.

 But also patch dependencies.

 Patch dependencies are special, because when used normally, they cause the
following chain (I'm simplifying, obviously):

foo-patch: bar-patch

while for all other types of dependencies it would be:

foo-extract: bar

 So, this patch can lead to circular dependencies, because bar could in turn
depend on foo (that's precisely why this construct was introduced).

 However, it turns out that we only use this _PATCH_DEPENDENCIES for Linux
extensions. In addition, most of them don't even depend back on linux. The only
one in that situation is RTAI. And even for that case, it's not really a
circular dependency. Instead, you have:

linux-depends: rtai <other linux deps>
rtai: ... linux ...
linux: linux-install
linux-install: linux-build
linux-build: linux-configure
linux-configure: linux-patch <other linux deps>
linux-patch: linux-extract rtai-patch
linux-extract: linux-source

So, not an actual circular dependency, because 'linux-depends' is not a target
that is used internally.

 Therefore, I've applied to master, thanks.

 I probably should have added the above explanation to the commit message :-(


> First, but a minor point, this is inconsistent with foo-show-depends,
> which does display all dependencies:
>     $ make host-gzip-show-depends
>     host-skeleton host-tar
>     $ make host-gzip-depends
>         # Only host-skeleton is built and installed
> Second, and more important, it makes it more difficult to preapre a
> debug build, like so:
>     $ make foo-depends
>     $ tar cf output.tar output
>     $ make foo
>         # bummer, broken
>         # edit foo.mk to try and fix it
>     $ rm -rf output; tar xf output.tar
>         # rince and repeat
> Change foo-depends so that it really builds all the dependencies for
> foo, bringing it on-par with foo-show-depends.
> Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
> ---
>  package/pkg-generic.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index b00967c648..9620dec524 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -801,7 +801,7 @@ $(1)-extract:			$$($(2)_TARGET_EXTRACT)
>  $$($(2)_TARGET_EXTRACT):	$$($(2)_TARGET_SOURCE)
> -$(1)-depends:		$$($(2)_FINAL_DEPENDENCIES)
> +$(1)-depends:		$$($(2)_FINAL_ALL_DEPENDENCIES)
>  $(1)-source:		$$($(2)_TARGET_SOURCE)

More information about the buildroot mailing list