Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 757747 - www-client/chromium-87.0.4280.66 fails to build, sys-devel/clang is not pulled into dependency graph although CHROMIUM_FORCE_CLANG=yes
Summary: www-client/chromium-87.0.4280.66 fails to build, sys-devel/clang is not pulle...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-30 12:11 UTC by Steffen Hau
Modified: 2020-11-30 18:27 UTC (History)
1 user (show)

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


Attachments
emerge chromium (emerge-chromium.log,2.57 KB, text/x-log)
2020-11-30 12:13 UTC, Steffen Hau
Details
chromium build.log (chromium-87.0.4280.66-build.log,27.52 KB, text/x-log)
2020-11-30 12:14 UTC, Steffen Hau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Hau 2020-11-30 12:11:39 UTC
I tried to install chromium on a freshly installed Gentoo ~amd64. Build failed because x86_64-pc-linux-gnu-clang++ is not available.

I have:
/etc/portage/package.env:
www-client/chromium                             cr-clang.conf

/etc/portage/env/cr-clang.conf 
CHROMIUM_FORCE_CLANG=yes
CHROMIUM_FORCE_LIBCXX=no

It looks like variable is not considered when emerge builds the dependency graph, so clang is not pulled in. When the ebuild is executed, the variable is taken into account and therefor build fails because there is no x86_64-pc-linux-gnu-clang++.

I would suggest to add a "clang" use flag like firefox/thunderbird/libreoffice have instead of using an env variable.

Reproducible: Always




Portage 3.0.11 (python 3.8.6-final-0, default/linux/amd64/17.1/systemd, gcc-10.2.0, glibc-2.32-r3, 5.9.1-1-default x86_64)
=================================================================
System uname: Linux-5.9.1-1-default-x86_64-Intel-R-_Core-TM-_i5-10210U_CPU_@_1.60GHz-with-glibc2.2.5
KiB Mem:    32580228 total,   4805936 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 30 Nov 2020 08:35:34 +0000
Head commit of repository gentoo: c803af85ddf1a11d9e253b07fdf5beef0564b692

sh bash 5.0_p18
ld GNU gold (Gentoo 2.35.1 p2 2.35.1) 1.16
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.19.1::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r3::gentoo
Repositories:

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

hauihau
    location: /var/db/repos/hauihau
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe -flto=9 -fuse-linker-plugin"
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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -pipe -flto=9 -fuse-linker-plugin"
DISTDIR="/home/gentoo/distfiles/"
EMERGE_DEFAULT_OPTS="--autounmask=n --keep-going=y --quiet-build=y --quiet-fail=y --with-bdeps=y --changed-deps-report=n"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fakeroot 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"
LDFLAGS="-march=native -O3 -pipe -flto=9 -fuse-linker-plugin -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--gc-sections -Wl,--icf=safe"
LINGUAS="de"
MAKEOPTS="-j9"
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="/home/gentoo/tmp/"
USE="X a52 aac aalib acl alsa amd64 avx avx2 bash-completion berkdb bluetooth bluray branding bzip2 cairo caps cdda cddb cdparanoia cdr cli crypt cups curl cxx dbus dga dri dts dv dvd egl encode exif ffmpeg flac fontconfig fortran ftp gd gdbm gif gmp gstreamer iconv icu imagemagick imlib ipv6 jpeg jpeg2k kde kerberos lame libcaca libglvnd libnotify libsamplerate libtirpc lzma lzo mad matroska mmx mmxext mng mp3 mpeg mtp multilib musepack ncurses networkmanager nls nptl nsplugin ogg openal opengl openmp opus pam pcre pdf png policykit pulseaudio qt5 quicktime readline seccomp sndfile spell split-usr sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 svg syslog systemd tcpd theora threads tiff truetype udev unicode upower usb v4l vaapi vcd vim-syntax vorbis wavpack wayland webkit x264 xattr xcb xcomposite xinerama xml xmp xorg xosd xpm xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel" 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 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de" 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-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="i965 intel iris" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-11-30 12:13:48 UTC
To be clear, this is expected -- we can't dynamically pull in deps based on environment variables, just USE flags.

But yes, *if* an ebuild requires changes to build with Clang, USE=clang is the (unfortunate) convention for now.
Comment 2 Steffen Hau 2020-11-30 12:13:50 UTC
Created attachment 675817 [details]
emerge chromium
Comment 3 Steffen Hau 2020-11-30 12:14:09 UTC
Created attachment 675820 [details]
chromium build.log
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-11-30 12:17:33 UTC
Oh, I see:

if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
       	BDEPEND+=" >=sys-devel/clang-10"
fi

