Skip to contentSkip to conversation

Show progress during build and eSDK install

PATCH In review Paul Eggleton 2 participants 16 messages Jun 23, 2016 – Jul 3, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover Show progress during build and eSDK install

Show progress during build and extensible SDK installation.

I've often thought it would be nice if we could print progress information for individual tasks so that you could get some idea of whether the task is doing anything and how much longer it might take, and so I've been working on a set of patches to implement just that in the background for a while now and this is the result. Unfortunately this isn't necessarily practical to do for all tasks, but things like do_fetch are running processes that do output progress information so it's not too hard to tap into that and present it in the form of a progress bar next to the task, which is what this patchset does. I was also able to enable progress for do_compile in recipes that use cmake (since that outputs % complete as it runs) as well as do_rootfs where it has a number of internal steps that can be counted and weighted.

I have contemplated and even prototyped going a step further and using the count of lines in the output to track progress for *all* long-running tasks, which does work reasonably well - the caveat is you actually need the expected line count ahead of time for each task, so you have to be able to get that from somewhere. I haven't worked out a practical means of delivering that, suggestions would be very much welcome - my prototype stuff is on poky-contrib paule/progress-wip and relies on someone profiling a build containing all the tasks beforehand and that information somehow being made available to everyone else.

Also included in this patchset is support for showing progress in a couple of other stages during the build - when checking for the availability of sstate artifacts, when initialising the tasks (formerly "Preparing RunQueue") and overall progress of running setscene and normal tasks.

There are also a few semi-related changes to improve progress reporting and speed of extensible SDK installation.

NOTE: this patchset requires the corresponding set of changes just sent to the bitbake-devel list in order to work.

Changes since v1:
* Recalculate stage weightings for do_rootfs, ensure we call finish() and add a comment mentioning how to recalculate the weightings if needed in future
* Fix extensible SDK install printing out errors twice on failure
* Print out list of unexpected tasks in an order closer to actual execution order than previously
* Add a patch fixing output of lines if SDK testing fails (not directly related, but I noticed this issue when fixing the SDK logging)

The following changes since commit 9431698a88430f0fa892d9b270c0849c4d3d2486:

