Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
@ 2021-05-21 18:36 ericonr
  2021-12-28  3:54 ` tornaria
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ericonr @ 2021-05-21 18:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2917 bytes --]

New issue by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/31055

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
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
@ 2021-12-28  3:54 ` tornaria
  2021-12-28  3:58 ` tornaria
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tornaria @ 2021-12-28  3:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1001855016

Comment:
What would happen if we add `libgomp-devel` as a dependency to `cross-vpkg-dummy` (and maybe to `base-chroot`, while we are at it).

In this way, `libgomp-devel` is always available, just like gcc or glibc.  Are there any downsides of that?

In #34469 it seems I can "fix" the issue when building `siril` by just adding `libgomp-devel` to `makedepends` (unconditionally) which I think would be implicit in what I suggested above.

What I don't understand is why `siril` needs `libgomp.spec` when building cross but it doesn't need it when building native.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
  2021-12-28  3:54 ` tornaria
@ 2021-12-28  3:58 ` tornaria
  2022-01-04  8:18 ` ericonr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tornaria @ 2021-12-28  3:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1001855903

Comment:
A different solution (which also seems to work) is to run
```
$XBPS_INSTALL_CMD -Ayf cross-$XBPS_CROSS_TRIPLET-libc
```
when cross building, but this seems more costly.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
  2021-12-28  3:54 ` tornaria
  2021-12-28  3:58 ` tornaria
@ 2022-01-04  8:18 ` ericonr
  2022-01-10 14:38 ` tornaria
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2022-01-04  8:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1004605819

Comment:
> In this way, libgomp-devel is always available, just like gcc or glibc. Are there any downsides of that?

I think this would make disabling libgomp in some cases harder. I don't know the exact implications of that, though.

> What I don't understand is why siril needs libgomp.spec when building cross but it doesn't need it when building native.

I remember running across something like that when I was debugging this stuff, don't remember my conclusions...

> when cross building, but this seems more costly.

Shouldn't be too much; just unpacking is generally pretty fast, IMO.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
                   ` (2 preceding siblings ...)
  2022-01-04  8:18 ` ericonr
@ 2022-01-10 14:38 ` tornaria
  2022-01-13 19:37 ` Chocimier
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tornaria @ 2022-01-10 14:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1008935998

Comment:
I know what happens with siril:
```
$ grep Libs: /usr/aarch64-linux-gnu/usr/lib/pkgconfig/libraw.pc 
Libs: -L${libdir} -lraw -lstdc++ -fopenmp
```
Since siril links to libraw, it will inherit the `-fopenmp` flag thus requiring libgomp-devel.

Normally _for cross builds_  this is not a problem since libgomp-devel is implicit. But note that for non-cross builds on aarch64 this would still be a problem.

Maybe a package having `-fopenmp` in its pkgconfig should depend on `libgomp-devel` to avoid this breakage.

Why is this happening? My guess is that when cross building libraw detects openmp is available at compile time so it uses it. When nocross building libraw doesn't use openmp.

Random thoughts:
 - if libraw can use openmp, maybe we want to use it for nocross as well, so add libgomp-devel explicitly
 - maybe a hook should check if `-fopenmp` is in some pkgconfig but `libgomp-devel` is not in depends and error out?
 - if `libgomp-devel` is implicit in every cross build, shouldn't also be implicit in every nocross build? Maybe more programs can benefit from openmp (e.g. siril itself I think can use openmp, not only indirectly via libraw).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
                   ` (3 preceding siblings ...)
  2022-01-10 14:38 ` tornaria
@ 2022-01-13 19:37 ` Chocimier
  2022-05-20  2:12 ` github-actions
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Chocimier @ 2022-01-13 19:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1012447457

Comment:
Xbps behaviour seen here is that while installing `libgomp-devel`, it sees `cross-vpkg-dummy` currently installed with `provides=libgomp-devel`. So it wants to remove `cross-vpkg-dummy`. That, in turn, makes `libc.so` of shlib-provides not available, and transactions is declined.

I think it would be enough to fix https://github.com/void-linux/xbps/issues/363. Then, `cross-vpkg-dummy` would satisfy dependency on `libgomp-devel`, not install it, and `cross-*-libc` files would be used during build.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
                   ` (4 preceding siblings ...)
  2022-01-13 19:37 ` Chocimier
@ 2022-05-20  2:12 ` github-actions
  2024-02-05 10:43 ` oreo639
  2024-02-05 10:43 ` oreo639
  7 siblings, 0 replies; 9+ messages in thread
From: github-actions @ 2022-05-20  2:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1132374627

Comment:
Issues become stale 90 days after last activity and are closed 14 days after that.  If this issue is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
                   ` (5 preceding siblings ...)
  2022-05-20  2:12 ` github-actions
@ 2024-02-05 10:43 ` oreo639
  2024-02-05 10:43 ` oreo639
  7 siblings, 0 replies; 9+ messages in thread
From: oreo639 @ 2024-02-05 10:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1926690896

Comment:
I looked in to this a bit regarding the gcc 13.2 update. (it was brought up on IRC at the time, I didn't notice this issue until now)

I did try adding libgomp to cross-vpkg-dummy and noticed the behavior as described by Chocimier.

I added a `rm` for libgomp to void-cross: (not --disable since the headers don't conflict and are necessary)
https://github.com/void-linux/void-packages/blob/master/common/build-style/void-cross.sh#L646

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cross building packages with `libgomp-devel` in makedepends breaks the masterdir
  2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
                   ` (6 preceding siblings ...)
  2024-02-05 10:43 ` oreo639
@ 2024-02-05 10:43 ` oreo639
  7 siblings, 0 replies; 9+ messages in thread
From: oreo639 @ 2024-02-05 10:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/issues/31055#issuecomment-1926690896

Comment:
I looked in to this a bit regarding the gcc 13.2 update. (it was brought up on IRC at the time, I didn't notice this issue until now)

I did try adding libgomp to cross-vpkg-dummy and noticed the behavior described by Chocimier.

I added a `rm` for libgomp to void-cross: (not --disable since the headers don't conflict and are necessary)
https://github.com/void-linux/void-packages/blob/master/common/build-style/void-cross.sh#L646

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-05 10:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 18:36 [ISSUE] Cross building packages with `libgomp-devel` in makedepends breaks the masterdir ericonr
2021-12-28  3:54 ` tornaria
2021-12-28  3:58 ` tornaria
2022-01-04  8:18 ` ericonr
2022-01-10 14:38 ` tornaria
2022-01-13 19:37 ` Chocimier
2022-05-20  2:12 ` github-actions
2024-02-05 10:43 ` oreo639
2024-02-05 10:43 ` oreo639

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).