diff options
author | Belen Barros Pena <belen.barros.pena@intel.com> | 2015-03-12 11:30:43 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-21 00:00:24 +0000 |
commit | ede212b2dd3a77680e82571a651150ae773b97ff (patch) | |
tree | cdf2b3cc417e41823c2100f1512add97829da312 /bitbake/lib/toaster/bldcontrol | |
parent | 5b22f15557c48c1fbdc389aad67c1a5ad9f17011 (diff) | |
download | poky-ede212b2dd3a77680e82571a651150ae773b97ff.tar.gz |
bitbake: toaster: display bitbake output after process start
If the bitbake server exists after the initial process start,
the only output displayed shows proper server start, with
no debug info.
This patch also brings the server log into the error message,
so the user has better info about what's going on.
(Bitbake rev: 6b46f436296683f7a2f72ac978ef30d0a38ad7a4)
Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index 374991bfdb..1bd51437a6 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | |||
@@ -82,6 +82,8 @@ class LocalhostBEController(BuildEnvironmentController): | |||
82 | assert self.pokydirname and os.path.exists(self.pokydirname) | 82 | assert self.pokydirname and os.path.exists(self.pokydirname) |
83 | self._createdirpath(self.be.builddir) | 83 | self._createdirpath(self.be.builddir) |
84 | self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, self.be.builddir)) | 84 | self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, self.be.builddir)) |
85 | # delete the templateconf.cfg; it may come from an unsupported layer configuration | ||
86 | os.remove(os.path.join(self.be.builddir, "conf/templateconf.cfg")) | ||
85 | 87 | ||
86 | 88 | ||
87 | def writeConfFile(self, file_name, variable_list = None, raw = None): | 89 | def writeConfFile(self, file_name, variable_list = None, raw = None): |
@@ -115,9 +117,10 @@ class LocalhostBEController(BuildEnvironmentController): | |||
115 | f.seek(0, 2) # jump to the end | 117 | f.seek(0, 2) # jump to the end |
116 | toaster_ui_log_filelength = f.tell() | 118 | toaster_ui_log_filelength = f.tell() |
117 | 119 | ||
118 | cmd = "bash -c \"source %s/oe-init-build-env %s && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 >toaster_server.log && DATABASE_URL=%s BBSERVER=0.0.0.0:-1 daemon -d -i -D %s -o toaster_ui.log -- %s --observe-only -u toasterui &\"" % (self.pokydirname, self.be.builddir, | 120 | cmd = "bash -c \"source %s/oe-init-build-env %s 2>&1 >toaster_server.log && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 2>&1 >toaster_server.log && DATABASE_URL=%s BBSERVER=0.0.0.0:-1 daemon -d -i -D %s -o toaster_ui.log -- %s --observe-only -u toasterui &\"" % (self.pokydirname, self.be.builddir, |
119 | self.dburl, self.be.builddir, own_bitbake) | 121 | self.dburl, self.be.builddir, own_bitbake) |
120 | port = "-1" | 122 | port = "-1" |
123 | logger.debug("localhostbecontroller: starting builder \n%s\n" % cmd) | ||
121 | cmdoutput = self._shellcmd(cmd) | 124 | cmdoutput = self._shellcmd(cmd) |
122 | for i in cmdoutput.split("\n"): | 125 | for i in cmdoutput.split("\n"): |
123 | if i.startswith("Bitbake server address"): | 126 | if i.startswith("Bitbake server address"): |
@@ -136,7 +139,7 @@ class LocalhostBEController(BuildEnvironmentController): | |||
136 | 139 | ||
137 | retries = 0 | 140 | retries = 0 |
138 | started = False | 141 | started = False |
139 | while not started and retries < 30: | 142 | while not started and retries < 10: |
140 | started = _toaster_ui_started(toaster_ui_log_filepath, toaster_ui_log_filelength) | 143 | started = _toaster_ui_started(toaster_ui_log_filepath, toaster_ui_log_filelength) |
141 | import time | 144 | import time |
142 | logger.debug("localhostbecontroller: Waiting bitbake server to start") | 145 | logger.debug("localhostbecontroller: Waiting bitbake server to start") |
@@ -144,7 +147,8 @@ class LocalhostBEController(BuildEnvironmentController): | |||
144 | retries += 1 | 147 | retries += 1 |
145 | 148 | ||
146 | if not started: | 149 | if not started: |
147 | raise BuildSetupException("localhostbecontroller: Bitbake server did not start in 15 seconds, aborting (Error: '%s')" % (cmdoutput)) | 150 | toaster_server_log = open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read() |
151 | raise BuildSetupException("localhostbecontroller: Bitbake server did not start in 5 seconds, aborting (Error: '%s' '%s')" % (cmdoutput, toaster_server_log)) | ||
148 | 152 | ||
149 | logger.debug("localhostbecontroller: Started bitbake server") | 153 | logger.debug("localhostbecontroller: Started bitbake server") |
150 | 154 | ||
@@ -180,7 +184,7 @@ class LocalhostBEController(BuildEnvironmentController): | |||
180 | base = components[-2] if components[-1] == "git" else components[-1] | 184 | base = components[-2] if components[-1] == "git" else components[-1] |
181 | 185 | ||
182 | if branch != "HEAD": | 186 | if branch != "HEAD": |
183 | return os.path.join(self.be.sourcedir, "_%s_%s.toaster_cloned" % (base, branch)) | 187 | return "_%s_%s.toaster_cloned" % (base, branch) |
184 | 188 | ||
185 | 189 | ||
186 | # word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases | 190 | # word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases |
@@ -239,7 +243,7 @@ class LocalhostBEController(BuildEnvironmentController): | |||
239 | 243 | ||
240 | # 3. checkout the repositories | 244 | # 3. checkout the repositories |
241 | for giturl, commit in gitrepos.keys(): | 245 | for giturl, commit in gitrepos.keys(): |
242 | localdirname = self.getGitCloneDirectory(giturl, commit) | 246 | localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit)) |
243 | logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname)) | 247 | logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname)) |
244 | 248 | ||
245 | # make sure our directory is a git repository | 249 | # make sure our directory is a git repository |