Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 791349 - net-fs/samba: add sys-libs/llvm-libunwind as another possibility with sys-libs/libunwind
Summary: net-fs/samba: add sys-libs/llvm-libunwind as another possibility with sys-lib...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
: 829756 (view as bug list)
Depends on:
Blocks: 804333
  Show dependency tree
 
Reported: 2021-05-21 16:20 UTC by Adel KARA SLIMANE
Modified: 2022-10-04 01:01 UTC (History)
22 users (show)

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


Attachments
Proposal for a fix using a new virtual/libunwind ebuild (libunwind-0.ebuild,435 bytes, text/plain)
2021-11-11 08:59 UTC, Jocelyn Mayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adel KARA SLIMANE 2021-05-21 16:20:06 UTC
Hello,

I was following [1] to be able to use clang to build packages so I can compile the kernel with Clang, I have an issue with it as I need to use sys-libs/llvm-libunwind. [1] says that sys-libs/llvm-libunwind as a drop-in replacement for sys-libs/libunwind.

Unfortunately, net-fs/samba pulls only sys-libs/libunwind and makes it impossible to switch to sys-libs/llvm-libunwind. 

I edited line 93 of the EBUILD from 

```!alpha? ( !sparc? ( sys-libs/libunwind:= ) )```

to

```!alpha? ( !sparc? ( || ( sys-libs/libunwind:= sys-libs/llvm-libunwind ) ) )```

And it seems to build just fine on my machine where I replaced sys-libs/libunwind with sys-libs/llvm-libunwind


[1] https://wiki.gentoo.org/wiki/Clang
Comment 1 Arfrever Frehtes Taifersar Arahesis 2021-05-31 21:15:33 UTC
https://github.com/gentoo/gentoo/pull/20761
Comment 2 Jan Henke 2021-06-11 07:34:14 UTC
This bug is now blocking an update on my system. As Clang now newly depends on sys-devel/llvm-libunwind, but samba pulling in sys-devel/libunwind and both cannot be installed at the same time. Please work on getting the PR ready and merged.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-11 07:39:45 UTC
(In reply to Jan Henke from comment #2)
> This bug is now blocking an update on my system. As Clang now newly depends
> on sys-devel/llvm-libunwind, but samba pulling in sys-devel/libunwind and
> both cannot be installed at the same time. Please work on getting the PR
> ready and merged.

Isn’t it optional on Clang….?
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-11 07:41:15 UTC
(In reply to Jan Henke from comment #2)
> This bug is now blocking an update on my system. As Clang now newly depends
> on sys-devel/llvm-libunwind, but samba pulling in sys-devel/libunwind and
> both cannot be installed at the same time. Please work on getting the PR
> ready and merged.

I think as ever, full emerge output would be useful.
Comment 5 Jan Henke 2021-06-11 09:26:58 UTC
Sorry, was distracted by work:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] dev-perl/GSSAPI-0.280.0-r2 [0.280.0-r1]
[ebuild   R    ] sys-libs/libomp-11.1.0  ABI_X86="32*" 
[ebuild  N     ] sys-libs/llvm-libunwind-11.1.0  USE="-debug -static-libs -test" ABI_X86="32 (64) (-x32)" 
[ebuild   R    ] sys-libs/libcxxabi-11.1.0  ABI_X86="32*" 
[ebuild   R    ] sys-libs/libcxx-11.1.0  ABI_X86="32*" 
[ebuild   R    ] sys-devel/clang-runtime-11.1.0  ABI_X86="32*" 
[ebuild   R    ] sys-devel/clang-runtime-10.0.1  ABI_X86="32*" 
[blocks B      ] sys-libs/libunwind ("sys-libs/libunwind" is blocking sys-libs/llvm-libunwind-11.1.0)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (sys-libs/libunwind-1.5.0-r1:0/8::gentoo, installed) pulled in by
    sys-libs/libunwind:= required by (net-fs/samba-4.13.9:0/0::gentoo, installed) USE="acl addns ads client cups ldap pam python regedit system-mitkrb5 winbind zeroconf -addc -ceph -cluster -debug (-dmapi) (-fam) -glusterfs -gpg -iprint -json -ntvfs -profiling-data -quota (-selinux) -snapper -spotlight -syslog (-system-heimdal) -systemd (-test)" ABI_X86="(64) -32 (-x32)" PYTHON_SINGLE_TARGET="python3_9 -python3_8"
    sys-libs/libunwind:0/8= required by (net-fs/samba-4.13.9:0/0::gentoo, installed) USE="acl addns ads client cups ldap pam python regedit system-mitkrb5 winbind zeroconf -addc -ceph -cluster -debug (-dmapi) (-fam) -glusterfs -gpg -iprint -json -ntvfs -profiling-data -quota (-selinux) -snapper -spotlight -syslog (-system-heimdal) -systemd (-test)" ABI_X86="(64) -32 (-x32)" PYTHON_SINGLE_TARGET="python3_9 -python3_8"

  (sys-libs/llvm-libunwind-11.1.0:0/0::gentoo, ebuild scheduled for merge) pulled in by
    >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_s390_32(-)?,abi_s390_64(-)?] (>=sys-libs/llvm-libunwind-3.9.0-r1[abi_x86_32(-),abi_x86_64(-)]) required by (sys-libs/libcxxabi-11.1.0:0/0::gentoo, ebuild scheduled for merge) USE="libunwind -static-libs -test" ABI_X86="32 (64) (-x32)"
