Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 890294 - dev-db/mongodb-5.0.5-r2 fails to build, warning that AVX is required, even when USE=cpu_flags_x86_avx is OFF
Summary: dev-db/mongodb-5.0.5-r2 fails to build, warning that AVX is required, even wh...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ultrabug
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-09 15:30 UTC by Phil Stracchino (Unix Ronin)
Modified: 2023-06-22 06:19 UTC (History)
2 users (show)

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


Attachments
Allow mongodb to be build without AVX support (mongodb-5-no-avx.diff,873 bytes, patch)
2023-01-11 19:46 UTC, Guy Martin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Stracchino (Unix Ronin) 2023-01-09 15:30:23 UTC
>>> Running pre-merge checks for dev-db/mongodb-5.0.5-r2
 * MongoDB 5.0 requires use of the AVX instruction set
 * https://docs.mongodb.com/v5.0/administration/production-notes/
 * ERROR: dev-db/mongodb-5.0.5-r2::gentoo failed (pretend phase):
 *   MongoDB requires AVX


minbar:root:~:6 # equery uses dev-db/mongodb
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for dev-db/mongodb-5.0.5-r2:
 U I
 - - cpu_flags_x86_avx : Adds support for Advanced Vector Extensions instructions
 - - debug             : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
                         https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - kerberos          : Add kerberos support
 - - lto               : Adds support for link time optimization
 - - mongosh           : Install the MongoDB shell from app-admin/mongosh-bin
 + + ssl               : Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security)
 + + tools             : Install the MongoDB tools (mongoimport, mongodump...) from app-admin/mongo-tools


Note that cpu_flags_x86_avx is OFF but build is still failing demanding AVX.


Reproducible: Always



Expected Results:  
With USE=cpu_flags_x86_avx OFF, build should not have tried to use AVX instructions.

minbar:root:~:8 # emerge --info =dev-db/mongodb-5.0.5-r2
Portage 3.0.41 (python 3.10.9-final-0, default/linux/amd64/17.1, gcc-11, glibc-2.36-r5, 6.0.12-gentoo-minbar x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.0.12-gentoo-minbar-x86_64-Intel-R-_Xeon-R-_CPU_E5620_@_2.40GHz-with-glibc2.36
KiB Mem:    24613012 total,   7875060 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 09 Jan 2023 07:00:01 +0000
Head commit of repository gentoo: 47e1d4a2b7dc0882ad35ca22b2fab31113210d3f
Timestamp of repository guru: Sun, 08 Jan 2023 10:32:03 +0000
Head commit of repository guru: 2944b700affd18a84f8ed9a2a35835a0d4fdcea7

Head commit of repository mysql: 3925d2fe5eef1e63602a4f520028aa55dca3df08

Timestamp of repository slonko: Sun, 08 Jan 2023 15:02:04 +0000
Head commit of repository slonko: 7b73922727741fca32c4e928af73216d32cbac24

sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.38 p4) 2.38
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:           3.9.16::gentoo, 3.10.9::gentoo, 3.11.1::gentoo
dev-lang/rust:             1.65.0::gentoo
dev-util/cmake:            3.25.1::gentoo
dev-util/meson:            0.64.1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/openrc:           0.45.2-r2::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo, 2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.3.1_p20221209::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.6-r1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24

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

mysql
    location: /var/db/repos/mysql
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/mysql.git
    masters: gentoo

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

gentoo-dev-alaric
    location: /var/db/repos/alaric
    sync-type: rsync
    sync-uri: rsync://babylon5/dev-alaric
    masters: gentoo
    priority: 60
    sync-rsync-vcs-ignore: true
    sync-rsync-extra-opts:

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -mfpmath=sse"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind /var/lib/unifi"
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 -O2 -pipe -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --verbose-conflicts --keep-going"
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="-O2 -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="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org                 http://www.gtlib.gatech.edu/pub/gentoo                 http://mirrors.cs.wmich.edu/gentoo                 http://distfiles.gentoo.org                 "
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en_US en"
MAKEOPTS="-j16"
PKGDIR="/usr/portage/packages"
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"
SHELL="/bin/bash"
USE="acl aes amd64 bash-completion bzip2 cdda cddb cli crypt dri elogind fltk fortran gdbm iconv id3tag imagemagick ipv6 jpeg2k libglvnd libtirpc mmx mmxext multilib mysql ncurses nls nptl nsplugin openmp opus pam pcre readline seccomp speex split-usr sse sse2 sse4 sse4_1 sse4_2 ssl test-rust theora threads tk tools unicode utils v4l v4l2 vdpau vorbis x264 xattr xpm zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="actions alias auth_basic authn_core authn_alias authn_anon authn_dbm authn_default authn_file authz_core 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 http2 include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_fcgi proxy_html proxy_http proxy_http2 rewrite setenvif socache_shmcb speling status unique_id unixd userdir vhost_alias xml2enc" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes 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" 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" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="mga" 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, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-09 15:32:18 UTC
I think the non-use of REQUIRED_USE was deliberate here to give a more informative message.

