Bug 4459

Summary: methodpool does not account for two identically named files (different paths) that provide the different methods
Product: [Build System, Metadata & Runtime] BitBake Reporter: Mark Hatle <mark.hatle>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, poky.bs.watcher, poky.watcher
Version: unspecified   
Target Milestone: 1.5 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Mark Hatle 2013-05-07 22:28:03 UTC
Using the reproducer available at http://gate.crashing.org/~fray/meta-test.tar.gz.  A failure will occur when built with BB_NUMBER_PARSE_THREADS = "1".  (Without that it MIGHT fail, already files as a different bug.)

If you rename meta-test/recipes-core/busybox-oe-min/busybox.inc (and fix the reference to it in busybox-oe-min_1.19.4.bb, the error changes to:


ERROR: The function busybox_cfg defined in busybox.inc was already declared in busybox-oe-min.inc. BitBake has a global python function namespace so shared functions should be declared in a common include file rather than being duplicated, or if the functions are different, please use different function names.
ERROR: The function features_to_busybox_settings defined in busybox.inc was already declared in busybox-oe-min.inc. BitBake has a global python function namespace so shared functions should be declared in a common include file rather than being duplicated, or if the functions are different, please use different function names.
ERROR: The function features_to_busybox_conf defined in busybox.inc was already declared in busybox-oe-min.inc. BitBake has a global python function namespace so shared functions should be declared in a common include file rather than being duplicated, or if the functions are different, please use different function names.
ERROR: The function features_to_busybox_del defined in busybox.inc was already declared in busybox-oe-min.inc. BitBake has a global python function namespace so shared functions should be declared in a common include file rather than being duplicated, or if the functions are different, please use different function names.


These are the error messages that should have been delivered (or something similar) even with two files of the same name.
Comment 1 Richard Purdie 2013-05-08 09:19:36 UTC
The issue is that PythonMethodNode in ast.py uses self.modulename as a unique identifier for the insertion of the new method. If you have two identically named files, this breaks since one is parsed and the other is not.

The issue is complicated by the issue only occurring if both files are parsed by the same process. In separate processes you don't see the conflict.
Comment 2 Richard Purdie 2013-05-23 09:59:16 UTC
Patches on bitbake mailing list to resolve this.
Comment 3 Richard Purdie 2013-05-24 09:42:48 UTC
Fixed in master with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=8bef99d3c85f48ff409eaebb964b1c45b203bdcf (there is cleanup in the following patches)