pkg-infra: introduce errors for legacy API
commit: http://git.buildroot.net/buildroot/commit/?id=ebcfa987df4095a7805ff124ab648fb607c89215
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master
As discussed in the BR developer days, we want to be more strict about API changes in buildroot. I.e., we want to make it less likely that a user's customizations break down after upgrading buildroot.
A first step is to make sure that the user is warned about API changes. This patch introduces Makefile.legacy and Config.in.legacy, which will issue clear error messages for such situations.
--- Config.in | 2 ++ Config.in.legacy | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 7 ++++++- Makefile.legacy | 13 +++++++++++++ 4 files changed, 72 insertions(+), 1 deletions(-)
Config.in +2 -0
@@ -434,3 +434,5 @@ source "fs/Config.in" source "boot/Config.in" source "linux/Config.in" + +source "Config.in.legacy"
Config.in.legacy new file +51 -0
51 lines not on this page · raw message
Makefile +6 -1
@@ -290,6 +290,12 @@ endif all: world +# Include legacy before the other things, because package .mk files +# may rely on it. +ifneq ($(BR2_DEPRECATED),y) +include Makefile.legacy +endif + include package/Makefile.in include support/dependencies/dependencies.mk
@@ -762,4 +768,3 @@ print-version: include docs/manual/manual.mk .PHONY: $(noconfig_targets) -
Makefile.legacy new file +13 -0
@@ -0,0 +1,13 @@ +# +# Makefile.legacy - support for backward compatibility +# +# This file contains placeholders to detect backward-compatibility problems. +# When a buildroot "API" feature is being deprecated, a rule should be added +# here that issues an error when the old feature is used. +# +# This file is not included if BR2_DEPRECATED is selected, so it is possible +# to bypass the errors (although that's usually a bad idea). + +ifeq ($(BR2_LEGACY),y) +$(error "You have legacy configuration in your .config! Please check your configuration.") +endif
Dear Peter Korsgaard,
Quoted 7 lines · Peter Korsgaard
commit: http://git.buildroot.net/buildroot/commit/?id=ebcfa987df4095a7805ff124ab648fb607c89215
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/masterAs discussed in the BR developer days, we want to be more strict about API changes in buildroot. I.e., we want to make it less likely that a user's customizations break down after upgrading buildroot.
Quoted 6 lines
A first step is to make sure that the user is warned about API changes. This patch introduces Makefile.legacy and Config.in.legacy, which will issue clear error messages for such situations.
Signed-off-by Peter Korsgaard <[email protected]>
This doesn't really work well with randpackageconfig, and therefore breaks the autobuilders badly.
For example, randpackageconfig can enable BR2_PACKAGE_GETTEXT_STATIC, because it matches BR2_PACKAGE_<foo>, this will select BR2_LEGACY, which will abort the build.
Should it be fixed just in the autobuilders scripts, or do we consider the fact that "make randpackageconfig" generates un-buildable configuration is a bug by itself?
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hi,
Quoted 10 lines
Quoted 10 lines
As discussed in the BR developer days, we want to be more strict about API changes in buildroot. I.e., we want to make it less likely that a user's customizations break down after upgrading buildroot.
A first step is to make sure that the user is warned about API changes. This patch introduces Makefile.legacy and Config.in.legacy, which will issue clear error messages for such situations.
Signed-off-by Peter Korsgaard <[email protected]>
Thomas> This doesn't really work well with randpackageconfig, and therefore Thomas> breaks the autobuilders badly.
Thomas> For example, randpackageconfig can enable BR2_PACKAGE_GETTEXT_STATIC, Thomas> because it matches BR2_PACKAGE_<foo>, this will select BR2_LEGACY, Thomas> which will abort the build.
Thomas> Should it be fixed just in the autobuilders scripts, or do we consider Thomas> the fact that "make randpackageconfig" generates un-buildable Thomas> configuration is a bug by itself?
I would call it a bug. I've fixed it like this:
[PATCH] {rand,allyes}packageconfig: ensure legacy test options don't
get enabled
The legacy BR2_PACKAGE_* options in Config.in.legacy are not supposed to be user selectable, so {rand,allyes}packageconfig shouldn't enable them.
--- Makefile | 6 ++++++ 1 file changed, 6 insertions(+)
Makefile +6 -0
@@ -619,6 +619,9 @@ allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @mkdir -p $(BUILD_DIR)/buildroot-config @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg + @grep '^config BR2_PACKAGE_' Config.in.legacy | \ + while read config pkg; do \ + echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done @$(COMMON_CONFIG_ENV) \ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ $< --randconfig $(CONFIG_CONFIG_IN)
@@ -627,6 +630,9 @@ randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @mkdir -p $(BUILD_DIR)/buildroot-config @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg + @grep '^config BR2_PACKAGE_' Config.in.legacy | \ + while read config pkg; do \ + echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done @$(COMMON_CONFIG_ENV) \ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ $< --allyesconfig $(CONFIG_CONFIG_IN)
Signature · 1 line
Bye, Peter Korsgaard
Quoted 9 lines · Peter Korsgaard
I would call it a bug. I've fixed it like this:
[PATCH] {rand,allyes}packageconfig: ensure legacy test options don't
get enabledThe legacy BR2_PACKAGE_* options in Config.in.legacy are not supposed to be user selectable, so {rand,allyes}packageconfig shouldn't enable them.
Signed-off-by Peter Korsgaard <[email protected]>
Looks good, thanks. At least, the autobuilders are a lot happier now :-)
Thanks,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com