MongoDB 5.x doesn't work without AVX on amd64.

What do you want us to do instead?
Comment 2 Phil Stracchino (Unix Ronin) 2023-01-09 15:37:36 UTC
(In reply to Sam James from comment #1)
> I think the non-use of REQUIRED_USE was deliberate here to give a more
> informative message.
> 
> MongoDB 5.x doesn't work without AVX on amd64.
> 
> What do you want us to do instead?

Correct me if I'm wrong:  You're saying that, USE flag notwithstanding, AVX is a non-negotiable hard requirement in MongoDB 5?
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-09 15:40:07 UTC
(In reply to Phil Stracchino (Unix Ronin) from comment #2)
> (In reply to Sam James from comment #1)
> > I think the non-use of REQUIRED_USE was deliberate here to give a more
> > informative message.
> > 
> > MongoDB 5.x doesn't work without AVX on amd64.
> > 
> > What do you want us to do instead?
> 
> Correct me if I'm wrong:  You're saying that, USE flag notwithstanding, AVX
> is a non-negotiable hard requirement in MongoDB 5?

Yes, as unreasonable as that is :(

See https://www.mongodb.com/docs/v5.0/administration/production-notes/#platform-support-notes and bug 809692. I'd missed Piotr's comment on that latter bug, so maybe there's some hope for us to implement a hack.
Comment 4 Phil Stracchino (Unix Ronin) 2023-01-09 16:21:41 UTC
(In reply to Sam James from comment #3)
> (In reply to Phil Stracchino (Unix Ronin) from comment #2)
> > (In reply to Sam James from comment #1)
> > > I think the non-use of REQUIRED_USE was deliberate here to give a more
> > > informative message.
> > > 
> > > MongoDB 5.x doesn't work without AVX on amd64.
> > > 
> > > What do you want us to do instead?
> > 
> > Correct me if I'm wrong:  You're saying that, USE flag notwithstanding, AVX
> > is a non-negotiable hard requirement in MongoDB 5?
> 
> Yes, as unreasonable as that is :(
> 
> See
> https://www.mongodb.com/docs/v5.0/administration/production-notes/#platform-
> support-notes and bug 809692. I'd missed Piotr's comment on that latter bug,
> so maybe there's some hope for us to implement a hack.

In that case my apologies for misunderstanding, this is not a bug against the ebuild, this is "working as upstream intended", however questionable upstream's decision may be.  I for one don't have the option of just arbitrarily replacing two 1U rack servers just to support mongodb 5.

(The only reason I'm using mongodb in the first place is net-wireless/unifi.)
Comment 6 Guy Martin 2023-01-11 19:46:23 UTC
Created attachment 848275 [details, diff]
Allow mongodb to be build without AVX support

AVX in mongodb 5 is required because by default they use -march=sandybridge.
You can disable this by passing --experimental-optimization=-sandybridge to SCons.

This patch to the ebuild does just that. I was able to build mongo and use it on my Celeron J1900.
Comment 7 Phil Stracchino (Unix Ronin) 2023-01-11 20:21:56 UTC
(In reply to Guy Martin from comment #6)
> Created attachment 848275 [details, diff] [details, diff]
> Allow mongodb to be build without AVX support
> 
> AVX in mongodb 5 is required because by default they use -march=sandybridge.
> You can disable this by passing --experimental-optimization=-sandybridge to
> SCons.
> 
> This patch to the ebuild does just that. I was able to build mongo and use
> it on my Celeron J1900.

Nice find sir!
Comment 8 Jaco Kroon 2023-01-28 11:51:55 UTC
> > Yes, as unreasonable as that is :(
> > 
> > See
> > https://www.mongodb.com/docs/v5.0/administration/production-notes/#platform-
> > support-notes and bug 809692. I'd missed Piotr's comment on that latter bug,
> > so maybe there's some hope for us to implement a hack.
> 
> In that case my apologies for misunderstanding, this is not a bug against
> the ebuild, this is "working as upstream intended", however questionable
> upstream's decision may be.  I for one don't have the option of just
> arbitrarily replacing two 1U rack servers just to support mongodb 5.
> 
> (The only reason I'm using mongodb in the first place is net-wireless/unifi.)


+1 ... virtual environment.  Hard-masked >=5.0.0 for the moment.
Comment 9 Ultrabug gentoo-dev 2023-04-17 16:23:06 UTC
I'm gonna add this feature with an added WARNING instead of silently enabling the experimental scons option on the upcoming 5.0.16 ebuild bump
Comment 10 Ultrabug gentoo-dev 2023-04-19 07:26:49 UTC
fixed in 5.0.16