build-appliance-image: Update to master head revision (2016-06-21 14:02:36 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/startup-oe
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/startup-oe

Paul Eggleton (10):
bitbake.conf: whitelist progress varflag
classes/cmake: enable progress for do_compile classes/image: implement progress support for do_rootfs classes/sstate: show progress during sstate object availability check classes/sstate: add a mode to error if sstate package unavailable classes/testsdk: print output correctly on failure classes/populate_sdk_ext: eliminate double execution on install lib/oe/sstatesig: print locked sigs file message only when explicitly
called
classes/populate_sdk_ext: show progress when preparing build system toolchain-shar-extract.sh: allow TERM through into SDK installer env

 meta/classes/cmake.bbclass                        |   1 +
 meta/classes/image.bbclass                        |  19 +++-
 meta/classes/populate_sdk_ext.bbclass             |   7 +-
 meta/classes/sstate.bbclass                       |  29 +++++-
 meta/classes/testsdk.bbclass                      |  14 ++-
 meta/conf/bitbake.conf                            |   6 +-
 meta/files/ext-sdk-prepare.py                     | 117 ++++++++--------------
 meta/files/toolchain-shar-extract.sh              |   1 +
 meta/lib/oe/rootfs.py                             | 101 ++++++++++++++++---
 meta/lib/oe/sstatesig.py                          |  10 +-
 meta/recipes-devtools/cmake/cmake-native_3.5.2.bb |   2 +
 scripts/oe-buildenv-internal                      |   2 +-
 12 files changed, 204 insertions(+), 105 deletions(-)
Signature · 1 line
2.5.5
#1 lore raw

PATCH v2 1/10 bitbake.conf: whitelist progress varflag

We don't want the value of this varflag in any signatures since it's only there for the purpose of aiding display of task execution.

---
 meta/conf/bitbake.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/conf/bitbake.conf +2 -1
index 942b8b1..2e95819 100644
@@ -822,7 +822,8 @@ BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
     lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
     file-checksums python func task export unexport noexec nostamp dirs cleandirs \
     sstate-lockfile-shared prefuncs postfuncs export_func deptask rdeptask \
-    recrdeptask nodeprrecs stamp-extra-info sstate-outputdirs filename lineno"
+    recrdeptask nodeprrecs stamp-extra-info sstate-outputdirs filename lineno \
+    progress"
 
 MLPREFIX ??= ""
 MULTILIB_VARIANTS ??= ""
Signature · 1 line
2.5.5
#2 lore raw

PATCH v2 2/10 classes/cmake: enable progress for do_compile

In reply to Paul Eggleton

cmake outputs percentage complete as part of its compilation process, so we can enable BitBake's new progress scanning for do_compile here.

---
 meta/classes/cmake.bbclass                        | 1 +
 meta/recipes-devtools/cmake/cmake-native_3.5.2.bb | 2 ++
 2 files changed, 3 insertions(+)
meta/classes/cmake.bbclass +1 -0
index e788310..b18152a 100644
@@ -124,6 +124,7 @@ cmake_do_configure() {
 	  -Wno-dev
 }
 
+do_compile[progress] = "percent"
 cmake_do_compile()  {
 	cd ${B}
 	base_do_compile VERBOSE=1
meta/recipes-devtools/cmake/cmake-native_3.5.2.bb +2 -0
index cb4e749..33930fb 100644
@@ -14,3 +14,5 @@ CMAKE_EXTRACONF = "\
     -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
     -DHAVE_SYS_ACL_H=0 \
 "
+
+do_compile[progress] = "percent"
Signature · 1 line
2.5.5
#3 lore raw

Re: [PATCH v2 02/10] classes/cmake: enable progress for do_compile

Quoted 3 lines · Paul Eggleton

cmake outputs percentage complete as part of its compilation process, so we can enable BitBake's new progress scanning for do_compile here.

Some recipes, such as clang, have something like sub-builds:

[ 0%] Configuring NATIVE LLVM...
[ 0%] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/Main.cpp.o
[ 20%] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/SetTheory.cpp.o
[ 20%] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o
...
100%] Built target NATIVE_LIB_LLVMSUPPORT
[100%] Building native TableGen...
[ 16%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/AsmMatcherEmitter.cpp.o [ 33%] Built target obj.llvm-tblgen
[100%] Built target LLVMSupport
[100%] Built target LLVMTableGen
[100%] Linking CXX executable ../../bin/llvm-tblgen
[100%] Built target llvm-tblgen
[100%] Built target LLVM-tablegen-host
[ 0%] Configuring NATIVE LLVM...
[ 20%] Built target LLVMTableGen
...

The first few lines which went to 100% controlled the progress bar, but that took about 5 seconds. The rest of the build takes about 15 minutes and for all that time the bar is pegged at 100%.

Ross

#4 lore raw

Re: [PATCH v2 02/10] classes/cmake: enable progress for do_compile

Quoted 29 lines · Ross
Quoted 2 lines · Paul Eggleton

cmake outputs percentage complete as part of its compilation process, so we can enable BitBake's new progress scanning for do_compile here.

Some recipes, such as clang, have something like sub-builds:

[ 0%] Configuring NATIVE LLVM...
[ 0%] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/Main.cpp.o
[ 20%] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/SetTheory.cpp.o
[ 20%] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/Error.cpp.o
...
100%] Built target NATIVE_LIB_LLVMSUPPORT
[100%] Building native TableGen...
[ 16%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/AsmMatcherEmitter.cpp.o [ 33%] Built target obj.llvm-tblgen
[100%] Built target LLVMSupport
[100%] Built target LLVMTableGen
[100%] Linking CXX executable ../../bin/llvm-tblgen
[100%] Built target llvm-tblgen
[100%] Built target LLVM-tablegen-host
[ 0%] Configuring NATIVE LLVM...
[ 20%] Built target LLVMTableGen
...

Quoted 3 lines

The first few lines which went to 100% controlled the progress bar, but that took about 5 seconds. The rest of the build takes about 15 minutes and for all that time the bar is pegged at 100%.

Great, that's just broken... any suggestions on what to do about it?

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#5 lore raw

Re: [PATCH v2 02/10] classes/cmake: enable progress for do_compile

Quoted 2 lines · Paul Eggleton

Great, that's just broken... any suggestions on what to do about it?

I'm wondering if cmake can be told to just output the "top level" percentages, or whether that is basically unknowable.

Ross

#6 lore raw

Re: [PATCH v2 02/10] classes/cmake: enable progress for do_compile

Quoted 6 lines · Ross
Quoted 1 line · Paul Eggleton

Great, that's just broken... any suggestions on what to do about it?

I'm wondering if cmake can be told to just output the "top level" percentages, or whether that is basically unknowable.

I can't seem to find an option for this.

However I'm wondering if this is something special to clang. Everything else that uses cmake that I've tried (including webkitgtk) is putting out sensible numbers. Have you observed it anywhere else?

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#7 lore raw

PATCH v2 3/10 classes/image: implement progress support for do_rootfs

In reply to Paul Eggleton

Use the new task progress functionality to report progress during do_rootfs. This is a little coarse and ideally we would have some progress within the installation section, but it's better than nothing.

---
 meta/classes/image.bbclass |  19 ++++++++-
 meta/lib/oe/rootfs.py      | 101 +++++++++++++++++++++++++++++++++++++++------
 2 files changed, 105 insertions(+), 15 deletions(-)
meta/classes/image.bbclass +17 -2
index 61295f4..30dfd64 100644
@@ -198,6 +198,17 @@ fakeroot python do_rootfs () {
     from oe.rootfs import create_rootfs
     from oe.manifest import create_manifest
 
+    # NOTE: if you add, remove or significantly refactor the stages of this
+    # process then you should recalculate the weightings here. This is quite
+    # easy to do - just change the MultiStageProgressReporter line temporarily
+    # to pass debug=True as the last parameter and you'll get a printout of
+    # the weightings as well as a map to the lines where next_stage() was
+    # called. Of course this isn't critical, but it helps to keep the progress
+    # reporting accurate.
+    stage_weights = [1, 203, 354, 186, 65, 4228, 1, 353, 49, 330, 382, 23, 1]
+    progress_reporter = bb.progress.MultiStageProgressReporter(d, stage_weights)
+    progress_reporter.next_stage()
+
     # Handle package exclusions
     excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split()
     inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
@@ -230,8 +241,12 @@ fakeroot python do_rootfs () {
     # Generate the initial manifest
     create_manifest(d)
 
-    # Generate rootfs
-    create_rootfs(d)
+    progress_reporter.next_stage()
+
+    # generate rootfs
+    create_rootfs(d, progress_reporter=progress_reporter)
+
+    progress_reporter.finish()
 }
 do_rootfs[dirs] = "${TOPDIR}"
 do_rootfs[cleandirs] += "${S}"
meta/lib/oe/rootfs.py +88 -13

248 lines not on this page · raw message

Signature · 1 line
2.5.5
#8 lore raw

PATCH v2 4/10 classes/sstate: show progress during sstate object availability check

In reply to Paul Eggleton

Show progress through bitbake's standard terminal UI when checking for shared state object availability, since this can take some time if there are a large number of tasks to be executed and/or the network connection is slow.

Part of the implementation for [YOCTO #5853].

---
 meta/classes/sstate.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/classes/sstate.bbclass +4 -2
index 994eae6..4e81fc9 100644
@@ -800,7 +800,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
             except:
                 missed.append(task)
                 bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
-                pass     
+                pass
+            bb.event.fire(bb.event.ProcessProgress("Checking sstate mirror object availability", len(tasklist) - thread_worker.tasks.qsize()), d)
 
         tasklist = []
         for task in range(len(sq_fn)):
@@ -811,7 +812,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
             tasklist.append((task, sstatefile))
 
         if tasklist:
-            bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist))
+            bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d)
             import multiprocessing
             nproc = min(multiprocessing.cpu_count(), len(tasklist))
 
@@ -821,6 +822,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
                 pool.add_task(checkstatus, t)
             pool.start()
             pool.wait_completion()
+            bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
 
     inheritlist = d.getVar("INHERIT", True)
     if "toaster" in inheritlist:
Signature · 1 line
2.5.5
#9 lore raw

PATCH v2 5/10 classes/sstate: add a mode to error if sstate package unavailable

In reply to Paul Eggleton

If BB_SETSCENE_ENFORCE is set to "1" and an sstate package fails to download outside of the whitelist specified by BB_SETSCENE_ENFORCE_WHITELIST, then fail immediately so you can tell that the problem was caused by failing to restore the task from sstate.

Part of the implementation of [YOCTO #9367].

---
 meta/classes/sstate.bbclass  | 23 +++++++++++++++++++++++
 meta/conf/bitbake.conf       |  3 ++-
 scripts/oe-buildenv-internal |  2 +-
 3 files changed, 26 insertions(+), 2 deletions(-)
meta/classes/sstate.bbclass +23 -0
index 4e81fc9..621dc37 100644
@@ -719,6 +719,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
 
     ret = []
     missed = []
+    missing = []
     extension = ".tgz"
     if siginfo:
         extension = extension + ".siginfo"
@@ -740,6 +741,18 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
 
         return spec, extrapath, tname
 
+    def sstate_pkg_to_pn(pkg, d):
+        """
+        Translate an sstate filename to a PN value by way of SSTATE_PKGSPEC. This is slightly hacky but
+        we don't have access to everything in this context.
+        """
+        pkgspec = d.getVar('SSTATE_PKGSPEC', False)
+        try:
+            idx = pkgspec.split(':').index('${PN}')
+        except ValueError:
+            bb.fatal('Unable to find ${PN} in SSTATE_PKGSPEC')
+        return pkg.split(':')[idx]
+
 
     for task in range(len(sq_fn)):
 
@@ -774,6 +787,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
         if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
             localdata.delVar('BB_NO_NETWORK')
 
+        whitelist = bb.runqueue.get_setscene_enforce_whitelist(d)
+
         from bb.fetch2 import FetchConnectionCache
         def checkstatus_init(thread_worker):
             thread_worker.connection_cache = FetchConnectionCache()
@@ -800,6 +815,12 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
             except:
                 missed.append(task)
                 bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
+                if whitelist:
+                    pn = sstate_pkg_to_pn(sstatefile, d)
+                    taskname = sq_task[task]
+                    if not bb.runqueue.check_setscene_enforce_whitelist(pn, taskname, whitelist):
+                        missing.append(task)
+                        bb.error('Sstate artifact unavailable for %s.%s' % (pn, taskname))
                 pass
             bb.event.fire(bb.event.ProcessProgress("Checking sstate mirror object availability", len(tasklist) - thread_worker.tasks.qsize()), d)
 
@@ -823,6 +844,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
             pool.start()
             pool.wait_completion()
             bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
+            if whitelist and missing:
+                bb.fatal('Required artifacts were unavailable - exiting')
 
     inheritlist = d.getVar("INHERIT", True)
     if "toaster" in inheritlist:
meta/conf/bitbake.conf +2 -1
index 2e95819..45d9862 100644
@@ -817,7 +817,8 @@ BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
     SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \
     PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
     GIT_PROXY_COMMAND ALL_PROXY all_proxy NO_PROXY no_proxy FTP_PROXY ftp_proxy \
-    HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD"
+    HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD \
+    BB_SETSCENE_ENFORCE"
 BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
     lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
     file-checksums python func task export unexport noexec nostamp dirs cleandirs \
scripts/oe-buildenv-internal +1 -1
index 56d3419..03dc50f 100755
@@ -118,7 +118,7 @@ BB_ENV_EXTRAWHITE_OE="MACHINE DISTRO TCMODE TCLIBC HTTP_PROXY http_proxy \
 HTTPS_PROXY https_proxy FTP_PROXY ftp_proxy FTPS_PROXY ftps_proxy ALL_PROXY \
 all_proxy NO_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY \
 SDKMACHINE BB_NUMBER_THREADS BB_NO_NETWORK PARALLEL_MAKE GIT_PROXY_COMMAND \
-SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR BBPATH_EXTRA"
+SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR BBPATH_EXTRA BB_SETSCENE_ENFORCE"
 
 BB_ENV_EXTRAWHITE="$(echo $BB_ENV_EXTRAWHITE $BB_ENV_EXTRAWHITE_OE | tr ' ' '\n' | LC_ALL=C sort --unique | tr '\n' ' ')"
 
Signature · 1 line
2.5.5
#10 lore raw

PATCH v2 6/10 classes/testsdk: print output correctly on failure

In reply to Paul Eggleton

With Python 3 we get a bytes object from the command output and not a string, which gives some ugly formatting for error messages unless you decode it first.

---
 meta/classes/testsdk.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/testsdk.bbclass +2 -2
index f4dc2c3..18f7678 100644
@@ -65,7 +65,7 @@ def testsdk_main(d):
     try:
         subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
     except subprocess.CalledProcessError as e:
-        bb.fatal("Couldn't install the SDK:\n%s" % e.output)
+        bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8"))
 
     try:
         run_test_context(SDKTestContext, d, sdktestdir, tcname, pn)
@@ -116,7 +116,7 @@ def testsdkext_main(d):
     try:
         subprocess.check_output("%s -y -d %s/tc" % (tcname, testdir), shell=True)
     except subprocess.CalledProcessError as e:
-        bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output)
+        bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output.decode("utf-8"))
 
     try:
         bb.plain("Running SDK Compatibility tests ...")
