Bug 14206

Summary: oe-selftest perl errors on rpm based distros
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Alexandre Belloni <alexandre.belloni>
Component: coreAssignee: Mingli Yu <mingli.yu>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: Jagadheesan_Duraisamy, meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, sakib.sajal, tgamblin, tim.orling
Version: 3.3   
Target Milestone: 5.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Alexandre Belloni 2021-01-29 01:18:21 UTC
When running on an rpm distribution (in that case centos), oe-selftest seems to include perl files from the host and prints out errors that seem harmless:

2021-01-27 19:20:17,391 - oe-selftest - INFO - 9: 5/10 26/423 (0.30s) (package.VersionOrdering.test_opkg)
error: /etc/rpm/macros.perl: line 34: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 35: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 34: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 35: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 34: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 35: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 34: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 35: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 34: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 35: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 34: Macro %global is a built-in (%define)
error: /etc/rpm/macros.perl: line 35: Macro %global is a built-in (%define)
2021-01-27 19:20:19,902 - oe-selftest - INFO - package.VersionOrdering.test_rpm (subunit.RemotedTestCase)
2021-01-27 19:20:19,903 - oe-selftest - INFO -  ... ok

Including files from the host is probably an issue. This will get hidden when using more recent distributions:
https://bugzilla.redhat.com/show_bug.cgi?id=1532539

Full autobuilder log here: https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/1761/steps/15/logs/stdio
Comment 1 Richard Purdie 2021-02-04 15:33:59 UTC
Only appears on centos7 systems as on other systems the error was fixed in the macros.perl file but we shouldn't be looking at host files. We need to figure out how to stop rpm looking at this file.
Comment 3 Randy MacLeod 2023-07-26 21:22:03 UTC
Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.
Comment 4 Trevor Gamblin 2023-09-14 16:43:52 UTC
Moved to M4.
Comment 5 Randy MacLeod 2023-10-30 15:29:09 UTC
Bulk move to 5.0 M1. -- Randy
Comment 6 Randy MacLeod 2023-12-21 23:28:31 UTC
Bulk move of 52 5.0-M1 bugs to M2.
Comment 7 Randy MacLeod 2024-01-25 14:28:51 UTC
Bulk move of bugs owned by "unassigned" from 5.0-M2 to 5.0-M3.
Comment 8 Randy MacLeod 2024-02-22 18:03:21 UTC
It's possible that this poky commit:

commit d426872674ab31a57cc593303a16ca409ecb0c1c
Author: Alexander Kanavin <alex.kanavin@gmail.com>
Date:   Tue Feb 6 04:13:46 2024

    lzlib: add a recipe
    
    This is needed for rpm reproducibility, as otherwise libmagic
    will call an external lzip executable, which is both
    non-threadsafe, and non-deterministic w.r.t sysroot presence.
    
    (From OE-Core rev: 0e4bde86e1aa499274fc85d01d36a74c3401762e)
    
    Signed-off-by: Alexander Kanavin <alex@linutronix.de>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

although not perl-related, may help. If anyone re-tests, please comment.
Comment 9 Randy MacLeod 2024-07-25 15:01:41 UTC
Maybe any rpm-based distro not just a centos7 system.
Randy will test on Fedora.
Comment 10 Randy MacLeod 2025-08-14 15:56:04 UTC
Mingli, please check if you can reproduce this issue.
Comment 11 Mingli Yu 2025-09-04 06:14:54 UTC
Hi Randy,

I didn't reproduce the issue on Fedora 42.
$ cat /etc/redhat-release 
Fedora release 42 (Adams)

$ oe-selftest   -r package.VersionOrdering.test_opkg
2025-09-04 14:04:15,244 - oe-selftest - INFO - test_opkg (package.VersionOrdering.test_opkg)
2025-09-04 14:04:15,300 - oe-selftest - INFO -  ... ok
2025-09-04 14:04:32,561 - oe-selftest - INFO - ----------------------------------------------------------------------
2025-09-04 14:04:32,562 - oe-selftest - INFO - Ran 1 test in 1759.347s
2025-09-04 14:04:32,562 - oe-selftest - INFO - OK
2025-09-04 14:04:46,644 - oe-selftest - INFO - RESULTS:
2025-09-04 14:04:46,645 - oe-selftest - INFO - RESULTS - package.VersionOrdering.test_opkg: PASSED (0.06s)
2025-09-04 14:04:46,646 - oe-selftest - INFO - SUMMARY:
2025-09-04 14:04:46,646 - oe-selftest - INFO - oe-selftest () - Ran 1 test in 1759.348s
2025-09-04 14:04:46,646 - oe-selftest - INFO - oe-selftest - OK - All required tests passed (successes=1, skipped=0, failures=0, errors=0)
Comment 12 Randy MacLeod 2025-11-13 15:13:32 UTC
Seems to be fixed as per Mingli's comment.