All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] core: add rule to dump packages' build order
Date: Sun,  2 Apr 2017 15:03:38 +0200	[thread overview]
Message-ID: <20170402130338.12542-1-yann.morin.1998@free.fr> (raw)

When debugging hidden dependencies, the build order is very important.
Most notably, it is interesting to identify potential culprits.

Add a new top-level rule, show-biuld-order, that dumps all the packages
in the order they would get built.

Note that there are a few differences with show-targets:

  - more packages are reported, becasue show-targets does not report
    host packages that have no prompt;

  - the output is line-based, because we're using $(info $(1)); getting
    a single output line like show-targets would require we use an
    actual command, like printf '%s ' $(1); but that takes a lot of
    time, while $(info $(1)) is almost instantaneous (the time to parse
    the Makefiles);

  - rootfs targets are not reported.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
---
 Makefile               | 2 ++
 package/pkg-generic.mk | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index 941bf78..919d589 100644
--- a/Makefile
+++ b/Makefile
@@ -757,6 +757,8 @@ legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p
 show-targets:
 	@echo $(PACKAGES) $(TARGETS_ROOTFS)
 
+show-build-order: $(patsubst %,%-show-build-order,$(PACKAGES))
+
 graph-build: $(O)/build/build-time.log
 	@install -d $(GRAPHS_DIR)
 	$(foreach o,name build duration,./support/scripts/graph-build-time \
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 31dbc54..3b26e6b 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -737,6 +737,9 @@ $(1)-show-depends:
 $(1)-show-rdepends:
 			@echo $$($(2)_RDEPENDENCIES)
 
+$(1)-show-build-order: $$(patsubst %,%-show-build-order,$$($(2)_FINAL_ALL_DEPENDENCIES))
+	$$(info $(1))
+
 $(1)-graph-depends: graph-depends-requirements
 	$(call pkg-graph-depends,$(1),--direct)
 
-- 
2.9.3

             reply	other threads:[~2017-04-02 13:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02 13:03 Yann E. MORIN [this message]
2017-04-03 10:10 ` [Buildroot] [PATCH] core: add rule to dump packages' build order Arnout Vandecappelle
2017-04-04 18:59   ` Yann E. MORIN
2017-04-07 10:30     ` Arnout Vandecappelle
2017-04-07 10:43       ` Thomas Petazzoni
2017-04-07 11:11         ` Arnout Vandecappelle
2017-04-07 19:24       ` Yann E. MORIN
2017-04-07 19:44         ` Yann E. MORIN
2017-04-10  9:28         ` Arnout Vandecappelle
2017-04-10 11:44           ` Thomas Petazzoni
2017-04-13 22:18             ` Alexandre Belloni
2017-04-07 10:31 ` Arnout Vandecappelle
2017-04-11  9:23   ` Arnout Vandecappelle
2017-04-13 21:09 ` 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=20170402130338.12542-1-yann.morin.1998@free.fr \
    --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 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.