Maybe I'm misunderstanding but this doesn't seem, to me, to be metadata invariant.
Comment 5 Steffen Hau 2020-11-30 12:18:55 UTC
(In reply to Sam James from comment #1)
> To be clear, this is expected -- we can't dynamically pull in deps based on
> environment variables, just USE flags.
> 
> But yes, *if* an ebuild requires changes to build with Clang, USE=clang is
> the (unfortunate) convention for now.

Ok, I didn't know that. I've workaround that by installing firefox first which has a dep on clang. So maybe you can add that clang use flag to the beta or dev channel release and get rid of the env variable approach.
Comment 6 Steffen Hau 2020-11-30 12:20:55 UTC
(In reply to Sam James from comment #4)
> Oh, I see:
> 
> if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
>        	BDEPEND+=" >=sys-devel/clang-10"
> fi
> 
> Maybe I'm misunderstanding but this doesn't seem, to me, to be metadata
> invariant.

Yes, perhaps this is a portage bug. clang is not pulled into the dep graph.

In my opinion, the use flag approach would be much cleaner.
Comment 7 Stephan Hartmann (RETIRED) gentoo-dev 2020-11-30 16:52:30 UTC
(In reply to Steffen Hau from comment #6)
> (In reply to Sam James from comment #4)
> > Oh, I see:
> > 
> > if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
> >        	BDEPEND+=" >=sys-devel/clang-10"
> > fi
> > 
> > Maybe I'm misunderstanding but this doesn't seem, to me, to be metadata
> > invariant.
> 
> Yes, perhaps this is a portage bug. clang is not pulled into the dep graph.
> 
> In my opinion, the use flag approach would be much cleaner.

CHROMIUM_FORCE_CLANG is used only by maintainers to eventually switch to clang if it is not possible to build with GCC anymore. If you want to use clang instead of GCC you need to install clang yourself and set at least CC and CXX accordingly. www-client/firefox is different here, because it requires clang unconditionally.
Comment 8 Steffen Hau 2020-11-30 17:22:34 UTC
(In reply to Stephan Hartmann from comment #7)
> (In reply to Steffen Hau from comment #6)
> > (In reply to Sam James from comment #4)
> > > Oh, I see:
> > > 
> > > if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
> > >        	BDEPEND+=" >=sys-devel/clang-10"
> > > fi
> > > 
> > > Maybe I'm misunderstanding but this doesn't seem, to me, to be metadata
> > > invariant.
> > 
> > Yes, perhaps this is a portage bug. clang is not pulled into the dep graph.
> > 
> > In my opinion, the use flag approach would be much cleaner.
> 
> CHROMIUM_FORCE_CLANG is used only by maintainers to eventually switch to
> clang if it is not possible to build with GCC anymore. If you want to use
> clang instead of GCC you need to install clang yourself and set at least CC
> and CXX accordingly. www-client/firefox is different here, because it
> requires clang unconditionally.

So, then please tell me why
if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
       	BDEPEND+=" >=sys-devel/clang-10"
fi
does not pull clang into the dep graph? I also do not understand why you are not willing to add a clang use flag? libreoffice also does not require clang but the ebuild for the new version has gotten a use flag which does basically the same like your environment variable approach. So, adding a use flag to replace CHROMIUM_FORCE_CLANG shouldn't be a lot work and would be highly appreciated.
Comment 9 Mike Gilbert gentoo-dev 2020-11-30 18:05:49 UTC
(In reply to Steffen Hau from comment #8)
> So, then please tell me why
> if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
>        	BDEPEND+=" >=sys-devel/clang-10"
> fi

The value of BDEPEND is cached in metadata/md5-cache. To get portage to include clang in the dependency graph, you would need to regenerate this cache with CHROMIUM_FORCE_CLANG set to "yes".

Users should not set this variable. It is for ebuild maintainer use only.
Comment 10 Mike Gilbert gentoo-dev 2020-11-30 18:08:16 UTC
> I also do not understand why you are not willing to add a clang use flag?

Should we add a 'clang' USE flag to every package? Where would we draw the line?

In the general case, it makes more sense for people to set CC and CXX in make.conf.
Comment 11 Larry the Git Cow gentoo-dev 2020-11-30 18:27:18 UTC
The bug has been referenced in the following commit(s):

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

commit 869d408b24b574cd1d1596804188eebf45d30bbd
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-11-30 18:26:26 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-11-30 18:26:49 +0000

    www-client/chromium: add a disclaimer regarding CHROMIUM_FORCE_CLANG
    
    Bug: https://bugs.gentoo.org/757747
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 www-client/chromium/chromium-87.0.4280.66.ebuild | 1 +
 www-client/chromium/chromium-88.0.4324.11.ebuild | 1 +
 2 files changed, 2 insertions(+)