blob: 041a03b0cdfc0f57b9d168a0dbbbbaffce177631 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 311cf9abc213fcd76795cc3a25814a15fb552065 Mon Sep 17 00:00:00 2001
Brad Bishopf3f93bb2019-10-16 14:33:32 -04002From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 7 Oct 2019 13:22:14 +0200
4Subject: [PATCH] setup.py: do not report missing dependencies for disabled
5 modules
6
7Reporting those missing dependencies is misleading as the modules would not
8have been built anyway. This particularly matters in oe-core's automated
9build completeness checker which relies on the report.
10
11Upstream-Status: Inappropriate [oe-core specific]
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Andrew Geissler95ac1b82021-03-31 14:34:31 -050013Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org>
Andrew Geissler82c905d2020-04-13 13:39:40 -050015
Brad Bishopf3f93bb2019-10-16 14:33:32 -040016---
Andrew Geissler595f6302022-01-24 19:11:47 +000017 setup.py | 8 ++++++++
18 1 file changed, 8 insertions(+)
Brad Bishopf3f93bb2019-10-16 14:33:32 -040019
20diff --git a/setup.py b/setup.py
Patrick Williams92b42cb2022-09-03 06:53:57 -050021index 934cf2e..ccf83b4 100644
Brad Bishopf3f93bb2019-10-16 14:33:32 -040022--- a/setup.py
23+++ b/setup.py
Andrew Geissler595f6302022-01-24 19:11:47 +000024@@ -517,6 +517,14 @@ class PyBuildExt(build_ext):
Brad Bishopf3f93bb2019-10-16 14:33:32 -040025 print("%-*s %-*s %-*s" % (longest, e, longest, f,
26 longest, g))
27
28+ # There is no need to report missing module dependencies,
29+ # if the modules have been disabled in the first place.
Andrew Geissler95ac1b82021-03-31 14:34:31 -050030+ # cannot use mods_disabled here, because remove_configured_extensions adds
31+ # only disabled extensions into it (doesn't cover _dbm, _gdbm, readline
32+ # we support disabling through PACKAGECONFIG)
33+ sysconf_dis = sysconfig.get_config_var('MODDISABLED_NAMES').split()
34+ self.missing = list(set(self.missing) - set(sysconf_dis))
Brad Bishopf3f93bb2019-10-16 14:33:32 -040035+
Andrew Geissler82c905d2020-04-13 13:39:40 -050036 if self.missing:
Brad Bishopf3f93bb2019-10-16 14:33:32 -040037 print()
Patrick Williams92b42cb2022-09-03 06:53:57 -050038 print("The necessary bits to build these optional modules were not "