Bug 3392 - bitbake -e ASSUME_PROVIDED failed with unclear errors
Summary: bitbake -e ASSUME_PROVIDED failed with unclear errors
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.4 M2
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard: Design
Depends on:
Blocks:
 
Reported: 2012-11-06 09:37 UTC by Robert Yang
Modified: 2012-11-30 08:25 UTC (History)
6 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 Robert Yang 2012-11-06 09:37:56 UTC
"bitbake -e ASSUME_PROVIDED" should fail, but the error message isn't clear currently:

$  bitbake -e bzip2-native
Loading cache: 100% |######################################################################################################| ETA:  00:00:00
Loaded 1117 entries from dependency cache.
Parsing recipes: 100% |####################################################################################################| Time: 00:00:00
Parsing of 816 .bb files complete (815 cached, 1 parsed). 1116 targets, 24 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Command execution failed: Traceback (most recent call last):
  File "/buildarea/lyang1/poky/bitbake/lib/bb/command.py", line 94, in runAsyncCommand
    commandmethod(self.cmds_async, self, options)
  File "/buildarea/lyang1/poky/bitbake/lib/bb/command.py", line 323, in showEnvironmentTarget
    command.cooker.showEnvironment(None, pkg)
  File "/buildarea/lyang1/poky/bitbake/lib/bb/cooker.py", line 325, in showEnvironment
    fnid = taskdata.build_targets[targetid][0]
KeyError: 0


Summary: There was 1 ERROR message shown, returning a non-zero exit code.

The following patch would make it clear:

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index e299059..5f88f1f 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -313,6 +313,10 @@ class BBCooker:
         elif len(pkgs_to_build) == 1:
             self.updateCache()
 
+            ignore = self.configuration.data.getVar("ASSUME_PROVIDED", True) or ""
+            if pkgs_to_build[0] in set(ignore.split()):
+                bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
+
             localdata = data.createCopy(self.configuration.data)
             bb.data.update_data(localdata)
             bb.data.expandKeys(localdata)


I will send it to the mailing list sooner.
Comment 2 Yi Zhao 2012-11-30 08:25:42 UTC
Verified with 1.4_M1. 
gitinfo: 247b6a3754c2c50318e2a73d79981ba0e9cb560b

The error message is clear now:
########
$ bitbake -e bzip2-native
Loading cache: 100% |####################################################################################################################################################| ETA:  00:00:00
Loaded 1116 entries from dependency cache.
ERROR: bzip2-native is in ASSUME_PROVIDED
ERROR: Command execution failed: Exited with 1

Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
#########