Skip to contentSkip to conversation

toaster: allow builddir to be named other than build bug 9992 V2

PATCH New brian avery 1 participant 4 messages Feb 7, 2017

lore
Share & tools
lore
#0 lore raw

cover toaster: allow builddir to be named other than build bug 9992 V2

This pattchset fixes two bugs. The most important of which is in the sublject line.

9992 -> if we do oe-init-build-env cow, toaster would fail because it had the directory name build hardcoded for toaster.sqlite. This patch moves the toaster.sqlite database to TOASTER_DIR so that you can name your builddir whatever you'd like to.

11006-> the runbuilds process was printing out alot of debug and status messages to the console. Since the console can also be used to run cli builds while toaster displays their status, this was quite disconcerting. This patch redirects the output to toaster_runbuilds.log.

-brian avery

The following changes since commit a624cf7f95c8cf4ff764cc997fd1db4601b97dcc:

oeqa/selftest/pkgdata: use m4 instead of bash (2017-02-07 14:50:10 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib bavery/toaster/9992-builddir-not-buildV5
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/toaster/9992-builddir-not-buildV5

brian avery (3):
toaster: put runbuilds output into a log file
toaster: move sqlite database to TOASTER_DIR
toaster: remove cut and paste cruft

 bitbake/bin/toaster                         | 19 ++++++-------------
 bitbake/lib/toaster/toastermain/settings.py |  3 +--
 2 files changed, 7 insertions(+), 15 deletions(-)

--
1.9.1

#1 lore raw

PATCH 1/3 toaster: put runbuilds output into a log file

The output from runbuilds should not spout over the console where you would be running cmdline builds. Redirected to TOASTER_DIR/toaster_runbuilds.log.

[YOCTO #11006]

---
 bitbake/bin/toaster | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/bin/toaster +4 -1
index daaf8ea..37a1116 100755
@@ -255,7 +255,10 @@ case $CMD in
             return 4
         fi
         export BITBAKE_UI='toasterui'
-        $MANAGE runbuilds &
+        $MANAGE runbuilds \
+           </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \
+           & echo $! >${BUILDDIR}/.runbuilds.pid
+
         # set fail safe stop system on terminal exit
         trap stop_system SIGHUP
         echo "Successful ${CMD}."
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 toaster: move sqlite database to TOASTER_DIR

In reply to brian avery

The toaster.sqlite database was located in TOASTER_DIR/build. This meant that if you named your build directory something else (like cow), Toaster would fail to make/find the database. TOASTER_DIR is on the whitelist unlike BUILDDIR and we need to be able to write there anyway given our current layout so this should not disrupt anything.

[YOCTO #9992]

---
 bitbake/lib/toaster/toastermain/settings.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
bitbake/lib/toaster/toastermain/settings.py +1 -2
index aec9dbb..1fd649c 100644
@@ -38,8 +38,7 @@ ADMINS = (
 
 MANAGERS = ADMINS
 
-TOASTER_SQLITE_DEFAULT_DIR = os.path.join(os.environ.get('TOASTER_DIR', ''),
-                                          'build')
+TOASTER_SQLITE_DEFAULT_DIR = os.environ.get('TOASTER_DIR')
 
 DATABASES = {
     'default': {
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 toaster: remove cut and paste cruft

In reply to brian avery

There was a superfluous section in toaster start/stop script that was setting the TOASTER_DIR and had a set of comments around that setting. This was done in two places and only the last one was effective. This patch removes the spurious section to make it clearer what was happening and what TOASTER_DIR was actually getting set to.

---
 bitbake/bin/toaster | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
bitbake/bin/toaster +2 -12
index 37a1116..fd6cabf 100755
@@ -151,15 +151,7 @@ fi
 
 unset OE_ROOT
 
-# this defines the dir toaster will use for
-# 1) clones of layers (in _toaster_clones )
-# 2) the build dir (in build)
-# 3) the sqlite db if that is being used.
-# 4) pid's we need to clean up on exit/shutdown
-# note: for future. in order to make this an arbitrary directory, we need to
-# make sure that the toaster.sqlite file doesn't default to `pwd` like it currently does.
-export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR"
-export TOASTER_DIR=`pwd`
+
 
 WEBSERVER=1
 ADDR_PORT="localhost:8000"
@@ -215,10 +207,8 @@ fi
 # 2) the build dir (in build)
 # 3) the sqlite db if that is being used.
 # 4) pid's we need to clean up on exit/shutdown
-# note: for future. in order to make this an arbitrary directory, we need to
-# make sure that the toaster.sqlite file doesn't default to `pwd`
-# like it currently does.
 export TOASTER_DIR=`dirname $BUILDDIR`
+export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR"
 
 # Determine the action. If specified by arguments, fine, if not, toggle it
 if [ "$CMD" = "start" ] ; then
Signature · 1 line
1.9.1