Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 891197 - multilib-build.eclass: multilib_check_headers refuses to merge when headers are only present for native ABI
Summary: multilib-build.eclass: multilib_check_headers refuses to merge when headers a...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-17 14:01 UTC by Jocelyn Mayer
Modified: 2023-01-29 18:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-libs/imath log file when attempting to merge it as a multilib package. (imath-3.1.5.log,359.17 KB, text/x-log)
2023-01-17 14:01 UTC, Jocelyn Mayer
Details
dev-libs/imath ebuild patch used for multilib compilation (dev-libs_imath_imath-3.1.5.ebuild.patch,962 bytes, patch)
2023-01-17 14:14 UTC, Jocelyn Mayer
Details | Diff
dev-libs/imath x86_32 ABI support patch (Imath-3.1.1-abi_x86_32.patch,337 bytes, patch)
2023-01-17 14:15 UTC, Jocelyn Mayer
Details | Diff
media-libs/openexr ebuild patch used for multilib compilation (media-libs_openexr_openexr-3.1.5.ebuild.patch,1021 bytes, patch)
2023-01-17 14:15 UTC, Jocelyn Mayer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2023-01-17 14:01:39 UTC
Created attachment 848735 [details]
dev-libs/imath log file when attempting to merge it as a multilib package.

When trying to merge some multilib packages, there may be packages that would not install headers but for the native ABI. There would be no difference between native and multilib ABI headers.
I then suggest that, in the case the difference between installed headers in only additional headers for the native ABI, multilib_check_headers would not emit any error.
An example could be dev-libs/imath: it could be merged as a multilib package when adding this behavior as it just does not install any headers but for the native ABI. This specific case would be of use in order to be able to build a multilib version of media-libs/openexr, as an example.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-17 14:07:48 UTC
Isn't this what the wrapped array is for?
Comment 2 Jocelyn Mayer 2023-01-17 14:14:44 UTC
Created attachment 848737 [details, diff]
dev-libs/imath ebuild patch used for multilib compilation
Comment 3 Jocelyn Mayer 2023-01-17 14:15:20 UTC
Created attachment 848739 [details, diff]
dev-libs/imath x86_32 ABI support patch
Comment 4 Jocelyn Mayer 2023-01-17 14:15:58 UTC
Created attachment 848741 [details, diff]
media-libs/openexr ebuild patch used for multilib compilation
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-01-17 14:16:52 UTC
This is working as intended.  If headers are installed only for the native ABI, then packages built for other ABIs cannot use these headers.  Therefore, they need to be wrapped to prevent them from being used by builds on non-native ABIs.
Comment 6 Jocelyn Mayer 2023-01-17 15:54:07 UTC
This might be the case for most package.
For the imath package, the native ABI headers contain checks like:
if !defined(__x86_64__) // if defined(__x86_64__)
so they are safe to be use for 32 ABI even if not installed explicitly for the 32 bits ABI.
Maybe a specific ebuild MULTILIB_xxx variable may be added to allow the case only for packages that proove to be safely used with the non native ABI(s) ?
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-01-17 18:23:20 UTC
(In reply to Jocelyn Mayer from comment #6)
> This might be the case for most package.
> For the imath package, the native ABI headers contain checks like:
> if !defined(__x86_64__) // if defined(__x86_64__)
> so they are safe to be use for 32 ABI even if not installed explicitly for
> the 32 bits ABI.
> Maybe a specific ebuild MULTILIB_xxx variable may be added to allow the case
> only for packages that proove to be safely used with the non native ABI(s) ?

How would that be useful if the 32-bit library is not installed?
Comment 8 Jocelyn Mayer 2023-01-17 19:46:43 UTC
in the example I used there, the 32 bits library is installed, which allows one to build a multilib openexr package, which will allow use of multilib opencv with openexr support allowed for 32 bits apps.
There sure are more examples to find...
Comment 9 Jocelyn Mayer 2023-01-29 18:25:11 UTC
maybe my explanations weren't clear, for this specific case:
in case one tries to build it with multilib, all specified ABI libraries are properly built and installed.
The only drawback is that only the main ABI installs headers.
No headers for alternate ABIs being installed and the main ABI headers being safe for use for all ABIs, at least on x86_64 arch, it seems safe to merge the package.
My suggestion was not to merge when there only are headers additions, but when there only are headers installed for the main ABI, which seems to me to be quite a good practice from the developers in order to avoid file collisions, it seems this point was actually not clear at all !