mbox series

[next,00/25] check-symbols v2

Message ID 20221127130739.1862398-1-ricardo.martincoski@gmail.com
Headers show
Series check-symbols v2 | expand

Message

Ricardo Martincoski Nov. 27, 2022, 1:07 p.m. UTC
The script check-symbols checks for inconsistencies on symbols declared
in Config.in and used in .mk files.

Patch 25 is actually v2 for
http://patchwork.ozlabs.org/project/buildroot/patch/20220814233845.2247022-34-ricardo.martincoski@gmail.com/
But v1 was only a prototype/WIP.
There was so many changes from v1 that I honestly gave up keeping track
of them. Because of that, no changelog on this patch.

All other patches in the series are new, found while developing this
script. Because of that, no changelog for patches 1 to 24.

Patches 1 and 2 fix typos on text (help text, CHANGES, ...).

Patch 3 fixes a duplicate symbol on Config.in.legacy, result of a
copy&paste error.
Patch 4 makes check-package to warn about occurrences of duplicated
symbols.

Patch 5 makes the test using test-pkg on GitLab CI easier for defconfigs
that contain disabled options. It was used to test patches 9 and 10
without changing the default git configuration.

Patches 6, 7 and 8 fix the use of ifdef on .mk files.
While testing patch 8, an issue passing config options and an
improvement raised for package pugixml.
Patch 9 fixes the issue.
Patch 10 implements the improvement when passing build options.
Patch 11 adds a comment to busybox.mk, copied from uclibc.mk about
overriding a variable.
Patch 12 makes check-package to warn about the use of ifdef in .mk
files.

While developing patch 25, I noticed that toolchain and
toolchain-buildroot are not really virtual packages but both use the
virtual package infra. Patch 13 add comments to explain why.
Patches 14 and 15 remove usage of legacy symbols from packages.
Patch 16 removes an unused symbol.
Patch 17 fixes a select of a config that belongs to a choice.
Patches 18, 19, 20, 21, 22 and 23 fix legacy handling.
Patch 24 fixes a typo just merged only on next branch.
Patch 25 is the actual goal of this series, adding check-symbols script.

Example usage of the script applying only patch 25 to next:
$ time utils/docker-run utils/check-symbols
Config.in.legacy:634: BR2_PACKAGE_SUNXI_MALI_UTGARD_R6P2 is part of a "choice" and should not be "select"ed
Config.in.legacy:643: BR2_PACKAGE_SUNXI_MALI_UTGARD_R8P1 is part of a "choice" and should not be "select"ed
Config.in.legacy:705: BR2_PACKAGE_OPENJDK_VERSION_11 is part of a "choice" and should not be "select"ed
Config.in.legacy:713: BR2_PACKAGE_OPENJDK_VERSION_17 is part of a "choice" and should not be "select"ed
Config.in.legacy:2097: BR2_PACKAGE_LUA_5_3 is part of a "choice" and should not be "select"ed
Config.in.legacy:2605: BR2_PACKAGE_TI_SGX_AM335X not referenced but has a comment stating it is
Config.in.legacy:2615: BR2_PACKAGE_TI_SGX_AM437X not referenced but has a comment stating it is
Config.in.legacy:2625: BR2_PACKAGE_TI_SGX_AM4430 not referenced but has a comment stating it is
Config.in.legacy:2635: BR2_PACKAGE_TI_SGX_AM5430 not referenced but has a comment stating it is
Config.in.legacy:3973: BR2_GCC_VERSION_ARC is part of a "choice" and should not be "select"ed
Config.in.legacy:4316: BR2_PACKAGE_OPENPOWERLINK_STACK_KERNEL_STACK_LIB is part of a "choice" and should not be "select"ed
Config.in.legacy:4324: BR2_PACKAGE_OPENPOWERLINK_STACK_USERSPACE_DAEMON_LIB is part of a "choice" and should not be "select"ed
boot/uboot/Config.in:445: BR2_TARGET_XLOADER is a legacy symbol and should not be referenced
package/fwts/Config.in:31: BR2_PACKAGE_FWTS_EFI_RUNTIME_MODULE defined but not referenced
package/gitlab-runner/Config.in:14: BR2_PACKAGE_LIBCURL_OPENSSL is part of a "choice" and should not be "select"ed
package/rpi-userland/Config.in:43: BR2_arch64 referenced but not defined
system/Config.in:81: BR2_TARGET_GENERIC_PASSWD_MD5 is a legacy symbol and should not be referenced
real    0m4,703s
user    0m0,057s
sys     0m0,020s

The new GitLab CI jobs can be seen here, with the whole series applied
to next:
https://gitlab.com/RicardoMartincoski/buildroot/-/pipelines/706073924

Regards,
Ricardo

