Bug 2530 - bitbake fails to parse with "method already seen" error
Summary: bitbake fails to parse with "method already seen" error
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3 M3
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-06-01 16:27 UTC by Mark Hatle
Modified: 2012-10-03 13:56 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hatle 2012-06-01 16:27:23 UTC
When building, bitbake often fails to parse in my configuration.  The exact message is:

ERROR: Error Method already seen: get_policyconfigarch in' libselinux_2.1.9.bb' now in 'libselinux_git.bb'

In order to reproduce this problem:

Host system - Fedora 16 - i686 (32-bit) - Core 2 Duo system

Python version 2.7.2

OE-core master -- commit: e3113827810e98eb1b012f0b280fb917199704c1
Bitbake master -- commit: 56c1ab18fcaf4ac245dcb412ed55e8e0af07883b
meta-selinux master -- commit: a424d778f3b92a315553383ac1a6bcca682f6007

Use . ./oe-init-build-env to setup a default configuration, modify it:

BB_NUMBER_THREADS = "2"

PARALLEL_MAKE = "-j 2"

Add the meta-selinux to the bblayers.conf file:


# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "4"

BBFILES ?= ""
BBLAYERS ?= " \
  /home/buildbot/temp-fray/openembedded-core/meta \
  /home/buildbot/temp-fray/openembedded-core/meta-selinux \
  "


I then ran bitbake in a loop:

while bitbake -e libselinux ; do rm -rf tmp-eglibc ; done

Within 2-3 runs, I usually receive the failure message indicated above.  (This issue was also reproduced with the version of bitbake and oe-core in the Yocto Project 1.2 release.)

Note: I was -not- able to reproduce this problem w/ Python 2.6.x that comes with CentOS 6.2, or a Fedora 13 machine running a similar python version.
Comment 1 Mark Hatle 2012-06-01 16:46:34 UTC
I have checked in a workaround for this issue to the meta-selinux layer.  When attempting to reproduce this, be sure you match the commits in the original reproducer.

Commit: df4662758708ec030852ba3de007e021f0c4ad49 -- workaround for this issue.
Comment 2 Richard Purdie 2012-06-13 15:37:51 UTC
This is not so much a bug but bitbake telling you that you're doing something invalid.

Whilst its not particularly obvious, python functions share a global namespace since this is what BitBake has always done. Bitbake therefore errors if you try and add the same funciton name from different contexts. The solution is to put common functions within a .inc file.

I agree the error message is less than intuative...
Comment 3 Richard Purdie 2012-06-14 13:21:17 UTC
I've improved the error message in master to resolve this issue: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=4ff6160d909e2a39e357c8a51f37d803dab64d5d
Comment 4 Stefan Stanacar 2012-10-03 13:56:46 UTC
Verified.