Bug 13849 - xmlcatalog: not found from build_native_sysroot
Summary: xmlcatalog: not found from build_native_sysroot
Status: RESOLVED FIXED
Alias: None
Product: Functional (self) Testing
Classification: QA/Testing
Component: oe-selftest (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 3.2 M1
Assignee: Jeremy A. Puhlman
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-03-29 11:27 UTC by Richard Purdie
Modified: 2020-06-23 08:43 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2020-03-29 11:27:41 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/816

2020-03-29 02:32:01,328 - oe-selftest - INFO - ======================================================================
2020-03-29 02:32:01,328 - oe-selftest - INFO - ERROR: setUpClass (package.VersionOrdering) [ (subunit.RemotedTestCase)
2020-03-29 02:32:01,328 - oe-selftest - INFO - ----------------------------------------------------------------------
2020-03-29 02:32:01,329 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/core/case.py", line 39, in _oeSetUpClass
    clss.setUpClassMethod()
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/package.py", line 29, in setUpClass
    bitbake("build-sysroots -c build_native_sysroot")
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/utils/commands.py", line 221, in bitbake
    return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options)
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/utils/commands.py", line 199, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command 'bitbake  build-sysroots -c build_native_sysroot' returned non-zero exit status 1:
Loading cache...done.
Loaded 1335 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.44.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.0+snapshot-20200329"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "master:1bf1e1539fb72f0bc594b4b2367482dd13c8c633"
meta-selftest        = "master:7d4dad562daab30e6e7383be72bfcdcbb20cba4d"

Initialising tasks...done.
Sstate summary: Wanted 0 Found 0 Missed 0 Current 0 (0% match, 0% complete)
NOTE: No setscene tasks
NOTE: Executing Tasks
NOTE: Running task 1 of 1 (/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/recipes-core/meta/build-sysroots.bb:do_build_native_sysroot)
NOTE: recipe build-sysroots-1.0-r0: task do_build_native_sysroot: Started
ERROR: build-sysroots-1.0-r0 do_build_native_sysroot: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_build_native_sysroot(d)
     0003:
File: '/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/recipes-core/meta/build-sysroots.bb', lineno: 23, function: do_build_native_sysroot
     0019:
     0020:python do_build_native_sysroot () {
     0021:    targetsysroot = d.getVar("STANDALONE_SYSROOT")
     0022:    nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
 *** 0023:    staging_populate_sysroot_dir(targetsysroot, nativesysroot, True, d)
     0024:}
     0025:do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}"
     0026:do_build_native_sysroot[nostamp] = "1"
     0027:addtask do_build_native_sysroot before do_build
File: '/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/classes/staging.bbclass', lineno: 236, function: staging_populate_sysroot_dir
     0232:                        continue
     0233:
     0234:    staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
     0235:    for p in postinsts:
 *** 0236:        subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
     0237:
     0238:#
     0239:# Manifests here are complicated. The main sysroot area has the unpacked sstate
     0240:# which us unrelocated and tracked by the main sstate manifests. Each recipe
File: '/usr/lib/python3.5/subprocess.py', lineno: 316, function: check_output
     0312:        # empty string. That is maintained here for backwards compatibility.
     0313:        kwargs['input'] = '' if kwargs.get('universal_newlines', False) else b''
     0314:
     0315:    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
 *** 0316:               **kwargs).stdout
     0317:
     0318:
     0319:class CompletedProcess(object):
     0320:    """A process that has finished running.
File: '/usr/lib/python3.5/subprocess.py', lineno: 398, function: run
     0394:            raise
     0395:        retcode = process.poll()
     0396:        if check and retcode:
     0397:            raise CalledProcessError(retcode, process.args,
 *** 0398:                                     output=stdout, stderr=stderr)
     0399:    return CompletedProcess(process.args, retcode, stdout, stderr)
     0400:
     0401:
     0402:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command '/home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog' returned non-zero exit status 127

Subprocess output:
/home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: 5: /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: xmlcatalog: not found
/home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: 8: /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/sysroots/x86_64/usr/bin/postinst-docbook-xml-dtd4-native-xmlcatalog: xmlcatalog: not found

ERROR: Logfile of failure stored in: /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/work/qemux86_64-poky-linux/build-sysroots/1.0-r0/temp/log.do_build_native_sysroot.27871
NOTE: recipe build-sysroots-1.0-r0: task do_build_native_sysroot: Failed
ERROR: Task (/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/recipes-core/meta/build-sysroots.bb:do_build_native_sysroot) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and 1 failed.
NOTE: The errors for this build are stored in /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/log/error-report/error_report_20200329012539.txt
You can send the errors to a reports server by running:
  send-error-report /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-18573/tmp/log/error-report/error_report_20200329012539.txt [-s server]
NOTE: The contents of these logs will be posted in public if you use the above command with the default server. Please ensure you remove any identifying or proprietary information when prompted before sending.

Summary: 1 task failed:
  /home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/recipes-core/meta/build-sysroots.bb:do_build_native_sysroot
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

----------------------------------------------------------------------
Comment 1 Jaewon Lee 2020-04-21 16:31:33 UTC
seems to be related to this bug here:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13732

posting my quick analysis in case it helps,

Im seeing this error too, specifically when im extracting an esdk only.
I worked around it by using full path by sticking a $bindir before the xmlcatalog call,  from doing this i realized during the build its not failing because recipe-sysroot-native/usr/bin (of whoever inheriting xmlcatalog) is in the PATH during SYSROOT_PREPROCESS_FUNCS.  But during extraction of esdk xmlcatalog not found anywhere in PATH.
Id guess what bindir expands to at that step(tmp/sysroots/x86_64/usr/bin) should be in the PATH? xmlcatalog is present there is why the workaround works
Comment 2 Jeremy A. Puhlman 2020-06-22 14:45:40 UTC
The specific reason why this fails is that the build-sysroot sysroot is not built-in dependency order, because it doesn't take dependencies into consideration at all so xmlcatalog gets installed near the end due to the English alphabet.

Oddly I sent a patch on Friday that didn't land on the list that added an exit 0 to the end of the generated script, but there was also a patch last year to resolve the same issue by just bailing if it doesn't exist:

https://lists.openembedded.org/g/openembedded-core/message/126570?p=,,,20,0,0,0::Created,,xmlcatalog%3A+add+exit+0,20,2,0,72380410
Comment 3 Jeremy A. Puhlman 2020-06-23 08:43:28 UTC
This is already resolved in master and dunfell.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dunfell&id=5d53b2117ba860b33fef6aad1000e9c5efb4f2a7