Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <jezz@sysmic.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/6] pkg-generic: add check_shlibs_deps hooks
Date: Mon, 14 Nov 2016 14:22:34 +0100	[thread overview]
Message-ID: <20161114132238.6569-3-jezz@sysmic.org> (raw)
In-Reply-To: <20161114132238.6569-1-jezz@sysmic.org>

Call check-shlibs-deps after each package. Errors reported by this hooks mean
the package could compile differently depending of build order (= missing
optional dependency).

Currently, missed dependencies are only logged to
`$(BUILD_DIR)/missing-dependencies.txt'. In future, we may remove `-w' in order
to make these errors fatal.

In order to get correct results from step_check_shlibs_deps, we need to compute
recursive dependencies for package. get_recursive_dependencies is brittle, don't
try to add spaces or line breaks inside its definition.

A good idea to find many missed optional dependencies would be to use this
script with LTP. Unfortunately, check-shlibs-deps does not (yet) work with it.

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 package/pkg-generic.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 827de62..987efa6 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -110,6 +110,26 @@ define step_check_build_dir
 endef
 GLOBAL_INSTRUMENTATION_HOOKS += step_check_build_dir
 
+# Compute dependencies for a set of packages recursively
+# $(1): list of package to check
+# $(2): list of package already processed. Only used for internal recursion.
+#     Keep empty for normal usage.
+# Example usage:
+#     $(call get_recursive_dependencies,util-linux,)
+define get_recursive_dependencies
+$(sort $(foreach d,$(1),$(if $(filter $(d),$(2)),$(d),$(call get_recursive_dependencies,$(d) $($(call UPPERCASE,$(d))_DEPENDENCIES),$(d) $(2)))))
+endef
+
+define step_check_shlibs_deps
+	$(if $(filter install-target,$(2)),\
+		$(if $(filter end,$(1)),support/scripts/check-shlibs-deps \
+			-b $(CONFIG_DIR) -p $(3) -w \
+			-d $(subst $(space),$(comma),$(call get_recursive_dependencies,$(3),)) \
+			| tee -a $(BUILD_DIR)/missing-dependencies.txt
+		))
+endef
+GLOBAL_INSTRUMENTATION_HOOKS += step_check_shlibs_deps
+
 # User-supplied script
 ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
 define step_user
-- 
2.9.3

  parent reply	other threads:[~2016-11-14 13:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 13:22 [Buildroot] [PATCH 0/6] Warn user on missing optional dependencies Jérôme Pouiller
2016-11-14 13:22 ` [Buildroot] [PATCH 1/6] check-shlibs-deps: new script to check shared library dependencies Jérôme Pouiller
2017-02-06 21:04   ` Samuel Martin
2017-02-10 17:22     ` Jérôme Pouiller
2017-02-09 22:21   ` Thomas Petazzoni
2016-11-14 13:22 ` Jérôme Pouiller [this message]
2017-02-06 21:04   ` [Buildroot] [PATCH 2/6] pkg-generic: add check_shlibs_deps hooks Samuel Martin
2016-11-14 13:22 ` [Buildroot] [PATCH 3/6] infra: fix 'packages-file-list.txt' with TLP Jérôme Pouiller
2017-02-09 22:24   ` Thomas Petazzoni
2017-02-10 17:40     ` Jérôme Pouiller
2017-04-01 14:43   ` Thomas Petazzoni
2016-11-14 13:22 ` [Buildroot] [PATCH 4/6] ntp: fix missing optional dependencies Jérôme Pouiller
2016-11-28 22:24   ` Thomas Petazzoni
2016-11-14 13:22 ` [Buildroot] [PATCH 5/6] xterm: depend on libXinerama if appropriate Jérôme Pouiller
2016-11-14 13:22 ` [Buildroot] [PATCH 6/6] xserver_xorg-server: fix dependency with dbus Jérôme Pouiller
2016-12-17 15:52   ` 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=20161114132238.6569-3-jezz@sysmic.org \
    --to=jezz@sysmic.org \
    --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