Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 726034

Summary: Decide on the policy around use of unprefixed tools as part of build systems
Product: Quality Assurance Reporter: Kent Fredric (IRC: kent\n) (RETIRED) <kentnl>
Component: PoliciesAssignee: Gentoo Quality Assurance Team <qa>
Status: CONFIRMED ---    
Severity: normal CC: bertrand, flow, lssndrbarbieri, mgorny, sam, slyfox, zlogene
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=730714
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 243502    
Attachments: build.log.gz

Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-29 07:29:59 UTC
Created attachment 642462 [details]
build.log.gz

Context:

> checking whether byte ordering is bigendian... (cached) no
> checking whether float word ordering is bigendian... /var/tmp/portage/app-text/texlive-core-2020-r4/work/texlive-20200406-source/libs/cairo/configure: line 5643: strings: command not found
> /var/tmp/portage/app-text/texlive-core-2020-r4/work/texlive-20200406-source/libs/cairo/configure: line 5646: strings: command not found
> unknown
> configure: error: 
> 
> Unknown float word ordering. You need to manually preset
> ax_cv_c_float_words_bigendian=no (or yes) according to your system.
> 
>     
> === configuring in cairo failed

Header:
> * Package:    app-text/texlive-core-2020-r4
> * Repository: gentoo
> * Maintainer: aballier@gentoo.org tex@gentoo.org
> * USE:        X abi_x86_64 amd64 elibc_glibc kernel_linux luajittex userland_GNU xetex
> * FEATURES:   ccache compressdebug network-sandbox preserve-libs sandbox splitdebug userpriv usersandbox


