Patchwork [git,commit] pkg-infra: introduce errors for legacy API

login
register
mail settings
Submitter Peter Korsgaard
Date Dec. 2, 2012, 2:27 a.m.
Message ID <87hao56vee.fsf@dell.be.48ers.dk>
Download mbox | patch
Permalink /patch/203176/
State Accepted
Commit 8a46d4bf1fe81dc60aca8795d9e2c69a9c252e37
Headers show

Comments

Peter Korsgaard - Dec. 2, 2012, 2:27 a.m.
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> 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: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 >> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>

 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.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 Makefile |    6 ++++++
 1 file changed, 6 insertions(+)
Thomas Petazzoni - Dec. 2, 2012, 6:31 p.m.
On Sat, 01 Dec 2012 18:27:21 -0800, Peter Korsgaard wrote:
> 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.
> 
> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>

Looks good, thanks. At least, the autobuilders are a lot happier now :-)

Thanks,

Thomas

Patch

diff --git a/Makefile b/Makefile
index d3f9b40..b394fd5 100644
--- a/Makefile
+++ b/Makefile
@@ -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)