Bug 13122

Summary: Multilib check error: duplicate files pyconfig.h is not the same
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Athanasios Oikonomou <athoik>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: akuster808, kai.kang, Martin.Jansa, meta.mr.watcher, meta.watcher, raj.khem, randy.macleod, richard.purdie, ross.burton
Version: unspecified   
Target Milestone: 5.1   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Athanasios Oikonomou 2019-01-04 19:09:29 UTC
Building multilib python-core and lib32-python-core results in the following error:

$ bitbake core-image-minimal
...
ERROR: core-image-minimal-1.0-r0 do_rootfs: Multilib check error: duplicate files /opt/openembedded-core/build/tmp-musl/work/qemuarm64-oe-linux-musl/core-image-minimal/1.0-r0/multilib/lib32/usr/include/python2.7/pyconfig.h /opt/openembedded-core/build/tmp-musl/work/qemuarm64-oe-linux-musl/core-image-minimal/1.0-r0/rootfs/usr/include/python2.7/pyconfig.h is not the same

ERROR: core-image-minimal-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /opt/openembedded-core/build/tmp-musl/work/qemuarm64-oe-linux-musl/core-image-minimal/1.0-r0/temp/log.do_rootfs.10995
ERROR: Task (/opt/openembedded-core/meta/recipes-core/images/core-image-minimal.bb:do_rootfs) failed with exit code '1'

I am using the following settings in local.conf

MACHINE = "qemuarm64"
BB_NUMBER_THREADS = "4"
PARALLEL_MAKE = "-j 8"
TCLIBC = "musl"
INHERIT += "rm_work"
DL_DIR = "/opt/sources"
TOPDIR = "/opt/openembedded-core/build"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "gobject-introspection-data"
GIO_MODULE_PACKAGES = ""
LICENSE_FLAGS_WHITELIST="commercial"

require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "armv7ahf-neon-vfpv4"
# Specify the 32-bit libraries to be added to the image
IMAGE_INSTALL_append = " lib32-libgcc lib32-libstdc++ python-core lib32-python-core"

Please note that TCLIBC seems the culprit. Tried with default glibc and problem doesn't appear.

Tests performed with master OE-Core e0db1beb6.
Comment 1 Kai Kang 2019-01-07 03:28:30 UTC
It calls function oe_multilib_header() to deal pyconfig.h for multilib in python recipe. The function is from multilib_header.bbclass and disabled for musl by commit 7e84ec1


commit 7e84ec1a7420b63932d3aaf141e62db550f9bd13
Author: Khem Raj <raj.khem@gmail.com>
Date:   Thu May 29 00:01:03 2014 -0700

    multilib_header: Do not install mutlilib headers for musl
    
    musl is not multilib and this creates trouble. eg. when
    util-linux probes for ncurses it does not find it because
    ncurses has installed the multilibbed header and this
    header includes bits/wordsize.h and this header does not
    exist on musl systems. If and when musl adds multilib
    support we will revisit it.
    
    (From OE-Core rev: dad1c2746326912db41a3ff180679cdfe0e844f9)
    
    Signed-off-by: Khem Raj <raj.khem@gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 2 Ross Burton 2019-01-08 12:38:11 UTC
Khem: does musl support multilib?

I guess we either should enable multilib headers under musl, or make musl error out if multilib is enabled.
Comment 3 Khem Raj 2019-01-08 15:25:28 UTC
(In reply to comment #2)
> Khem: does musl support multilib?
> 
> I guess we either should enable multilib headers under musl, or make musl
> error out if multilib is enabled.

it can we have never added it and it does not have to since it s a new library.
lets disable it
Comment 4 Ross Burton 2019-01-10 15:42:31 UTC
Khem: by 'it' do you mean lets disable multilib under musl?
Comment 5 Richard Purdie 2020-04-08 23:19:18 UTC
I've sent a patch to disable musl if multilibs are enabled so the user is told clearly its not supported.
Comment 6 Khem Raj 2020-04-09 01:11:51 UTC
(In reply to comment #5)
> I've sent a patch to disable musl if multilibs are enabled so the user is
> told clearly its not supported.

I think an alternate to enable multilib headers for musl is better, I have tested exact same image as reported in image and its working ok with the patch [1] applied to oe-core.

[1] https://lists.openembedded.org/g/openembedded-core/topic/patch_multilib_enable/72887956
Comment 7 Richard Purdie 2020-07-13 06:07:58 UTC
Sadly we were unable to enable multilib for musl. Any update on that khem?
Comment 8 Khem Raj 2020-07-13 17:20:51 UTC
(In reply to comment #7)
> Sadly we were unable to enable multilib for musl. Any update on that khem?

it should work fine these days, I have fixed the ldso issues which were the problem
Comment 9 Khem Raj 2020-08-20 21:42:50 UTC
Patch to finally enable multilib with musl is sent to mailing list for review, the test mentioned in comment #1 should work fine now.
Comment 11 Randy MacLeod 2022-11-03 15:27:31 UTC
RP said: musl has been enabled but just needs to be retested.
Comment 12 Richard Purdie 2024-08-06 09:25:55 UTC
MACHINE = "qemuarm64"
TCLIBC = "musl"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE:virtclass-multilib-lib32 = "armv7ahf-neon-vfpv4"
IMAGE_INSTALL:append = " lib32-libgcc lib32-libstdc++ python3-core lib32-python3-cor

and running "bitbake core-image-minimal" results in:

Error: Transaction test error:
  file /usr/bin/ldd conflicts between attempted installs of musl-1.2.4+git0+79bdacff83-r0.cortexa57 and lib32-musl-1.2.4+git0+79bdacff83-r0.armv7ahf_neon_vfpv4
  file /usr/include/python3.12/pyconfig.h conflicts between attempted installs of lib32-python3-core-3.12.4-r0.armv7ahf_neon_vfpv4 and python3-core-3.12.4-r0.cortexa57

so the issue is still present as of 5.1 M2
Comment 13 Richard Purdie 2024-08-06 09:33:29 UTC
musl multilib headers are disabled. If I enable them:

diff --git a/meta/classes-recipe/multilib_header.bbclass b/meta/classes-recipe/multilib_header.bbclass
index 33f7e027f06..7c454f4f06d 100644
--- a/meta/classes-recipe/multilib_header.bbclass
+++ b/meta/classes-recipe/multilib_header.bbclass
@@ -13,12 +13,6 @@ inherit siteinfo
 #
 oe_multilib_header() {
 
-       case ${HOST_OS} in
-       *-musl*)
-               return
-               ;;
-       *)
-       esac
         # For MIPS: "n32" is a special case, which needs to be
         # distinct from both 64-bit and 32-bit.
         case ${TARGET_ARCH} in

then the build breaks as the multilib header code doesn't work on musl.
Comment 14 Richard Purdie 2024-08-06 09:47:07 UTC
I'm sending my patch to error for this config again. We can remove the patch if this does get fixed to work.
Comment 15 Richard Purdie 2024-08-07 16:09:25 UTC
musl marked as not compatible with multilib: https://git.yoctoproject.org/poky/commit/?id=4ca98d99046da0297eb7cb8c7444427bbfc0b9b7