summaryrefslogtreecommitdiff
path: root/bitbake-dev
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake-dev')
-rwxr-xr-xbitbake-dev/bin/bitbake15
-rw-r--r--bitbake-dev/lib/bb/cooker.py72
-rw-r--r--bitbake-dev/lib/bb/runqueue.py2
-rw-r--r--bitbake-dev/lib/bb/taskdata.py3
-rw-r--r--bitbake-dev/lib/bb/ui/depexp.py (renamed from bitbake-dev/lib/bb/ui/depexplorer.py)0
5 files changed, 52 insertions, 40 deletions
diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake
index d85135a11..920877e4d 100755
--- a/bitbake-dev/bin/bitbake
+++ b/bitbake-dev/bin/bitbake
@@ -69,6 +69,9 @@ Default BBFILES are the .bb files in the current directory.""" )
parser.add_option( "-k", "--continue", help = "continue as much as possible after an error. While the target that failed, and those that depend on it, cannot be remade, the other dependencies of these targets can be processed all the same.",
action = "store_false", dest = "abort", default = True )
+ parser.add_option( "-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.",
+ action = "store_true", dest = "tryaltconfigs", default = False )
+
parser.add_option( "-f", "--force", help = "force run of specified cmd, regardless of stamp status",
action = "store_true", dest = "force", default = False )
@@ -130,17 +133,13 @@ Default BBFILES are the .bb files in the current directory.""" )
# of the UIs (e.g. for DISPLAY, etc.)
bb.utils.clean_environment()
- cooker.parseConfiguration()
+ cooker.parseCommandLine()
host = cooker.server.host
port = cooker.server.port
- # Save a logfile for cooker somewhere
- t = bb.data.getVar('TMPDIR', cooker.configuration.data, True)
- if not t:
- bb.msg.fatal(bb.msg.domain.Build, "TMPDIR not set")
- t = os.path.join(t, "cooker")
- bb.mkdirhier(t)
- cooker_logfile = "%s/log.cooker.%s" % (t, str(os.getpid()))
+ # Save a logfile for cooker into the current working directory. When the
+ # server is daemonized this logfile will be truncated.
+ cooker_logfile = os.path.join (os.getcwd(), "cooker.log")
daemonize.createDaemon(cooker.serve, cooker_logfile)
del cooker
diff --git a/bitbake-dev/lib/bb/cooker.py b/bitbake-dev/lib/bb/cooker.py
index c9afadbc9..ead76ca6b 100644
--- a/bitbake-dev/lib/bb/cooker.py
+++ b/bitbake-dev/lib/bb/cooker.py
@@ -86,10 +86,31 @@ class BBCooker:
self.configuration.data = bb.data.init()
- def parseConfiguration(self):
-
bb.data.inheritFromOS(self.configuration.data)
+ # TOSTOP must not be set or our children will hang when they output
+ fd = sys.stdout.fileno()
+ if os.isatty(fd):
+ import termios
+ tcattr = termios.tcgetattr(fd)
+ if tcattr[3] & termios.TOSTOP:
+ bb.msg.note(1, bb.msg.domain.Build, "The terminal had the TOSTOP bit set, clearing...")
+ tcattr[3] = tcattr[3] & ~termios.TOSTOP
+ termios.tcsetattr(fd, termios.TCSANOW, tcattr)
+
+ self.command = bb.command.Command(self)
+ self.cookerIdle = True
+ self.cookerState = cookerClean
+ self.cookerAction = cookerRun
+ self.server.register_idle_function(self.runCommands, self)
+
+ def parseConfiguration(self):
+ #
+ # Special updated configuration we use for firing events
+ #
+ self.configuration.event_data = bb.data.createCopy(self.configuration.data)
+ bb.data.update_data(self.configuration.event_data)
+
for f in self.configuration.file:
self.parseConfigurationFile( f )
@@ -102,29 +123,14 @@ class BBCooker:
if bbpkgs:
self.configuration.pkgs_to_build.extend(bbpkgs.split())
- #
- # Special updated configuration we use for firing events
- #
- self.configuration.event_data = bb.data.createCopy(self.configuration.data)
- bb.data.update_data(self.configuration.event_data)
-
- # TOSTOP must not be set or our children will hang when they output
- fd = sys.stdout.fileno()
- if os.isatty(fd):
- import termios
- tcattr = termios.tcgetattr(fd)
- if tcattr[3] & termios.TOSTOP:
- bb.msg.note(1, bb.msg.domain.Build, "The terminal had the TOSTOP bit set, clearing...")
- tcattr[3] = tcattr[3] & ~termios.TOSTOP
- termios.tcsetattr(fd, termios.TCSANOW, tcattr)
-
# Change nice level if we're asked to
nice = bb.data.getVar("BB_NICE_LEVEL", self.configuration.data, True)
if nice:
curnice = os.nice(0)
nice = int(nice) - curnice
bb.msg.note(2, bb.msg.domain.Build, "Renice to %s " % os.nice(nice))
-
+
+ def parseCommandLine(self):
# Parse any commandline into actions
if self.configuration.show_environment:
self.commandlineAction = None
@@ -156,17 +162,6 @@ class BBCooker:
self.commandlineAction = None
bb.error("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
- # FIXME - implement
- #if self.configuration.interactive:
- # self.interactiveMode()
-
- self.command = bb.command.Command(self)
- self.cookerIdle = True
- self.cookerState = cookerClean
- self.cookerAction = cookerRun
- self.server.register_idle_function(self.runCommands, self)
-
-
def runCommands(self, server, data, abort):
"""
Run any queued asynchronous command
@@ -310,6 +305,10 @@ class BBCooker:
# Need files parsed
self.updateCache()
+ # If we are told to do the None task then query the default task
+ if (task == None):
+ task = self.configuration.cmd
+
pkgs_to_build = self.checkPackages(pkgs_to_build)
localdata = data.createCopy(self.configuration.data)
@@ -615,6 +614,14 @@ class BBCooker:
Build the file matching regexp buildfile
"""
+ # Parse the configuration here. We need to do it explicitly here since
+ # buildFile() doesn't use the cache
+ self.parseConfiguration()
+
+ # If we are told to do the None task then query the default task
+ if (task == None):
+ task = self.configuration.cmd
+
fn = self.matchFile(buildfile)
self.buildSetVars()
@@ -685,6 +692,10 @@ class BBCooker:
# Need files parsed
self.updateCache()
+ # If we are told to do the NULL task then query the default task
+ if (task == None):
+ task = self.configuration.cmd
+
targets = self.checkPackages(targets)
def buildTargetsIdle(server, rq, abort):
@@ -731,6 +742,7 @@ class BBCooker:
def updateCache(self):
+ self.parseConfiguration ()
if self.cookerState == cookerParsed:
return
diff --git a/bitbake-dev/lib/bb/runqueue.py b/bitbake-dev/lib/bb/runqueue.py
index 1c911ef0c..01452d2f3 100644
--- a/bitbake-dev/lib/bb/runqueue.py
+++ b/bitbake-dev/lib/bb/runqueue.py
@@ -869,7 +869,7 @@ class RunQueue:
self.finish_runqueue()
if self.state is runQueueFailed:
- if self.taskData.abort:
+ if not self.taskData.tryaltconfigs:
raise bb.runqueue.TaskFailure(self.failed_fnids)
for fnid in self.failed_fnids:
self.taskData.fail_fnid(fnid)
diff --git a/bitbake-dev/lib/bb/taskdata.py b/bitbake-dev/lib/bb/taskdata.py
index 566614ee6..782dfb0b7 100644
--- a/bitbake-dev/lib/bb/taskdata.py
+++ b/bitbake-dev/lib/bb/taskdata.py
@@ -30,7 +30,7 @@ class TaskData:
"""
BitBake Task Data implementation
"""
- def __init__(self, abort = True):
+ def __init__(self, abort = True, tryaltconfigs = False):
self.build_names_index = []
self.run_names_index = []
self.fn_index = []
@@ -57,6 +57,7 @@ class TaskData:
self.failed_fnids = []
self.abort = abort
+ self.tryaltconfigs = tryaltconfigs
def getbuild_id(self, name):
"""
diff --git a/bitbake-dev/lib/bb/ui/depexplorer.py b/bitbake-dev/lib/bb/ui/depexp.py
index 9d92fa0a0..9d92fa0a0 100644
--- a/bitbake-dev/lib/bb/ui/depexplorer.py
+++ b/bitbake-dev/lib/bb/ui/depexp.py