trofi / nix-guix-gentoo

Gentoo overlay for nix and guix functional package managers.
100 stars 9 forks source link

mdbook-linkcheck build error #29

Closed Gooberpatrol66 closed 1 year ago

Gooberpatrol66 commented 1 year ago
emerge --info '=app-text/mdbook-linkcheck-0.7.7::nix-guix'
!!! Repository 'mv' is missing masters attribute in '/var/lib/layman/mv/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
WARNING: One or more repositories have missing repo_name entries:

        /var/lib/layman/mv/profiles/repo_name
        /var/lib/layman/arcan-overlay/profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.

Portage 3.0.43 (python 3.10.9-final-0, default/linux/amd64/17.1/desktop/plasma/systemd/merged-usr, gcc-12, glibc-2.36-r5, 5.15.80-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.15.80-gentoo-x86_64-x86_64-AMD_Ryzen_5_3600_6-Core_Processor-with-glibc2.36
KiB Mem:    32778668 total,  11453224 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 07 Feb 2023 22:02:07 +0000
Head commit of repository gentoo: 34639864374c742b17d8ca4d33c2a4ce0a1ea450

sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p5) 2.39.0
ccache version 4.7.4 [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           2.7.18_p16-r1::gentoo, 3.9.16-r1::gentoo, 3.10.9-r1::gentoo, 3.11.1-r1::gentoo
dev-lang/rust:             1.66.1::gentoo
dev-util/ccache:           4.7.4::gentoo
dev-util/cmake:            3.25.2::gentoo
dev-util/meson:            0.64.1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          252.4-r1::gentoo
sys-devel/autoconf:        2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           15.0.7-r1::gentoo
sys-devel/gcc:             12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo
sys-devel/llvm:            15.0.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: True

arcan-overlay
    location: /var/lib/layman/arcan-overlay
    sync-type: laymansync
    sync-uri: https://github.com/vquicksilver/arcan-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

audio-overlay
    location: /var/lib/layman/audio-overlay
    sync-type: laymansync
    sync-uri: https://github.com/gentoo-audio/audio-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

darthgandalf-overlay
    location: /var/lib/layman/darthgandalf-overlay
    sync-type: laymansync
    sync-uri: https://github.com/DarthGandalf/gentoo-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

deadbeef-overlay
    location: /var/lib/layman/deadbeef-overlay
    sync-type: laymansync
    sync-uri: https://github.com/damex/deadbeef-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

dev1990-overlay
    location: /var/lib/layman/dev1990-overlay
    sync-type: laymansync
    sync-uri: https://github.com/dev-0x7C6/dev1990-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

dmchurch
    location: /var/lib/layman/dmchurch
    sync-type: laymansync
    sync-uri: https://github.com/dmchurch/portage-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

dotnet
    location: /var/lib/layman/dotnet
    sync-type: laymansync
    sync-uri: https://github.com/gentoo/dotnet.git
    masters: gentoo
    priority: 50
    volatile: True

gooby-overlay
    location: /var/lib/layman/gooby-overlay
    sync-type: laymansync
    sync-uri: https://gentooserver.dehnel.info/gitea/nathan/gooby-overlay.git
    masters: gentoo dotnet
    priority: 50
    volatile: True

guru
    location: /var/lib/layman/guru
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru.git
    masters: gentoo
    priority: 50
    volatile: True

interactive-fiction
    location: /var/lib/layman/interactive-fiction
    sync-type: laymansync
    sync-uri: git://repo.or.cz/gentoo-interactive-fiction.git
    masters: gentoo
    priority: 50
    volatile: True

lmiphay
    location: /var/lib/layman/lmiphay
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/user/lmiphay.git
    masters: gentoo
    priority: 50
    volatile: True

lto-overlay
    location: /var/lib/layman/lto-overlay
    sync-type: laymansync
    sync-uri: https://github.com/InBetweenNames/gentooLTO.git
    masters: gentoo mv
    priority: 50
    volatile: True

mv
    location: /var/lib/layman/mv
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/user/mv.git
    masters: gentoo
    priority: 50
    volatile: True

nix-guix
    location: /var/lib/layman/nix-guix
    sync-type: laymansync
    sync-uri: https://github.com/trofi/nix-guix-gentoo.git
    masters: gentoo
    priority: 50
    volatile: True

reagentoo
    location: /var/lib/layman/reagentoo
    sync-type: laymansync
    sync-uri: https://gitlab.com/reagentoo/gentoo-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

src_prepare-overlay
    location: /var/lib/layman/src_prepare-overlay
    sync-type: laymansync
    sync-uri: https://gitlab.com/src_prepare/src_prepare-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

torbrowser
    location: /var/lib/layman/torbrowser
    sync-type: laymansync
    sync-uri: https://github.com/MeisterP/torbrowser-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

unity-gentoo
    location: /var/lib/layman/unity-gentoo
    sync-type: laymansync
    sync-uri: https://github.com/shiznix/unity-gentoo.git
    masters: gentoo
    priority: 50
    volatile: True

vapoursynth
    location: /var/lib/layman/vapoursynth
    sync-type: laymansync
    sync-uri: https://github.com/4re/vapoursynth-portage.git
    masters: gentoo
    priority: 50
    volatile: True

viperML-overlay
    location: /var/lib/layman/viperML-overlay
    sync-type: laymansync
    sync-uri: https://github.com/viperML/viperML-overlay.git
    masters: gentoo
    priority: 50
    volatile: True

voyageur
    location: /var/lib/layman/voyageur
    sync-type: laymansync
    sync-uri: https://cafarelli.fr/git/voyageur-overlay/
    masters: gentoo
    priority: 50
    volatile: True

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 12 --autounmask"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LEX="flex"
MAKEOPTS="-j12"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="-C opt-level=3 -C target-cpu=native -C codegen-units=1"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 bluetooth bluray branding bzip2 cairo caps cdda cdr cet cli crypt cups dbus declarative dri dts dvd dvdr encode eselect-ldso exif flac fortran gdbm gif gpm gtk gui hardened hwaccel iconv icu infinality ipv6 jack jit jpeg kde kwallet lcms libglvnd libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib ncurses nfs nls nptl ogg opencl opengl openmp orc pam pango pcre pdf pgo pie plasma png policykit ppds qml qt5 readline realtime sdl seccomp semantic-desktop sound spell ssl ssp startup-notification svg systemd test-rust threads tiff truetype udev udisks unicode upower usb vaapi vdpau verify-sig vorbis vulkan widgets wxwidgets x264 xattr xcb xft xml xtpax xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" CURL_SSL="gnutls" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput wacom evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LANG, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

build.log

trofi commented 1 year ago

note: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-text/mdbook-linkcheck-0.7.7/work/mdbook-linkcheck-0.7.7/target/release/deps/libopenssl_sys-41acaa7dec2f671 e.rlib(x86_64cpuid.o):(.init+0x1): undefined reference to `OPENSSL_cpuid_setup'

This looks like an underlinking of openssl in openssl-sys crate bundled with linkchecker. I'll try to reproduce locally with your *FLAGS.

trofi commented 1 year ago

Reproduces with -flto flags:CFLAGS="-flto" CXXFLAGS="-flto" emerge -v1 app-text/mdbook-linkcheck.

I think it happens because we mix the code from multiple toolchains: gcc when it comes to compiling c/c++ files, gcc linker plugin (not sure) when it comes to linking files and llvm when it comes to compiling rust files.

It could even work if rust were to only generate object code for ld. It might even be the case, but I'm not sure. I'll debug in more detail and reduce to something shorter.

Meanwhile we can filter out any LTO-related flags to make things just work for mixed environments.

trofi commented 1 year ago

Try https://github.com/trofi/nix-guix-gentoo/commit/c95caa8da8dbeb38eb5fc58bd1529ceb73d04d9d. I wonder if it will be enough for your environment.

trofi commented 1 year ago

Filed https://bugs.gentoo.org/893658 against ::gentoo. Looks like fllter-lto workarounds against rust packages are proliferating for a while there.

trofi commented 1 year ago

The workaround should be good enough to use app-text/mdbook-linkcheck with -flto.

Gooberpatrol66 commented 1 year ago

That fixed it, thanks.