]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
populate_sdk_ext.bbclass: redirect stderr to stdout so that both end in LOGFILE
authorMartin Jansa <Martin.Jansa@gmail.com>
Tue, 11 Apr 2023 09:03:47 +0000 (11:03 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 May 2023 11:46:11 +0000 (12:46 +0100)
commit719f22df160ebde303274ccfc04049cffdb51577
treecc5c4c9499d97454f878f5d44c9b676fb1bf86b8
parent19c9ba1089863b8ba2ff8e089cce29d16993c8f8
populate_sdk_ext.bbclass: redirect stderr to stdout so that both end in LOGFILE

* this in the end doesn't help much, I was debugging warning (about base-files.do_install
  signature being different than expected) from:

  python3 $target_sdk_dir/ext-sdk-prepare.py $LOGFILE '${SDK_INSTALL_TARGETS}'

  this shows the warning on console, but it doesn't end in $LOGFILE, because it
  writes only contents of cooker log into the $LOGFILE with:

    with open(logfile, 'a') as logf:
        logf.write('Preparing SDK for %s...\n' % ', '.join(sdk_targets))

        ret = run_command_interruptible('BB_SETSCENE_ENFORCE=1 bitbake --quiet %s' % ' '.join(sdk_targets))
        if not ret:
            ret = run_command_interruptible('bitbake --quiet build-sysroots')
        lastlog = get_last_consolelog()
        if lastlog:
            with open(lastlog, 'r') as f:
                for line in f:
                    logf.write(line)
        if ret:
            print('ERROR: SDK preparation failed: error log written to %s' % logfile)
            return ret

  maybe we could remove whole support for $LOGFILE parameter and just redirect
  the output like other commands on this line

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
meta/classes-recipe/populate_sdk_ext.bbclass