| Summary: | "oe-selftest --newbuilddir" fails when BB_LOGCONFIG contains the old builddir | ||
|---|---|---|---|
| Product: | [QA/Testing] Functional (self) Testing | Reporter: | Yoann Congal <yoann.congal> |
| Component: | oe-selftest | Assignee: | Yoann Congal <yoann.congal> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | quaresma.jose, randy.macleod, yoann.congal |
| Version: | unspecified | ||
| Target Milestone: | 5.1 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
I have found the same for BBLAYERS that was fixed [1] expanding any relative path that could exist. [1] https://git.yoctoproject.org/poky/commit/?id=f5f465ff5777eb99941db3dda84e65d4699d97f7 Maybe it would be better to also expand BB_LOGCONFIG when the newbuilddir argument is present. NB: https://git.yoctoproject.org/yocto-autobuilder-helper/commit/?id=6f48f65c682c2ec076f926891a98913fb09647d4 does contain a workaround this bug (but should not be fully reversed, I did put 2 things in my patch -_-') => Once this bug is fixed, the workaround should be removed Bumping target milestone to 5.0 M2 Bulk move to Milestone 5.0 M3 Bulk move to 5.0 M4 (In reply to Yoann Congal from comment #3) > NB: > https://git.yoctoproject.org/yocto-autobuilder-helper/commit/ > ?id=6f48f65c682c2ec076f926891a98913fb09647d4 does contain a workaround this > bug (but should not be fully reversed, I did put 2 things in my patch -_-') > => Once this bug is fixed, the workaround should be removed Workaround removal sent: https://lists.yoctoproject.org/g/yocto-patches/message/650 (In reply to Yoann Congal from comment #9) > Workaround removal sent: > https://lists.yoctoproject.org/g/yocto-patches/message/650 merged https://git.yoctoproject.org/yocto-autobuilder-helper/commit/?id=3278a99ea0df1dd75402383bad2fbf073bf8efcc |
When BB_LOGCONFIG contains a path relative to the build directory (this is the case on the autobuilder), oe-selftest with the --newbuilddir option fails. This fails: $ rm -rf /home/yocon/Documents/projets/yocto/poky/build/build-test && BB_LOGCONFIG=/home/yocon/Documents/projets/yocto/poky/build/../bitbake/contrib/autobuilderlog.json oe-selftest --newbuilddir /home/yocon/Documents/projets/yocto/poky/build/build-test -r runcmd.RunCmdTests.test_log 2023-10-19 00:01:58,629 - oe-selftest - INFO - Changing cwd to /home/yocon/Documents/projets/yocto/poky/build 2023-10-19 00:01:58,630 - oe-selftest - INFO - Adding layer libraries: 2023-10-19 00:01:58,630 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta/lib 2023-10-19 00:01:58,630 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta-yocto-bsp/lib 2023-10-19 00:01:58,630 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta-openembedded/meta-oe/lib 2023-10-19 00:01:58,631 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta-selftest/lib 2023-10-19 00:01:58,633 - oe-selftest - INFO - Checking base configuration is valid/parsable NOTE: Starting bitbake server... 2023-10-19 00:02:03,692 - oe-selftest - INFO - Adding: "include selftest.inc" in /home/yocon/Documents/projets/yocto/poky/build/build-test/build-st/conf/local.conf 2023-10-19 00:02:03,693 - oe-selftest - INFO - Adding: "include bblayers.inc" in bblayers.conf 2023-10-19 00:02:03,694 - oe-selftest - INFO - test_log (runcmd.RunCmdTests) 2023-10-19 00:02:03,708 - oe-selftest - INFO - ... ok 2023-10-19 00:02:08,770 - oe-selftest - INFO - ---------------------------------------------------------------------- 2023-10-19 00:02:08,770 - oe-selftest - INFO - Ran 1 test in 8.142s 2023-10-19 00:02:08,771 - oe-selftest - INFO - OK Traceback (most recent call last): File "/home/yocon/Documents/projets/yocto/poky/scripts/oe-selftest", line 60, in <module> ret = main() File "/home/yocon/Documents/projets/yocto/poky/scripts/oe-selftest", line 47, in main results = args.func(logger, args) File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/selftest/context.py", line 440, in run rc = self._internal_run(logger, args) File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/selftest/context.py", line 404, in _internal_run configuration = self.get_configuration(args) File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/selftest/context.py", line 374, in get_configuration metadata = metadata_from_bb() File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/utils/metadata.py", line 27, in metadata_from_bb data_dict = get_bb_vars() File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/utils/commands.py", line 248, in get_bb_vars bbenv = get_bb_env(target, postconfig=postconfig) File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/utils/commands.py", line 244, in get_bb_env return bitbake("-e", postconfig=postconfig).output File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/utils/commands.py", line 234, in bitbake return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options) File "/home/yocon/Documents/projets/yocto/poky/meta/lib/oeqa/utils/commands.py", line 212, in runCmd raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output)) AssertionError: Command 'bitbake -e' returned non-zero exit status 1: Traceback (most recent call last): File "/home/yocon/Documents/projets/yocto/poky/bitbake/bin/bitbake", line 36, in <module> sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv), File "/home/yocon/Documents/projets/yocto/poky/bitbake/lib/bb/main.py", line 404, in bitbake_main return ui_module.main(server_connection.connection, server_connection.events, File "/home/yocon/Documents/projets/yocto/poky/bitbake/lib/bb/ui/knotty.py", line 568, in main conf = bb.msg.setLoggingConfig(logconfig, logconfigfile) File "/home/yocon/Documents/projets/yocto/poky/bitbake/lib/bb/msg.py", line 301, in setLoggingConfig with open(os.path.normpath(userconfigfile), 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/yocon/Documents/projets/yocto/poky/build/build-test/bitbake/contrib/autobuilderlog.json' This succeed: $ rm -rf /home/yocon/Documents/projets/yocto/poky/build/build-test && BB_LOGCONFIG=/home/yocon/Documents/projets/yocto/poky/bitbake/contrib/autobuilderlog.json oe-selftest --newbuilddir /home/yocon/Documents/projets/yocto/poky/build/build-test -r runcmd.RunCmdTests.test_log 2023-10-19 00:02:45,342 - oe-selftest - INFO - Changing cwd to /home/yocon/Documents/projets/yocto/poky/build 2023-10-19 00:02:45,343 - oe-selftest - INFO - Adding layer libraries: 2023-10-19 00:02:45,343 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta/lib 2023-10-19 00:02:45,343 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta-yocto-bsp/lib 2023-10-19 00:02:45,343 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta-openembedded/meta-oe/lib 2023-10-19 00:02:45,344 - oe-selftest - INFO - /home/yocon/Documents/projets/yocto/poky/meta-selftest/lib 2023-10-19 00:02:45,346 - oe-selftest - INFO - Checking base configuration is valid/parsable NOTE: Starting bitbake server... 2023-10-19 00:02:50,610 - oe-selftest - INFO - Adding: "include selftest.inc" in /home/yocon/Documents/projets/yocto/poky/build/build-test/build-st/conf/local.conf 2023-10-19 00:02:50,610 - oe-selftest - INFO - Adding: "include bblayers.inc" in bblayers.conf 2023-10-19 00:02:50,611 - oe-selftest - INFO - test_log (runcmd.RunCmdTests) 2023-10-19 00:02:50,626 - oe-selftest - INFO - ... ok 2023-10-19 00:02:55,693 - oe-selftest - INFO - ---------------------------------------------------------------------- 2023-10-19 00:02:55,694 - oe-selftest - INFO - Ran 1 test in 8.191s 2023-10-19 00:02:55,694 - oe-selftest - INFO - OK 2023-10-19 00:03:09,852 - oe-selftest - INFO - RESULTS: 2023-10-19 00:03:09,853 - oe-selftest - INFO - RESULTS - runcmd.RunCmdTests.test_log: PASSED (0.02s) 2023-10-19 00:03:09,857 - oe-selftest - INFO - SUMMARY: 2023-10-19 00:03:09,857 - oe-selftest - INFO - oe-selftest () - Ran 1 test in 8.193s 2023-10-19 00:03:09,857 - oe-selftest - INFO - oe-selftest - OK - All required tests passed (successes=1, skipped=0, failures=0, errors=0) Note the difference in BB_LOGCONFIG: FAIL: /home/yocon/Documents/projets/yocto/poky/build/../bitbake/contrib/autobuilderlog.json PASS: /home/yocon/Documents/projets/yocto/poky/bitbake/contrib/autobuilderlog.json My hypothesis is that oe-selftest --newbuilddir tries to rewrite paths from the old builddir to the newly created one, and, doing so rewrite the path for the autobuilderlog.json file to a non-existing path. One workaround in the autobuilder case: Use "readlink -f" to make the path of BB_LOGCONFIG absolute.