Signature · 1 line
2.5.5
#11 lore raw

PATCH v2 7/10 classes/populate_sdk_ext: eliminate double execution on install

In reply to Paul Eggleton

Use the new BB_SETSCENE_ENFORCE functionality to avoid having to run bitbake twice on installing the extensible SDK - we can now do it all in one invocation which not only takes less time, but we should also get more meaningful errors for some types of failure, in particular where downloading from an sstate mirror fails.

One result of this change is that you get the errors printed on the console during normal output rather than this going to the preparing_build_system.log file first. In OE-Core revision 227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the contents of preparing_build_system.log on failure, but now at least the error contents of that log is duplicated. Besides, I intentionally didn't print out the contents of that log during normal usage because it's quite verbose - the bug that we were attempting to fix was about not getting this information when seeing failures in the automated tests, thus I've moved printing the log to the test handling code instead.

Part of the implementation of [YOCTO #9367].

---
 meta/classes/populate_sdk_ext.bbclass |  7 +++--
 meta/classes/testsdk.bbclass          | 12 ++++++--
 meta/files/ext-sdk-prepare.py         | 52 +----------------------------------
 3 files changed, 16 insertions(+), 55 deletions(-)
meta/classes/populate_sdk_ext.bbclass +5 -2
index b9d9543..df39ff6 100644
@@ -223,10 +223,13 @@ python copy_buildsystem () {
             # warning.
             f.write('SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK = "none"\n\n')
 
-            # Error if the sigs in the locked-signature file don't match
+            # Warn if the sigs in the locked-signature file don't match
             # the sig computed from the metadata.
             f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n\n')
 
+            # Set up whitelist for run on install
+            f.write('BB_SETSCENE_ENFORCE_WHITELIST = "%:* *:do_shared_workdir *:do_rm_work"\n\n')
+
             # Hide the config information from bitbake output (since it's fixed within the SDK)
             f.write('BUILDCFG_HEADER = ""\n')
 
@@ -424,7 +427,7 @@ sdk_ext_postinst() {
 		# current working directory when first ran, nor will it set $1 when
 		# sourcing a script. That is why this has to look so ugly.
 		LOGFILE="$target_sdk_dir/preparing_build_system.log"
-		sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py '${SDK_INSTALL_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE"; cat "$LOGFILE"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
+		sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py '${SDK_INSTALL_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE for a slightly more detailed log"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
 		rm $target_sdk_dir/ext-sdk-prepare.py
 	fi
 	echo done
meta/classes/testsdk.bbclass +10 -2
index 18f7678..0b8716e 100644
@@ -113,10 +113,18 @@ def testsdkext_main(d):
     testdir = d.expand("${WORKDIR}/testsdkext/")
     bb.utils.remove(testdir, True)
     bb.utils.mkdirhier(testdir)
+    sdkdir = os.path.join(testdir, 'tc')
     try:
-        subprocess.check_output("%s -y -d %s/tc" % (tcname, testdir), shell=True)
+        subprocess.check_output("%s -y -d %s" % (tcname, sdkdir), shell=True)
     except subprocess.CalledProcessError as e:
-        bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output.decode("utf-8"))
+        msg = "Couldn't install the extensible SDK:\n%s" % e.output.decode("utf-8")
+        logfn = os.path.join(sdkdir, 'preparing_build_system.log')
+        if os.path.exists(logfn):
+            msg += '\n\nContents of preparing_build_system.log:\n'
+            with open(logfn, 'r') as f:
+                for line in f:
+                    msg += line
+        bb.fatal(msg)
 
     try:
         bb.plain("Running SDK Compatibility tests ...")
meta/files/ext-sdk-prepare.py +1 -51

67 lines not on this page · raw message

Signature · 1 line
2.5.5
#12 lore raw

Re: [PATCH v2 07/10] classes/populate_sdk_ext: eliminate double execution on install

Quoted 11 lines · On Fri, 24 Jun 2016 00:07:03 Paul Eggleton wrote:

One result of this change is that you get the errors printed on the console during normal output rather than this going to the preparing_build_system.log file first. In OE-Core revision 227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the contents of preparing_build_system.log on failure, but now at least the error contents of that log is duplicated. Besides, I intentionally didn't print out the contents of that log during normal usage because it's quite verbose - the bug that we were attempting to fix was about not getting this information when seeing failures in the automated tests, thus I've moved printing the log to the test handling code instead.

I just realised, this comment and the associated changes should have been squashed into patch 9/10 and not this one. Accordingly I have moved them there and pushed a new paule/startup-oe branch - ultimately the code at the end of the series ends up being exactly the same though.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#13 lore raw

PATCH v2 8/10 lib/oe/sstatesig: print locked sigs file message only when explicitly called

In reply to Paul Eggleton

If we're building the extensible SDK we don't need to see the "Writing locked sigs" message; it's only necessary when the user explicitly runs bitbake -S none <target>.

---
 meta/lib/oe/sstatesig.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
meta/lib/oe/sstatesig.py +4 -6
index a58f03a..8224e3a 100644
@@ -130,7 +130,9 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
         super(bb.siggen.SignatureGeneratorBasicHash, self).set_taskdata(coredata)
 
     def dump_sigs(self, dataCache, options):
-        self.dump_lockedsigs()
+        sigfile = os.getcwd() + "/locked-sigs.inc"
+        bb.plain("Writing locked sigs to %s" % sigfile)
+        self.dump_lockedsigs(sigfile)
         return super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigs(dataCache, options)
 
     def get_taskhash(self, fn, task, deps, dataCache):
@@ -181,11 +183,7 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
             return
         super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime)
 
-    def dump_lockedsigs(self, sigfile=None, taskfilter=None):
-        if not sigfile:
-            sigfile = os.getcwd() + "/locked-sigs.inc"
-
-        bb.plain("Writing locked sigs to %s" % sigfile)
+    def dump_lockedsigs(self, sigfile, taskfilter=None):
         types = {}
         for k in self.runtaskdeps:
             if taskfilter:
Signature · 1 line
2.5.5
#14 lore raw

PATCH v2 9/10 classes/populate_sdk_ext: show progress when preparing build system

In reply to Paul Eggleton

During the extensible SDK installation process the final step is to prepare the internal copy of the build system. This can take some time, especially if you have SDK_EXT_TYPE set to "minimal" (downloading sstate artifacts) and SDK_INCLUDE_PKGDATA set to "1" (restoring pkgdata for world). To make this a bit less painful, use BitBake's new quiet mode to display status during this operation so you have some idea of how it's progressing; instead of redirecting the output to preparing_build_system.log we grab the last console log and append it instead.

Part of the implementation for [YOCTO #9613].

---
 meta/classes/populate_sdk_ext.bbclass |  2 +-
 meta/files/ext-sdk-prepare.py         | 67 ++++++++++++++++++++++-------------
 2 files changed, 44 insertions(+), 25 deletions(-)
meta/classes/populate_sdk_ext.bbclass +1 -1
index df39ff6..5e1a485 100644
@@ -427,7 +427,7 @@ sdk_ext_postinst() {
 		# current working directory when first ran, nor will it set $1 when
 		# sourcing a script. That is why this has to look so ugly.
 		LOGFILE="$target_sdk_dir/preparing_build_system.log"
-		sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py '${SDK_INSTALL_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE for a slightly more detailed log"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
+		sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py $LOGFILE '${SDK_INSTALL_TARGETS}'" || { echo "ERROR: SDK preparation failed: see $LOGFILE for a slightly more detailed log"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
 		rm $target_sdk_dir/ext-sdk-prepare.py
 	fi
 	echo done
meta/files/ext-sdk-prepare.py +43 -24

86 lines not on this page · raw message

Signature · 1 line
2.5.5
#15 lore raw

PATCH v2 10/10 toolchain-shar-extract.sh: allow TERM through into SDK installer env

In reply to Paul Eggleton

In order to show the task progress during the extensible SDK installation, knotty needs to know it is using a terminal it can support the "interactive" mode on (i.e. ncurses can be used), which means it needs access to the TERM variable value, so allow that through into the cleaned environment within the SDK installation script.

Part of the implementation for [YOCTO #9613].

---
 meta/files/toolchain-shar-extract.sh | 1 +
 1 file changed, 1 insertion(+)
meta/files/toolchain-shar-extract.sh +1 -0
index d1ce86d..9279310 100644
@@ -2,6 +2,7 @@
 
 [ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" \
 	LC_ALL=en_US.UTF-8 \
+	TERM=$TERM \
 	http_proxy="$http_proxy" https_proxy="$https_proxy" ftp_proxy="$ftp_proxy" \
 	no_proxy="$no_proxy" all_proxy="$all_proxy" GIT_PROXY_COMMAND="$GIT_PROXY_COMMAND" "$0" "$@"
 [ -f /etc/environment ] && . /etc/environment
Signature · 1 line
2.5.5