rui314 / mold

Mold: A Modern Linker 🦠
MIT License
14.27k stars 469 forks source link

gentoo-test.sh failes due to a conflict #1330

Closed marxin closed 2 months ago

marxin commented 2 months ago

It fails with the following error message:

❯ ./common/gentoo-test.sh make
+ docker image ls mold-gentoo
+ grep -q mold-gentoo
+ set -e
+ cat
+ docker build -t mold-gentoo -
[+] Building 5.2s (7/7) FINISHED                                                                                                                                                                                                                                                                                                                            docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                  0.0s
 => => transferring dockerfile: 643B                                                                                                                                                                                                                                                                                                                                  0.0s
 => [internal] load metadata for docker.io/gentoo/stage3:latest                                                                                                                                                                                                                                                                                                       0.2s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                       0.0s
 => [1/4] FROM docker.io/gentoo/stage3:latest@sha256:c6a9bb1f82cf91fe47a36299f6cbbcedfc74b5d4016387e3dbcf60434346a9c7                                                                                                                                                                                                                                                 0.0s
 => CACHED [2/4] RUN emerge-webrsync                                                                                                                                                                                                                                                                                                                                  0.0s
 => CACHED [3/4] RUN echo 'USE="X ssl elogind -systemd corefonts truetype jpeg jpeg2k tiff zstd static-libs binary"' >> /etc/portage/make.conf &&     echo 'ACCEPT_KEYWORDS="~amd64"' >> /etc/portage/make.conf &&     echo 'ACCEPT_LICENSE="* -@EULA"' >> /etc/portage/make.conf &&     echo 'FEATURES="${FEATURE} noclean nostrip ccache -ipc-sandbox -network-san  0.0s
 => ERROR [4/4] RUN emerge gdb lld clang vim emacs strace ccache xeyes dev-build/cmake dev-vcs/git && rm -rf /var/tmp/portage                                                                                                                                                                                                                                         4.9s
------                                                                                                                                                                                                                                                                                                                                                                     
 > [4/4] RUN emerge gdb lld clang vim emacs strace ccache xeyes dev-build/cmake dev-vcs/git && rm -rf /var/tmp/portage:                                                                                                                                                                                                                                                    
