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 | |
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')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 14 | ||||
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 12 |
2 files changed, 16 insertions, 10 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 |
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 2132f8799c..eea98b5e71 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -52,7 +52,7 @@ class ToasterSetting(models.Model): | |||
52 | value = models.CharField(max_length=255) | 52 | value = models.CharField(max_length=255) |
53 | 53 | ||
54 | def __unicode__(self): | 54 | def __unicode__(self): |
55 | return "Setting %s" % self.name | 55 | return "Setting %s = " % (self.name, self.value) |
56 | 56 | ||
57 | class ProjectManager(models.Manager): | 57 | class ProjectManager(models.Manager): |
58 | def create_project(self, name, release): | 58 | def create_project(self, name, release): |
@@ -100,7 +100,7 @@ class Project(models.Model): | |||
100 | objects = ProjectManager() | 100 | objects = ProjectManager() |
101 | 101 | ||
102 | def __unicode__(self): | 102 | def __unicode__(self): |
103 | return "%s (%s, %s)" % (self.name, self.release, self.bitbake_version) | 103 | return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version) |
104 | 104 | ||
105 | def get_current_machine_name(self): | 105 | def get_current_machine_name(self): |
106 | try: | 106 | try: |
@@ -896,7 +896,7 @@ class BitbakeVersion(models.Model): | |||
896 | dirpath = models.CharField(max_length=255) | 896 | dirpath = models.CharField(max_length=255) |
897 | 897 | ||
898 | def __unicode__(self): | 898 | def __unicode__(self): |
899 | return "%s (%s)" % (self.name, self.branch) | 899 | return "%s (Branch: %s)" % (self.name, self.branch) |
900 | 900 | ||
901 | 901 | ||
902 | class Release(models.Model): | 902 | class Release(models.Model): |
@@ -1055,8 +1055,10 @@ class Layer_Version(models.Model): | |||
1055 | 1055 | ||
1056 | # raise Exception(candidate_layer_versions) | 1056 | # raise Exception(candidate_layer_versions) |
1057 | 1057 | ||
1058 | release_priorities = map(lambda x: (x.layer_source_id, x.priority), project.release.releaselayersourcepriority_set.all().order_by("-priority")) | 1058 | release_priorities = {} |
1059 | 1059 | ||
1060 | for ls_id, prio in map(lambda x: (x.layer_source_id, x.priority), project.release.releaselayersourcepriority_set.all().order_by("-priority")): | ||
1061 | release_priorities[ls_id] = prio | ||
1060 | 1062 | ||
1061 | def _get_ls_priority(ls): | 1063 | def _get_ls_priority(ls): |
1062 | # if there is no layer source, we have minus infinite priority, as we don't want this layer selected | 1064 | # if there is no layer source, we have minus infinite priority, as we don't want this layer selected |
@@ -1081,7 +1083,7 @@ class Layer_Version(models.Model): | |||
1081 | raise Exception("Cannot determine the vcs_reference for layer version %s" % vars(self)) | 1083 | raise Exception("Cannot determine the vcs_reference for layer version %s" % vars(self)) |
1082 | 1084 | ||
1083 | def __unicode__(self): | 1085 | def __unicode__(self): |
1084 | return str(self.layer) + "(%s,%s)" % (self.get_vcs_reference(), self.build.project if self.build is not None else "None") | 1086 | return "%d %s (VCS %s, Project %s)" % (self.pk, str(self.layer), self.get_vcs_reference(), self.build.project if self.build is not None else "No project") |
1085 | 1087 | ||
1086 | class Meta: | 1088 | class Meta: |
1087 | unique_together = ("layer_source", "up_id") | 1089 | unique_together = ("layer_source", "up_id") |