Bug 14601

Summary: python3-native: undefined symbol: archive_version_number
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Thomas Perrot <thomas.perrot>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: anuj.mittal, meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, tim.orling
Version: unspecified   
Target Milestone: 4.0 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Thomas Perrot 2021-10-13 10:14:35 UTC
This issue only occurs on Ubuntu 16.04, it seems due to a missing dependency to libarchive.

2021-10-13 03:07:25,141 - oe-selftest - INFO - ======================================================================
2021-10-13 03:07:25,141 - oe-selftest - INFO - FAIL: test_diffoscope (reproducible.DiffoscopeTests)
2021-10-13 03:07:25,142 - oe-selftest - INFO - ----------------------------------------------------------------------
2021-10-13 03:07:25,142 - oe-selftest - INFO - Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/meta/lib/oeqa/selftest/cases/reproducible.py", line 131, in test_diffoscope
    run_diffoscope('A', 'A', tmpdir,
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/meta/lib/oeqa/selftest/cases/reproducible.py", line 118, in run_diffoscope
    return runCmd(['diffoscope', '--no-default-limits', '--exclude-directory-metadata', 'yes', '--html-dir', html_dir, a_dir, b_dir],
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/meta/lib/oeqa/utils/commands.py", line 207, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command '['diffoscope', '--no-default-limits', '--exclude-directory-metadata', 'yes', '--html-dir', '/tmp/tmpulzgsw7k', 'A', 'A']' returned non-zero exit status 2:
Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/build-st/tmp/work/x86_64-linux/diffoscope-native/182-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/diffoscope/main.py", line 722, in main
    import libarchive  # noqa
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/build-st/tmp/work/x86_64-linux/diffoscope-native/182-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/libarchive/__init__.py", line 1, in <module>
    from .entry import ArchiveEntry
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/build-st/tmp/work/x86_64-linux/diffoscope-native/182-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/libarchive/entry.py", line 4, in <module>
    from . import ffi
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/build-st/tmp/work/x86_64-linux/diffoscope-native/182-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/libarchive/ffi.py", line 160, in <module>
    version_number = ffi('version_number', [], c_int, check_int)
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/build-st/tmp/work/x86_64-linux/diffoscope-native/182-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/libarchive/ffi.py", line 104, in ffi
    f = getattr(libarchive, 'archive_'+name)
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/build-st/tmp/work/x86_64-linux/diffoscope-native/182-r0/recipe-sysroot-native/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/home/pokybuild/yocto-worker/reproducible-ubuntu/build/build-st/tmp/work/x86_64-linux/diffoscope-native/182-r0/recipe-sysroot-native/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: nativepython3: undefined symbol: archive_version_number
Missing or incomplete libarchive module. Try installing your system's 'libarchive' package.
Comment 3 Richard Purdie 2021-11-14 19:54:32 UTC
Issue occurs on systems using buildtools tarball. Behind the scenes in strace you see it compiling something with gcc to access libarchive and that fails with glibc symbol mismatches since the glibc used for libarchive was newer than the one in buildtools.

Upgrading buildtools resolves the issue:

http://git.yoctoproject.org/cgit.cgi/yocto-autobuilder-helper/commit/?id=f5e89b7431fcde4c54617eca2fbeae43557811d8