0.444 Calculating dependencies                                                                                                                                                                                                                                                                                                                                             
0.472  * IMPORTANT: 15 news items need reading for repository 'gentoo'.                                                                                                                                                                                                                                                                                                    
0.472  * Use eselect news read to view new items.                                                                                                                                                                                                                                                                                                                          
0.472                                                                                                                                                                                                                                                                                                                                                                      
1.434 .... done!
4.750 Dependency resolution took 4.31 s (backtrack: 15/20).
4.750 
4.763 [ebuild  N     ] acct-group/mail-0-r3 
4.763 [ebuild  N     ] dev-libs/xxhash-0.8.2  ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] sys-devel/llvm-common-18.1.8  USE="-emacs -verify-sig" 
4.763 [ebuild  N     ] x11-libs/xtrans-1.5.0  USE="-doc" 
4.763 [ebuild  N     ] dev-util/shadowman-3 
4.763 [ebuild  N     ] app-eselect/eselect-ctags-1.19 
4.763 [ebuild  N     ] app-eselect/eselect-vi-20221122 
4.763 [ebuild  N     ] app-eselect/eselect-emacs-1.19 
4.763 [ebuild  N     ] app-arch/libarchive-3.7.4  USE="acl bzip2 e2fsprogs iconv lzma static-libs xattr zstd -blake2 -expat -lz4 -lzo -nettle -test -verify-sig" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-base/xcb-proto-1.17.0  PYTHON_TARGETS="python3_12 -python3_10 -python3_11" 
4.763 [ebuild  N     ] app-crypt/rhash-1.4.4-r1  USE="nls ssl static-libs -debug" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] sys-libs/binutils-libs-2.43  USE="cet nls static-libs -64-bit-bfd -multitarget -test" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] dev-perl/TimeDate-2.330.0-r1  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath" 
4.763 [ebuild  N     ] app-editors/vim-core-9.1.0470  USE="acl nls -minimal" 
4.763 [ebuild  N     ] dev-libs/libuv-1.48.0  USE="-verify-sig" 
4.763 [ebuild  N     ] net-libs/liblockfile-1.17  USE="static-libs" 
4.763 [ebuild  N     ] dev-libs/libsodium-1.0.20  USE="asm static-libs urandom -verify-sig" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="-aes -sse4_1" 
4.763 [ebuild  N     ] dev-debug/strace-6.9  USE="-aio -elfutils -perl (-selinux) -static -test -unwind" 
4.763 [ebuild     U  ] dev-lang/perl-5.40.0 [5.38.2-r3]
4.763 [ebuild  N     ] virtual/perl-Digest-MD5-2.580.100_rc-r1 
4.763 [ebuild  N     ] virtual/perl-IO-1.550.0 
4.763 [ebuild  N     ] virtual/perl-MIME-Base64-3.160.100_rc-r1 
4.763 [ebuild  N     ] virtual/perl-Digest-SHA-6.40.0-r1 
4.763 [ebuild  N     ] dev-perl/Digest-HMAC-1.40.0  PERL_FEATURES="(-debug) -ithreads -quadmath" 
4.763 [ebuild  N     ] dev-perl/Net-SSLeay-1.940.0  USE="-examples -minimal -test" PERL_FEATURES="(-debug) -ithreads -quadmath" 
4.763 [ebuild  N     ] dev-perl/Authen-SASL-2.170.0  USE="-kerberos -test" PERL_FEATURES="(-debug) -ithreads -quadmath" 
4.763 [ebuild  N     ] dev-perl/IO-Socket-SSL-2.88.0  USE="-examples -idn -test" PERL_FEATURES="(-debug) -ithreads -quadmath" 
4.763 [ebuild  N     ] virtual/perl-libnet-3.150.0-r1  USE="ssl" 
4.763 [ebuild  N     ] dev-perl/Error-0.170.290  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath" 
4.763 [ebuild  N     ] dev-perl/MailTools-2.210.0  USE="-examples -test" PERL_FEATURES="(-debug) -ithreads -quadmath" 
4.763 [ebuild  N     ] dev-vcs/git-2.45.2  USE="blksha1 curl gpg iconv nls pcre perl safe-directory webdav -cgi -cvs -doc -highlight -keyring -mediawiki -perforce (-selinux) -subversion -test -tk -xinetd" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11 -python3_13" 
4.763 [ebuild  N     ] dev-debug/gdb-15.1  USE="cet nls python server zstd -debuginfod -guile -lzma -multitarget -sim -source-highlight -test -vanilla -xml -xxhash" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11" 
4.763 [ebuild  N     ] app-emacs/emacs-common-1.10  USE="-games -gsettings -gui" 
4.763 [ebuild  N     ] app-editors/emacs-29.4  USE="X acl gmp inotify jpeg ssl threads tiff xpm zlib -Xaw3d -alsa (-aqua) -athena -cairo -dbus -dynamic-loading -games -gfile -gif -gpm -gsettings -gtk -gui -gzip-el -harfbuzz -imagemagick -jit -json -kerberos -lcms -libxml2 -livecd -m17n-lib -mailutils -motif -png (-selinux) -sound -source -sqlite -svg -systemd -toolkit-scroll-bars -tree-sitter -valgrind -webp -wide-int -xft -xwidgets" 
4.763 [ebuild  N     ] sys-devel/clang-common-18.1.8-r1  USE="cet -bootstrap-prefix -default-compiler-rt -default-libcxx -default-lld -hardened -llvm-libunwind -verify-sig" 
4.763 [ebuild  N     ] x11-base/xorg-proto-2024.1  USE="-test" 
4.763 [ebuild  N     ] x11-libs/libICE-1.1.1-r1  ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] dev-libs/jsoncpp-1.9.5  USE="-doc -test" 
4.763 [ebuild  N     ] dev-build/cmake-3.30.2  USE="ncurses -dap -doc -gui -qt6 -test -verify-sig" 
4.763 [ebuild  N     ] x11-libs/libXau-1.0.11  USE="-doc" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libXdmcp-1.1.5  USE="-doc" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libxcb-1.17.0  USE="xkb -doc (-selinux) -test" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libSM-1.2.4  USE="uuid -doc" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-misc/compose-tables-1.8.10 
4.763 [ebuild  N     ] x11-libs/libX11-1.8.10  USE="-doc -test" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libXt-1.3.0  USE="-doc -test" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libXext-1.3.6  USE="-doc" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libXmu-1.2.1  USE="-doc -test" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libXrender-0.9.11  ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libXfixes-6.0.1  USE="-doc" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] x11-libs/libXi-1.8.1  USE="-doc" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] dev-cpp/cpp-httplib-0.16.2  USE="ssl zlib -brotli -test" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] dev-libs/blake3-1.5.3  USE="-test" 
4.763 [ebuild  N     ] dev-libs/libfmt-9.1.0-r2  USE="-test" ABI_X86="(64) -32 (-x32)" 
4.763 [ebuild  N     ] sys-libs/libomp-18.1.8  USE="-debug -gdb-plugin -hwloc -offload -ompt -test -verify-sig" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="-AMDGPU -NVPTX" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11 -python3_13" 
4.763 [ebuild  N     ] sys-devel/llvm-18.1.8-r4  USE="binutils-plugin libffi ncurses zstd -debug -debuginfod -doc -exegesis -libedit -test -verify-sig -xml -z3" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (LoongArch) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) -ARC -CSKY -DirectX -M68k -SPIRV -Xtensa" 
4.763 [ebuild  N     ] sys-devel/llvm-toolchain-symlinks-18-r1  USE="native-symlinks -multilib-symlinks" 
4.763 [ebuild  N     ] sys-devel/llvmgold-18 
4.763 [ebuild  N     ] sys-devel/clang-18.1.8  USE="extra (pie) static-analyzer -debug -doc (-ieee-long-double) -test -verify-sig -xml" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (LoongArch) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) -ARC -CSKY -DirectX -M68k -SPIRV -Xtensa" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11 -python3_13" 
4.763 [ebuild  N     ] sys-devel/clang-toolchain-symlinks-18  USE="native-symlinks -gcc-symlinks -multilib-symlinks" 
4.763 [ebuild  N     ] sys-libs/compiler-rt-18.1.8  USE="clang -debug -test -verify-sig" ABI_X86="32 (64)" 
4.763 [ebuild  N     ] sys-libs/compiler-rt-sanitizers-18.1.8  USE="asan cfi clang dfsan gwp-asan hwasan libfuzzer lsan memprof msan orc profile safestack scudo tsan ubsan xray -debug (-shadowcallstack) -test -verify-sig" ABI_X86="32 (64)" 
4.763 [ebuild  N     ] sys-devel/clang-runtime-18.1.8  USE="compiler-rt openmp sanitize -libcxx" ABI_X86="32 (64) (-x32)" 
4.763 [ebuild  N     ] dev-util/ccache-4.10.2  USE="static-c++ -doc -redis -test -verify-sig" 
4.763 [ebuild  N     ] x11-apps/xeyes-1.3.0 
4.763 [ebuild  N     ] sys-devel/lld-18.1.8  USE="zstd -debug -test -verify-sig" 
4.763 [ebuild  N     ] sys-devel/lld-toolchain-symlinks-18  USE="native-symlinks -multilib-symlinks" 
4.763 [ebuild  N     ] app-editors/vim-9.1.0470  USE="X acl crypt nls -cscope -debug -gpm -lua -minimal -perl -python -racket -ruby (-selinux) -sound -tcl -terminal -vim-pager" LUA_SINGLE_TARGET="lua5-1 -lua5-3 -lua5-4 -luajit" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11" 
4.763 [ebuild  N     ] app-vim/gentoo-syntax-14  USE="-ignore-glep31" 
4.768 
4.768 !!! Multiple package instances within a single package slot have been pulled
4.768 !!! into the dependency graph, resulting in a slot conflict:
4.768 
4.768 dev-lang/perl:0
4.768 
4.768   (dev-lang/perl-5.38.2-r3-1:0/5.38::gentoo, installed) USE="gdbm -berkdb -doc -minimal" ABI_X86="(64)" PERL_FEATURES="(-debug) -ithreads -quadmath" pulled in by
4.768     =dev-lang/perl-5.38* required by (virtual/perl-File-Spec-3.880.0-1:0/0::gentoo, installed) USE="" ABI_X86="(64)"
4.768     ^              ^^^^^                                                                                             
4.768     dev-lang/perl:0/5.38= required by (virtual/perl-Math-BigInt-FastCalc-0.501.300-1:0/0::gentoo, installed) USE="" ABI_X86="(64)"
4.768                  ^^^^^^^^                                                                                                          
4.768     (and 58 more with the same problems)
4.768 
4.768   (dev-lang/perl-5.40.0:0/5.40::gentoo, ebuild scheduled for merge) USE="gdbm -berkdb -doc -minimal" ABI_X86="(64)" PERL_FEATURES="(-debug) -ithreads -quadmath" pulled in by
4.768     =dev-lang/perl-5.40* required by (virtual/perl-Scalar-List-Utils-1.630.0-r1-1:0/0::gentoo, installed) USE="" ABI_X86="(64)"
4.768     ^              ^^^^^                                                                                                        
4.768     (and 18 more with the same problem)
4.768 
4.768 NOTE: Use the '--verbose-conflicts' option to display parents omitted above
4.768 
4.768 It may be possible to solve this problem by using package.mask to
4.768 prevent one of those packages from being selected. However, it is also
4.768 possible that conflicting dependencies exist such that they are
4.768 impossible to satisfy simultaneously.  If such a conflict exists in
4.768 the dependencies of two different packages, then those packages can
4.768 not be installed simultaneously. You may want to try a larger value of
4.768 the --backtrack option, such as --backtrack=30, in order to see if
4.768 that will solve this conflict automatically.
4.768 
4.768 For more information, see MASKED PACKAGES section in the emerge man
4.768 page or refer to the Gentoo Handbook.
4.768 
------
Dockerfile:4
--------------------
   2 |     RUN emerge-webrsync
   3 |     RUN echo 'USE="X ssl elogind -systemd corefonts truetype jpeg jpeg2k tiff zstd static-libs binary"' >> /etc/portage/make.conf &&     echo 'ACCEPT_KEYWORDS="~amd64"' >> /etc/portage/make.conf &&     echo 'ACCEPT_LICENSE="* -@EULA"' >> /etc/portage/make.conf &&     echo 'FEATURES="${FEATURE} noclean nostrip ccache -ipc-sandbox -network-sandbox -pid-sandbox -sandbox"' >> /etc/portage/make.conf &&     echo 'CCACHE_DIR="/ccache"' >> /etc/portage/make.conf
   4 | >>> RUN emerge gdb lld clang vim emacs strace ccache xeyes dev-build/cmake dev-vcs/git && rm -rf /var/tmp/portage
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c emerge gdb lld clang vim emacs strace ccache xeyes dev-build/cmake dev-vcs/git && rm -rf /var/tmp/portage" did not complete successfully: exit code: 1
rui314 commented 2 months ago

