void-linux / void-linux/void-packages
Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 3.4k
- Forks
- 2.8k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 299
Description
From xlocate libgomp.spec:
[...]
cross-x86_64-linux-musl-libc-0.34_1 /usr/x86_64-linux-musl/usr/lib/libgomp.spec
libgomp-devel-10.2.1pre1_3 /usr/lib/libgomp.spec
makedepends are installed in the cross root after the cross toolchain is installed in the host, which means libgomp-devel replaces libgomp.spec from the cross toolchain. Then, when the dependencies are removed, all the usr/lib/libgomp* files are removed, leaving the cross toolchain broken (xbps-pkgdb complains).
@q66 suggested fixing this by adding libgomp related stuff to cross-vpkg-dummy, so that it would be resolved to cross-vpkg-dummy, but that doesn't fix things, since it apparently breaks how XBPS resolves libraries (might be a xbps bug too, @Chocimier and @Duncaen):
My patch:
diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index 9de559bce0..a0125a8ef9 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,6 +1,6 @@
# Template file for 'cross-vpkg-dummy'
pkgname=cross-vpkg-dummy
-version=0.37
+version=0.38
revision=1
build_style=meta
short_desc="Dummy meta-pkg for cross building packages with xbps-src"
@@ -23,6 +23,8 @@ provides="
libgfortran-devel-9999_1
libgo-9999_1
libgo-devel-9999_1
+ libgomp-9999_1
+ libgomp-devel-9999_1
libobjc-9999_1
libobjc-devel-9999_1
gcc-9999_1
@@ -44,6 +46,8 @@ conflicts="
libgfortran-devel>=0
libgo>=0
libgo-devel>=0
+ libgomp>=0
+ libgomp-devel>=0
libobjc>=0
libobjc-devel>=0
gcc>=0
@@ -56,6 +60,7 @@ shlib_provides="
libgcc_s.so.1
libgnat-10.so
libgnarl-10.so
+ libgomp.so.1
libstdc++.so.6
libgfortran.so.5"
Result of trying to install something and a package that's replaced by cross-vpkg-dummy (this is what happens in the makedepends install step):
<bps-install -c host/repocache-aarch64-musl/ -r usr/aarch64-linux-musl/ alsa-lib libgomp-devel
acl-2.3.1_1: broken, unresolvable shlib `libc.so'
alsa-lib-1.2.4_2: broken, unresolvable shlib `libc.so'
Transaction aborted due to unresolved shlibs.
This would lead me to assume there's a limitation in how cross-vpkg-dummy works in that you can't use it to replace things in makedepends, and, furthermore, that our unusual split of "full featured cross toolchains" and "separate subpackage for each feature in native toolchains" leads to breakage in this scenario.
This can also be observed if one removes nocross from gnustep-base, where it also fails in the makedepends installation step due to libobjc-devel.
A heavy handed solution is adding such libraries to hostmakedepends or conditionally to makedepends only when not cross building, but that's very ugly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with srcpkgs/cross-vpkg-dummy/template and reproduce the makedepends installation using the xbps-install command shown in the issue. Compare the cross toolchain files before and after removing dependencies, then check xbps-pkgdb and the gnustep-base case. Done means cross builds no longer leave the toolchain with missing or unresolved libraries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100