Bug 542

Summary: bitbake "NoProvider" message doesn't aid in resolving the problem
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Darren Hart <dvhart>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: jiajun.xu, josh, ke.yu, kevin.tian, meta.mr.watcher, meta.watcher, richard.purdie, sgw, song.liu
Version: unspecified   
Target Milestone: 1.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard: (P1)(QA Testing Completed)(Done)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on:    
Bug Blocks: 1543    

Description Darren Hart 2010-11-19 11:40:05 UTC
While working on a new linux kernel recipe, bitbake reported the following when my local.conf MACHINE setting wasn't listed in the COMPATIBLE_MACHINES of the new recipe:

dvhart@doubt:build$ bitbake linux-linaro
NOTE: Handling BitBake files: | (0876/0876) [100 %]
Parsing of 876 .bb files complete (823 cached, 53 parsed). 1036 targets, 35 skipped, 0 masked, 0 errors.

OE Build Configuration:
BB_VERSION        = "1.11.0"
METADATA_BRANCH   = "master-dev"
METADATA_REVISION = "3f3499a0e18ffcc6171ca0d148940a92990098d4"
TARGET_ARCH       = "i586"
TARGET_OS         = "linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "0.9+snapshot-20101118"
TARGET_FPU        = ""

ERROR: Nothing PROVIDES 'linux-linaro'
Command execution failed: Traceback (most recent call last):
  File "/home/dvhart/source/poky.git/scripts/..//bitbake/lib/bb/command.py", line 88, in runAsyncCommand
    commandmethod(self.cmds_async, self, options)
  File "/home/dvhart/source/poky.git/scripts/..//bitbake/lib/bb/command.py", line 184, in buildTargets
    command.cooker.buildTargets(pkgs_to_build, task)
  File "/home/dvhart/source/poky.git/scripts/..//bitbake/lib/bb/cooker.py", line 756, in buildTargets
    taskdata.add_provider(localdata, self.status, k)
  File "/home/dvhart/source/poky.git/scripts/..//bitbake/lib/bb/taskdata.py", line 354, in add_provider
    self.add_provider_internal(cfgData, dataCache, item)
  File "/home/dvhart/source/poky.git/scripts/..//bitbake/lib/bb/taskdata.py", line 374, in add_provider_internal
    raise bb.providers.NoProvider(item)
NoProvider: linux-linaro


For sane user input (ie package-name typos and and bad configs like my case above) we should avoid dumping python traces to the console.
Ideally it would say something more along the lines of:

dvhart@doubt:build$ bitbake linux-linaro
Parsing of 876 .bb files complete (823 cached, 53 parsed). 1036 targets, 35 skipped, 0 masked, 0 errors.

OE Build Configuration:
BB_VERSION        = "1.11.0"
METADATA_BRANCH   = "master-dev"
METADATA_REVISION = "3f3499a0e18ffcc6171ca0d148940a92990098d4"
TARGET_ARCH       = "i586"
TARGET_OS         = "linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "0.9+snapshot-20101118"
TARGET_FPU        = ""

ERROR: Nothing PROVIDES 'linux-linaro' for MACHINE=qemux86-64

dvhart@doubt:build$
Comment 1 Joshua Lock - Disabled 2011-02-22 08:02:15 UTC
This looks to be a non-trivial amount of work. I'd like to postpone it till after 1.0...
Comment 2 Joshua Lock - Disabled 2011-04-04 09:26:05 UTC
Another example is when COMPATIBLE_MACHINE prevents a recipe from building it's not obvious that it's happened without spotting the line in the bb file.
Comment 3 Richard Purdie 2012-01-15 01:56:33 UTC
After http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a5463088fe57462bf681b648d21212808454fc2a the python stack trace is no longer printed.
Comment 4 Richard Purdie 2012-01-15 01:59:43 UTC
Since Paul already added patches which show information about COMPATIBLE_HOST and COMPATIBLE_MACHINE recipe incompatibility a long time ago, resolving this bug. Output is now:

ERROR: Nothing PROVIDES 'valgrind'
ERROR: valgrind was skipped: incompatible with host mips-poky-linux

(which is from COMPATIBLE_HOST and handled the same as COMPATIBLE_MACHINE)
Comment 5 Jiajun Xu 2012-02-05 07:33:50 UTC
The feature is tested workable in 1.2 M2.