I don't know how to fix that. Is there any Gentoo expert who can help me?

I'm using the script to link as many programs as possible with mold for testing. As long as the script works for some packages, I'm fine with that, even if it cannot build all packages.

marxin commented 2 months ago

I'm using the script to link as many programs as possible with mold for testing. As long as the script works for some packages, I'm fine with that, even if it cannot build all packages.

Sure, that's fine that one can't build all packages. But I face a problem where dependencies are installed (in the case of Gentoo build): emerge gdb lld clang vim emacs strace ccache xeyes dev-build/cmake ...

That said, I can't build any package :disappointed:

rui314 commented 2 months ago

You need to run ./dist.sh first to build mold in the top directory. Then try again with a random package. I tried with net-fs/netatalk (a completely random choice) and it did build.

marxin commented 2 months ago

Ok, I see the script depends on the mold binary in the top-level folder. That's something I can build even w/o dist.sh.

What fails for me is the building of mold-gentoo image. Can you please try re-building it:

docker image rm mold-gentoo
./common/gentoo-test.sh net-fs/netatalk

?

marxin commented 2 months ago

The following fixes my problem:

diff --git a/common/gentoo-test.sh b/common/gentoo-test.sh
index fd5c4ca8..b9cd21a1 100755
--- a/common/gentoo-test.sh
+++ b/common/gentoo-test.sh
@@ -26,7 +26,7 @@ if ! docker image ls mold-gentoo | grep -q mold-gentoo; then
   cat <<EOF | docker build -t mold-gentoo -
 FROM gentoo/stage3
 RUN emerge-webrsync
-RUN echo 'USE="X ssl elogind -systemd corefonts truetype jpeg jpeg2k tiff zstd static-libs binary"' >> /etc/portage/make.conf && \
+RUN echo 'USE="X ssl elogind -systemd corefonts truetype jpeg jpeg2k tiff zstd static-libs binary -perl"' >> /etc/portage/make.conf && \
     echo 'ACCEPT_KEYWORDS="~amd64"' >> /etc/portage/make.conf && \
     echo 'ACCEPT_LICENSE="* -@EULA"' >> /etc/portage/make.conf && \
     echo 'FEATURES="\${FEATURE} noclean nostrip ccache -ipc-sandbox -network-sandbox -pid-sandbox -sandbox"' >> /etc/portage/make.conf && \

It seems the problematic Perl conflict is pulled in by git package.

rui314 commented 2 months ago

Ah, that's indeed a problem. Thank you for pointing that out!

thesamesam commented 2 months ago

Feel free to ping me on stuff like this if needed.

rui314 commented 2 months ago

Thanks. I don't have anything specific to ask right now, but if you notice anything odd in my build script, please let me know.