Einfo:
> Portage 2.3.100 (python 3.7.7-final-0, default/linux/amd64/17.1, gcc-10.1.0, glibc-2.31-r3, 5.2.7-gentoo x86_64)
> =================================================================
>                          System Settings
> =================================================================
> System uname: Linux-5.2.7-gentoo-x86_64-Intel-R-_Core-TM-_i5-2410M_CPU_@_2.30GHz-with-gentoo-2.7
> KiB Mem:     8004420 total,    487372 free
> KiB Swap:   20478972 total,  17685416 free
> Timestamp of repository gentoo: Thu, 28 May 2020 14:00:01 +0000
> Head commit of repository gentoo: 9910794041d599960bc3e8651516acaf74a87299
> Timestamp of repository rust: Thu, 28 May 2020 12:05:25 +0000
> Head commit of repository rust: e090b99dcc5cb37ae57efa0c985f95074dc5e815
> 
> Head commit of repository rust-dev: b59d4991426194f9408f37df2c868fedde680bdf
> 
> sh bash 5.0_p17
> ld GNU ld (Gentoo 2.34 p4) 2.34.0
> ccache version 3.7.9 [enabled]
> app-shells/bash:          5.0_p17::gentoo
> dev-java/java-config:     2.2.0-r4::gentoo
> dev-lang/perl:            5.30.2-r2::local-portage
> dev-lang/python:          2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.3::gentoo, 3.9.0_beta1::gentoo
> dev-util/ccache:          3.7.9::gentoo
> dev-util/cmake:           3.17.2::gentoo
> dev-util/pkgconfig:       0.29.2::gentoo
> sys-apps/baselayout:      2.7::gentoo
> sys-apps/openrc:          0.42.1::gentoo
> sys-apps/sandbox:         2.18::gentoo
> sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
> sys-devel/automake:       1.16.2::gentoo
> sys-devel/binutils:       2.34-r1::gentoo
> sys-devel/gcc:            8.3.0-r3::gentoo, 9.2.0-r4::gentoo, 9.3.0::gentoo, 10.1.0::gentoo
> sys-devel/gcc-config:     9999::gentoo
> sys-devel/libtool:        2.4.6-r6::gentoo
> sys-devel/make:           4.3::gentoo
> sys-kernel/linux-headers: 5.6::gentoo (virtual/os-headers)
> sys-libs/glibc:           2.31-r3::gentoo
> 
> ACCEPT_KEYWORDS="amd64 ~amd64"
> ACCEPT_LICENSE="@FREE"
> CBUILD="x86_64-pc-linux-gnu"
> CC="x86_64-pc-linux-gnu-gcc"
> CFLAGS="-O2 -pipe -mtune=native -march=native"
> CHOST="x86_64-pc-linux-gnu"
> CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
> CXXFLAGS="-O2 -pipe -mtune=native -march=native"
> DISTDIR="/var/cache/distfiles"
> EMERGE_DEFAULT_OPTS="--alert y --changed-deps y --changed-use --complete-graph=n --with-bdeps=n --deep --dynamic-deps n --keep-going y --newuse --verbose-conflicts --unordered-display --autounmask n --backtrack=0 --autounmask-write n"
> ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
> FCFLAGS="-O2 -pipe"
> FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache cgroup clean-logs compress-build-logs compressdebug config-protect-if-modified distlocks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign split-elog split-log splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
> FFLAGS="-O2 -pipe"
> GENTOO_MIRRORS="http://distfiles.gentoo.org"
> INSTALL_MASK="/usr/lib/debug/.build-id/"
> LANG="en_NZ.UTF8"
> LDFLAGS="-Wl,-O1 -Wl,--as-needed"
> MAKEOPTS=" -j3 --load-average=4"
> PKGDIR="/var/cache/binpkgs"
> PORTAGE_CONFIGROOT="/"
> PORTAGE_RSYNC_EXTRA_OPTS="--no-i-r --delete-delay --fuzzy --temp-dir=/var/tmp/rsync/"
> 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"
> USE="X acl amd64 avx berkdb bzip2 cli crypt dbus dri elogind fortran gdbm iconv ipv6 jpeg jpeg2k libtirpc mmx multilib ncurses netlink2 nls nptl opengl openmp pam pcre png qml qt4 readline seccomp split-usr sse sse2 sse4_1 sse4_2 ssl ssse3 tcpd tiff unicode vim-syntax xattr xinerama zlib" ABI_X86="32 64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF NVPTX" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_9" RUBY_TARGETS="ruby25 ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
> Unset:  CPPFLAGS, CTARGET, CXX, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
> 
> =================================================================
>                         Package Settings
> =================================================================
> 
> app-text/texlive-core-2020-r4::gentoo was built with the following:
> USE="X luajittex xetex -cjk -doc -source -tk" ABI_X86="(64)"
Comment 1 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-05-29 11:01:21 UTC
Be careful, you have only one leg left as one is gone now.
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-30 09:07:32 UTC
(In reply to Mikle Kolyada from comment #1)
> Be careful, you have only one leg left as one is gone now.

Can you reply in a way that makes sense to humans?
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-30 10:39:04 UTC
> /var/tmp/portage/app-text/texlive-core-2020-r4/work/texlive-20200406-source/libs/cairo/configure: line 5646: strings: command not found

It's 2 bugs:
- texlive bundles cairo and tries to use it instead of relying on gentoo's cairo
- cairo uses unqualified 'strings' tool from binutils to detect it: https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/build/aclocal.float.m4#L34

Fun fact: autoconf-archive's macro uses grep: to inspect binary. https://github.com/autoconf-archive/autoconf-archive/blob/master/m4/ax_c_float_words_bigendian.m4#L52
Comment 4 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-05-30 10:44:41 UTC
(In reply to Sergei Trofimovich from comment #3)
> > /var/tmp/portage/app-text/texlive-core-2020-r4/work/texlive-20200406-source/libs/cairo/configure: line 5646: strings: command not found
> 
> It's 2 bugs:
> - texlive bundles cairo and tries to use it instead of relying on gentoo's
> cairo

Actually it does not, there is the --with-system-cairo switch, with that you will not be able to compile tl-core without system cairo being installed.
Comment 5 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-05-30 10:46:34 UTC
(In reply to Kent Fredric (IRC: kent\n) from comment #2)
> (In reply to Mikle Kolyada from comment #1)
> > Be careful, you have only one leg left as one is gone now.
> 
> Can you reply in a way that makes sense to humans?

this is not a texlive bug at first, at second I would not care if people remove legetimely present symlinks.
Comment 6 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-05-30 10:55:00 UTC
Actually let's defer the bug to cairo maintainers. Not my area of responsibility to decide how to act on cair itself.
Comment 7 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-05-30 11:07:56 UTC

*** This bug has been marked as a duplicate of bug 726200 ***
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-30 11:26:40 UTC
(In reply to Mikle Kolyada from comment #5)
> (In reply to Kent Fredric (IRC: kent\n) from comment #2)
> > (In reply to Mikle Kolyada from comment #1)
> > > Be careful, you have only one leg left as one is gone now.
> > 
> > Can you reply in a way that makes sense to humans?
> 
> this is not a texlive bug at first, at second I would not care if people
> remove legetimely present symlinks.

Then it's time for QA (CCed) to formally decide what bug #243502 is about (and what is legitimate). Going back and forth does not help anyone. The questions to clarify are:

1. Whether gentoo gives user ability to override active C compiler via CC/CXX/AR/LD/READELF/etc. or not.
2. Whether gentoo always expects cpp/cc/gcc/ar/readelf/strings to be used when user does not override CC/CXX and friends.
3. Or default tools must always be prefixed ${CHOST}-cpp/${CHOST}-gcc.
4. Or default can be a mix and mix is guaranteed to work (with all the implications of silent breakages when cross-compiling).

Current gentoo state is such that autoconf & friends never use unprefixed cpp/cc/gcc tools as gentoo always passes --build= and --host parameters as part of econf. Unless someone makes a mistake or hardcodes unprefixed tool use instead of using AC_CHECK_TOOL.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-05-30 11:32:58 UTC
My opinion below.

> 1. Whether gentoo gives user ability to override active C compiler via
> CC/CXX/AR/LD/READELF/etc. or not.

Yes, we want that to work.  Not sure about LD as it's kinda special (I recall some build systems being broken when LD was specified because it overrode using CC/CXX to link).

> 2. Whether gentoo always expects cpp/cc/gcc/ar/readelf/strings to be used
> when user does not override CC/CXX and friends.

No for the first three.  For the remaining, no strong opinion.

> 3. Or default tools must always be prefixed ${CHOST}-cpp/${CHOST}-gcc.
> 4. Or default can be a mix and mix is guaranteed to work (with all the
> implications of silent breakages when cross-compiling).

No, the mix can break stuff.

Long story short, we should use prefix tools as part of *toolchain* but we should permit unprefixed in other contexts.  My repeated example is using ar to unpack ar archives as part of .deb processing.
Comment 10 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-06-12 12:12:07 UTC
The entire situation in the current reality is a wild goose chase.
We should respect AR/CC/GCC/CPP, until there is a very special case where a maintainer is sure direct calls will not break the package badly. I have no strong opinion about pther toolchain like STRINGS or NM.

We should not turn this into a silly chase like  "respect everything || die" 

I do agree that [-native-symlynks] is useful for debugging, but please nit turning it into a mandatory item.
Comment 11 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-06-12 12:47:00 UTC
(In reply to Mikle Kolyada from comment #10)
> The entire situation in the current reality is a wild goose chase.

In reality: 

90% of packages already work *just fine* with nuked symlinks.

And of the 10% that fail, at least 90% of those are trivial fixes, which do the right thing.

So .... maybe investigate the change before writing it off as a red herring.
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-12 17:50:41 UTC
(In reply to Mikle Kolyada from comment #10)
> We should respect AR/CC/GCC/CPP until there is a very special case where a maintainer is sure direct calls will not break the package badly.

I don't agree with the premise. I think it's worth stating real goal of 'tc-directly'. My view of 'tc-directly' is:

AR/CC/CPP overrides are provided not just to fix/workaround build failures. But allow user to swap the tool's implementation (for whatever reason: testing the implementation, working things around, going wild).

The point of available override is (if you like) to allow user to break package badly with a single variable change (and not discover the breakage after 'gcc-config' run, or manual symlink twiddling). Especially if substitution is trivial to achieve.

Thus it's not ok to call "/lib/cpp" or "cpp" directly just because it happens to work. But it might be ok to leave if it's not practical to override.

For packages like 'wine' where it's really hard to achieve 'as' tool substitution without upstream patching.

Perhaps gathering more specific cases of "too hard/to brittle" would help here.
Comment 13 Larry the Git Cow gentoo-dev 2021-08-14 01:43:06 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=d0bced7586bcab1a00a8db11baae895bd4f0a646

commit d0bced7586bcab1a00a8db11baae895bd4f0a646
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-08-01 02:28:43 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-08-14 01:42:58 +0000

    ebuild-writing/functions/src_compile/building: don't call CC directly
    
    Bug: https://bugs.gentoo.org/243502
    Bug: https://bugs.gentoo.org/726034
    Signed-off-by: Sam James <sam@gentoo.org>
    Closes: https://github.com/gentoo/devmanual/pull/243
    Signed-off-by: Sam James <sam@gentoo.org>

 ebuild-writing/functions/src_compile/building/text.xml | 9 +++++++++
 1 file changed, 9 insertions(+)