Ricardo Martincoski (25):
  *: fix typo for separate(d|) in text
  package,legacy: fix typo for "daemon" on help text
  Config.in.legacy: fix typo on BR2_PACKAGE_MEDIAART_BACKEND_QT
  utils/checkpackagelib: warn about redefined config
  support/scripts/generate-gitlab-ci-yml: improve test-pkg support
  package/fwts: use ifeq instead of ifdef
  package/live555: fix build config with locale
  package/pugixml: unconditionally set BUILD_DEFINES
  package/pugixml: fix configuration options
  package/pugixml: use explicit build options
  package/busybox: add comment about variable override
  utils/checkpackagelib: warn about ifdef on .mk
  toolchain/toolchain-buildroot: add comment about using virtual package
    infra
  boot/uboot: remove use of legacy xloader symbol
  system: remove use of legacy md5 option
  package/linux-headers: remove bogus symbol
    BR2_PACKAGE_HOST_LINUX_HEADERS
  package/gitlab-runner: ensure use of LIBCURL_OPENSSL
  package/openpowerlink: properly handle legacy options
  package/gcc: properly handle legacy for renamed ARC option
  package/lua: properly handle legacy for removed version
  package/ti-sgx-km: properly handle legacy for removed options
  package/openjdk: properly handle legacy for renamed options
  package/sunxi-mali-utgard: properly handle legacy for renamed options
  package/rpi-userland: fix typo for BR2_aarch64
  utils/check-symbols: new script

 CHANGES                                       |   4 +-
 Config.in.legacy                              | 101 ++--
 DEVELOPERS                                    |   2 +
 boot/uboot/Config.in                          |   1 -
 package/busybox/busybox.mk                    |   3 +
 package/fwts/fwts.mk                          |   2 +-
 package/gcc/Config.in.host                    |   1 +
 package/gitlab-runner/Config.in               |   1 -
 package/gitlab-runner/gitlab-runner.mk        |   4 +
 package/leafnode2/leafnode2.mk                |   2 +-
 package/linux-headers/Config.in.host          |   3 -
 package/live555/live555.mk                    |   2 +-
 package/lua/Config.in                         |   1 +
 package/ngircd/Config.in                      |   2 +-
 package/openjdk/Config.in                     |   2 +
 package/openpowerlink/Config.in               |   2 +
 package/pugixml/pugixml.mk                    |  24 +-
 package/rp-pppoe/Config.in                    |   2 +-
 package/rpi-userland/Config.in                |   2 +-
 package/sunxi-mali-utgard/Config.in           |   2 +
 package/uclibc/uclibc.mk                      |   1 +
 support/misc/gitlab-ci.yml.in                 |   8 +
 support/scripts/generate-gitlab-ci-yml        |   4 +-
 system/Config.in                              |   3 +-
 .../toolchain-buildroot.mk                    |   3 +
 toolchain/toolchain/toolchain.mk              |   3 +
 utils/check-symbols                           |  78 ++++
 utils/checkpackagelib/lib_config.py           |  38 ++
 utils/checkpackagelib/lib_mk.py               |  18 +
 utils/checkpackagelib/test_lib_config.py      |  78 ++++
 utils/checkpackagelib/test_lib_mk.py          |  48 ++
 utils/checksymbolslib/__init__.py             |   0
 utils/checksymbolslib/br.py                   | 140 ++++++
 utils/checksymbolslib/db.py                   | 205 ++++++++
 utils/checksymbolslib/file.py                 |  83 ++++
 utils/checksymbolslib/kconfig.py              | 139 ++++++
 utils/checksymbolslib/makefile.py             | 100 ++++
 utils/checksymbolslib/test_db.py              | 286 ++++++++++++
 utils/checksymbolslib/test_file.py            | 152 ++++++
 utils/checksymbolslib/test_kconfig.py         | 438 ++++++++++++++++++
 utils/checksymbolslib/test_makefile.py        | 304 ++++++++++++
 utils/checksymbolslib/test_util.py            |  15 +
 42 files changed, 2242 insertions(+), 65 deletions(-)
 create mode 100755 utils/check-symbols
 create mode 100644 utils/checksymbolslib/__init__.py
 create mode 100644 utils/checksymbolslib/br.py
 create mode 100644 utils/checksymbolslib/db.py
 create mode 100644 utils/checksymbolslib/file.py
 create mode 100644 utils/checksymbolslib/kconfig.py
 create mode 100644 utils/checksymbolslib/makefile.py
 create mode 100644 utils/checksymbolslib/test_db.py
 create mode 100644 utils/checksymbolslib/test_file.py
 create mode 100644 utils/checksymbolslib/test_kconfig.py
 create mode 100644 utils/checksymbolslib/test_makefile.py
 create mode 100644 utils/checksymbolslib/test_util.py