Comment 6 Jan Henke 2021-06-11 09:27:55 UTC
Command line:

emerge --oneshot --ask --keep-going --update --newuse --autounmask --deep --with-bdeps=y @world
Comment 7 Arfrever Frehtes Taifersar Arahesis 2021-06-11 20:01:49 UTC
(In reply to Jan Henke from comment #2 and comment #6)

Your problems are unrelated to this bug.
Both sys-devel/clang and sys-libs/libcxxabi depend on either sys-devel/libunwind or sys-devel/llvm-libunwind.

Probable cause of your problem is mismatched USE flags:
ABI_X86="32" for sys-libs/libcxxabi and sys-libs/llvm-libunwind
ABI_X86="-32" for sys-libs/libunwind
Since USE flags are satisfied only by sys-libs/llvm-libunwind and not by sys-libs/libunwind, Portage incorrectly suggests switching from sys-libs/libunwind to sys-libs/llvm-libunwind.

This happens since:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d10cdcf53d0f254880621200ec882af96c59914e

Maybe abi_x86_32 should be enabled by default for sys-libs/libunwind.
Comment 8 Jan Henke 2021-06-11 20:28:27 UTC
Well, I tend to disagree. At least partially it is related to this bug, because samba prevents switching to sys-devel/llvm-libunwind (which would be my preferred sulution anyway). Thus making net-fs/samba support sys-devel/llvm-libunwind as well would allow me to proceed to switch my libunwind.

Anyway, I am aware that this is all done by people in their spare time and there is no right to demand any solution. Nevertheless I want to point out that the recent change to sys-devel/clang made this change more urgent, as there is now additional motivation to switch to LLVM's libunwind implementation.
Comment 9 Adel KARA SLIMANE 2021-06-11 22:07:12 UTC
I just got the same dependency issue with clang pulling libunwind with the new change, the new change should include clang 32bit too :thinking:


```
 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (sys-libs/libunwind-1.5.0-r1:0/8::gentoo, ebuild scheduled for merge) pulled in by
    sys-libs/libunwind:= required by (net-fs/samba-4.14.5-r1:0/0::gentoo-adel, installed) USE="acl client cups pam regedit system-mitkrb5 systemd -addc -addns -ads -ceph -cluster -debug (-dmapi) (-fam) -glusterfs -gpg -iprint -json -ldap -ntvfs -profiling-data -python -quota (-selinux) -snapper -spotlight -syslog (-system-heimdal) (-test) -winbind -zeroconf" ABI_X86="(64) -32 (-x32)" PYTHON_SINGLE_TARGET="python3_8 -python3_9"
    sys-libs/libunwind required by (sys-devel/clang-12.0.0-r1:12/12::gentoo, installed) USE="default-compiler-rt default-lld static-analyzer xml -debug -default-libcxx -doc -test" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="AMDGPU BPF NVPTX (X86) -AArch64 -ARC -ARM -AVR (-CSKY) -Hexagon -Lanai -MSP430 -Mips -PowerPC -RISCV -Sparc -SystemZ -VE -WebAssembly -XCore" PYTHON_SINGLE_TARGET="python3_8 -python3_7 -python3_9"

  (sys-libs/llvm-libunwind-12.0.0:0/0::gentoo, installed) pulled in by
    sys-libs/llvm-libunwind:0/0= required by (net-fs/samba-4.14.5-r1:0/0::gentoo-adel, installed) USE="acl client cups pam regedit system-mitkrb5 systemd -addc -addns -ads -ceph -cluster -debug (-dmapi) (-fam) -glusterfs -gpg -iprint -json -ldap -ntvfs -profiling-data -python -quota (-selinux) -snapper -spotlight -syslog (-system-heimdal) (-test) -winbind -zeroconf" ABI_X86="(64) -32 (-x32)" PYTHON_SINGLE_TARGET="python3_8 -python3_9"
    sys-libs/llvm-libunwind required by @selected 
    >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_s390_32(-)?,abi_s390_64(-)?] (>=sys-libs/llvm-libunwind-3.9.0-r1[abi_x86_32(-),abi_x86_64(-)]) required by (sys-libs/libcxxabi-12.0.0:0/0::gentoo, ebuild scheduled for merge) USE="libunwind -static-libs -test" ABI_X86="32 (64) (-x32)"
```
Comment 10 Adel KARA SLIMANE 2021-06-11 22:50:36 UTC
(In reply to Adel KARA SLIMANE from comment #9)

As stated in a comment in the PR https://github.com/gentoo/gentoo/pull/20761 clang version 12.0.0-r1 needs now the `llvm-libunwind` USE flag when using `sys-libs/llvm-libunwind` that fixed the dependency issue.
Comment 11 Arfrever Frehtes Taifersar Arahesis 2021-06-12 06:51:56 UTC
Currently 3 packages have any dependency on sys-libs/llvm-libunwind:

- dev-cpp/glog[libunwind] and sys-devel/clang[default-compiler-rt] have "llvm-libunwind" USE flag and have generally this dependency:

  llvm-libunwind? ( sys-libs/llvm-libunwind )
  !llvm-libunwind? ( sys-libs/libunwind )

- sys-libs/libcxxabi[libunwind] is missing "llvm-libunwind" USE flag and has old-style dependency:
  || (
    sys-libs/libunwind
    sys-libs/llvm-libunwind
  )

Bug #722992 contains patch for sys-libs/libcxxabi to use "llvm-libunwind" USE flag.

|| ( ... ) combined with mismatching USE flags (in this case caused by profile) can make Portage's dependency resolver incorrectly suggest switching from one package to another package (sys-libs/libunwind -> sys-libs/llvm-libunwind).

After bug #722992 is fixed, the worst what should happen is that Portage's autounmasker will suggest enabling "abi_x86_32" USE flag for sys-libs/libunwind and its dependencies (app-arch/xz-utils, sys-libs/zlib).

Users who want to use sys-libs/libunwind should not enable "llvm-libunwind" USE flag (it is disabled by default).

Users who want to use sys-libs/llvm-libunwind should enable "llvm-libunwind" USE flag.
However support for sys-libs/llvm-libunwind in Gentoo should be considered experimental for now.
Comment 12 Conrad Kostecki gentoo-dev 2021-11-10 19:41:59 UTC
Any news here?
Comment 13 Jocelyn Mayer 2021-11-11 08:59:27 UTC
Created attachment 750324 [details]
Proposal for a fix using a new virtual/libunwind ebuild

This file is a new virtual I used to compile net-fs/samba using llvm-libunwind.
The changes to net-fs/samba ebuild is as following:
--- net-fs/samba/samba-4.14.9.ebuild    2021-10-30 19:39:54.000000000 +0200
+++ net-fs/samba/samba-4.14.9.ebuild    2021-10-31 11:06:36.604155041 +0100
@@ -90,7 +90,7 @@
                        net-dns/bind-tools[gssapi]
                )
        ")
-       !alpha? ( !sparc? ( sys-libs/libunwind:= ) )
+       !alpha? ( !sparc? ( virtual/libunwind:= ) )
        acl? ( virtual/acl )
        ceph? ( sys-cluster/ceph )
        cluster? ( net-libs/rpcsvc-proto )

Seems to be fine for me, on amd64 machines.
Comment 14 Ionen Wolkens gentoo-dev 2021-12-21 07:40:53 UTC
*** Bug 829756 has been marked as a duplicate of this bug. ***
Comment 15 INODE64 Sistemas 2022-02-20 08:24:43 UTC
I make a pull request https://github.com/gentoo/gentoo/pull/24280


I think that this bug could be closed and create a new one to add the virtual/libunwind package and adjust all the packages that use it, This problem is not only exclusive to net-fs/samba
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-21 06:01:39 UTC
(In reply to INODE64 Sistemas from comment #15)
> I make a pull request https://github.com/gentoo/gentoo/pull/24280
> 

We need to fix the automagic.

> 
> I think that this bug could be closed and create a new one to add the
> virtual/libunwind package and adjust all the packages that use it, This
> problem is not only exclusive to net-fs/samba

A virtual cannot be done because the two are not ABI compatible (think e.g. libressl and openssl). A USE flag must be added to all pkgs.
Comment 17 accelerat0r 2022-04-28 07:52:33 UTC
why this is still unconfirmed ? this is clearly happening with the package 

[ebuild  N     ] sys-libs/libunwind-1.6.2  USE="zlib -debug -debug-frame -doc -libatomic -lzma -static-libs -test"
[ebuild  N     ] net-fs/samba-4.16.0-r1  USE="acl pam regedit system-mitkrb5 -addc -ads -ceph -client -cluster -cups -debug (-fam) -glusterfs -gpg -iprint -json -ldap -profiling-data -python -quota (-selinux) -snapper -spotlight -syslog (-system-heimdal) -systemd (-test) -winbind -zeroconf" CPU_FLAGS_X86="aes" PYTHON_SINGLE_TARGET="python3_9 -python3_8 -python3_10"
[blocks B      ] sys-libs/libunwind ("sys-libs/libunwind" is soft blocking sys-libs/llvm-libunwind-14.0.1)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (sys-libs/libunwind-1.6.2:0/8::gentoo, ebuild scheduled for merge) pulled in by
    sys-libs/libunwind:= required by (net-fs/samba-4.16.0-r1:0/0::gentoo, ebuild scheduled for merge) USE="acl pam regedit system-mitkrb5 -addc -ads -ceph -client -cluster -cups -debug (-fam) -glusterfs -gpg -iprint -json -ldap -profiling-data -python -quota (-selinux) -snapper -spotlight -syslog (-system-heimdal) -systemd (-test) -winbind -zeroconf" CPU_FLAGS_X86="aes" PYTHON_SINGLE_TARGET="python3_9 -python3_10 -python3_8"

  (sys-libs/llvm-libunwind-14.0.1:0/0::gentoo, installed) pulled in by
    sys-libs/llvm-libunwind required by @selected
Comment 18 Larry the Git Cow gentoo-dev 2022-09-30 02:46:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e24041ef403ad622cc187eea98e42b0fa291cf11

commit e24041ef403ad622cc187eea98e42b0fa291cf11
Author:     Fco Javier Felix <ffelix@inode64.com>
AuthorDate: 2022-09-24 06:30:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-30 02:46:28 +0000

    net-fs/samba: Make libunwind optional (fix automagic dep)
    
    It's only for debug and backtraces.
    
    Backport from samba-4.17, Look at the bugs in:
    https://gitlab.com/samba-team/samba/-/merge_requests/2401?commit_id=ac8064cb0d79db377df75a22a240632dbc37f99f
    https://gitlab.com/samba-team/samba/-/commit/14feb93d481011765f62614ab49b304e17e4f6fd
    
    See: https://github.com/gentoo/gentoo/pull/24280
    Closes: https://bugs.gentoo.org/791349
    Closes: https://github.com/gentoo/gentoo/pull/27422
    Package-Manager: Portage-3.0.36, pkgcheck-0.10.14
    Signed-off-by: Fco Javier Felix <web@inode64.com>
    Signed-off-by: Fco Javier Felix <ffelix@inode64.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/samba-4.15.9-libunwind-automagic.patch   | 118 +++++++++++++++++++++
 net-fs/samba/metadata.xml                          |   1 +
 ...{samba-4.15.9.ebuild => samba-4.15.9-r1.ebuild} |  11 +-
 ...mba-4.16.0-r1.ebuild => samba-4.16.0-r2.ebuild} |  11 +-
 ...{samba-4.16.1.ebuild => samba-4.16.1-r1.ebuild} |  11 +-
 ...{samba-4.16.2.ebuild => samba-4.16.2-r1.ebuild} |  11 +-
 ...{samba-4.16.4.ebuild => samba-4.16.4-r1.ebuild} |  11 +-
 7 files changed, 159 insertions(+), 15 deletions(-)