Trying to emerge mongodb 2.0.7 (and 2.0.6, by the way) fails with an error about the C++ compiler not working: scons -j3 --cxx=x86_64-apple-darwin11-g++ --use-system-all --sharedclient --usev8 all scons: Reading SConscript files ... scons version: 2.2.0 python version: 2 7 3 'final' 0 using system version of: pcre using system version of: sm using system version of: snappy Checking whether the C++ compiler worksno c++ compiler not installed! It seems like this is really a problem with scons not having the correct environment. I made the following change to the ebuild file (a terrible hack, I know): --- portage/dev-db/mongodb/mongodb-2.0.7.ebuild 2012-08-20 01:46:47.000000000 -0700 +++ local/portage/dev-db/mongodb/mongodb-2.0.7.ebuild 2012-08-29 18:04:05.000000000 -0700 @@ -36,7 +36,7 @@ enewgroup mongodb enewuser mongodb -1 -1 /var/lib/${PN} mongodb - scons_opts=" --cxx=$(tc-getCXX) --use-system-all --sharedclient" + scons_opts=" --cxx=/Library/Gentoo/usr/bin/$(tc-getCXX) --use-system-all --sharedclient" if use v8; then scons_opts+=" --usev8" else When I provide the absolute path to the C++ compiler then compilation works, but the linking steps at the end fail. Reproducible: Always Steps to Reproduce: 1. Unmask mongodb and its dependencies on OS X. 2. Set the v8 use flag. 3. Emerge mongo. Here's the linking failure: /Library/Gentoo/usr/bin/x86_64-apple-darwin11-g++ -o mongodump -Wl,-dead_strip_dylibs -fPIC -pthread -rdynamic pch.o buildinfo.o db/indexkey.o db/jsobj.o bson/oid.o db/json.o db/lasterror.o db/nonce.o db/queryutil.o db/querypattern.o db/projection.o shell/mongo.o util/background.o util/util.o util/file_allocator.o util/assert_util.o util/log.o util/ramlog.o util/md5main.o util/base64.o util/concurrency/vars.o util/concurrency/task.o util/debug_util.o util/concurrency/thread_pool.o util/password.o util/version.o util/signal_handlers.o util/histogram.o util/concurrency/spin_lock.o util/text.o util/stringutils.o util/concurrency/synchronization.o util/net/sock.o util/net/httpclient.o util/net/message.o util/net/message_port.o util/net/listen.o util/md5.o client/connpool.o client/dbclient.o client/dbclient_rs.o client/dbclientcursor.o client/model.o client/syncclusterconnection.o client/distlock.o s/shardconnection.o db/commands.o util/net/message_server_port.o client/parallel.o db/common.o util/net/miniwebserver.o db/dbwebserver.o db/matcher.o db/dbcommands_generic.o db/dbmessage.o db/security_common.o db/security_commands.o util/mmap.o util/mmap_posix.o util/processinfo.o util/processinfo_darwin.o db/stats/counters.o db/stats/service_stats.o db/stats/snapshots.o db/stats/top.o scripting/engine.o scripting/utils.o scripting/bench.o scripting/engine_v8.o scripting/v8_db.o scripting/v8_utils.o scripting/v8_wrapper.o util/compress.o db/key.o db/btreebuilder.o util/logfile.o util/alignedbuilder.o db/mongommf.o db/dur.o db/durop.o db/dur_writetodatafiles.o db/dur_preplogbuffer.o db/dur_commitjob.o db/dur_recover.o db/dur_journal.o db/introspect.o db/btree.o db/clientcursor.o db/tests.o db/repl.o db/repl/rs.o db/repl/consensus.o db/repl/rs_initiate.o db/repl/replset_commands.o db/repl/manager.o db/repl/health.o db/repl/heartbeat.o db/repl/rs_config.o db/repl/rs_rollback.o db/repl/rs_sync.o db/repl/rs_initialsync.o db/oplog.o db/repl_block.o db/btreecursor.o db/cloner.o db/namespace.o db/cap.o db/matcher_covered.o db/dbeval.o db/restapi.o db/dbhelpers.o db/instance.o db/client.o db/database.o db/pdfile.o db/record.o db/cursor.o db/security.o db/queryoptimizer.o db/queryoptimizercursor.o db/extsort.o db/cmdline.o db/index.o db/scanandorder.o db/geo/2d.o db/geo/haystack.o db/ops/delete.o db/ops/query.o db/ops/update.o db/dbcommands.o db/dbcommands_admin.o db/commands/distinct.o db/commands/find_and_modify.o db/commands/group.o db/commands/isself.o db/commands/mr.o db/driverHelpers.o s/config.o s/grid.o s/chunk.o s/shard.o s/shardkey.o s/d_logic.o s/d_writeback.o s/d_migrate.o s/d_state.o s/d_split.o client/distlock_test.o s/d_chunk_manager.o db/module.o db/modules/mms.o client/gridfs.o tools/tool.o tools/dump.o -L/Library/Gentoo/var/tmp/portage/dev-db/mongodb-2.0.7/work/v8 -lpcrecpp -lsnappy -lstdc++ -lboost_system-mt -lboost_thread-mt -lboost_filesystem-mt -lboost_program_options-mt -lv8 ld: warning: directory not found for option '-L/Library/Gentoo/var/tmp/portage/dev-db/mongodb-2.0.7/work/v8' Undefined symbols for architecture x86_64: "_pcre_config", referenced from: mongo::RXTest::run() in matcher.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status scons: *** [mongodump] Error 1 scons: building terminated because of errors. * ERROR: dev-db/mongodb-2.0.7 failed (compile phase): * escons failed. * * Call stack: * ebuild.sh, line 85: Called call-ebuildshell 'src_compile' * environment, line 346: Called src_compile * environment, line 2359: Called escons '--cxx=/Library/Gentoo/usr/bin/x86_64-apple-darwin11-g++' '--use-system-all' '--sharedclient' '--usev8' 'all' * environment, line 1036: Called die * The specific snippet of code: * [[ ${ret} -ne 0 && ${EAPI} == 4 ]] && die "escons failed."; emerge --info: Portage 2.2.01.20894-prefix (prefix/darwin/macos/10.7/x64, gcc-4.2.1, unavailable, 11.4.0 x86_64) ================================================================= System Settings ================================================================= System uname: Darwin-11.4.0-x86_64-i386-64bit Timestamp of tree: Wed, 29 Aug 2012 23:27:18 +0000 app-shells/bash: 4.2_p10::gentoo_prefix dev-lang/python: 2.7.3-r2::gentoo_prefix dev-util/pkgconfig: 0.27.1::gentoo_prefix sys-devel/autoconf: 2.69::gentoo_prefix sys-devel/automake: 1.11.5::gentoo_prefix, 1.12.2::gentoo_prefix sys-devel/gcc-config: 1.5-r2::gentoo_prefix sys-devel/libtool: 2.4.2::gentoo_prefix sys-devel/make: 3.82::gentoo_prefix Repositories: gentoo_prefix jgibson_custom ACCEPT_KEYWORDS="~x64-macos" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-apple-darwin11" CFLAGS="-O2 -pipe -march=core2" CHOST="x86_64-apple-darwin11" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/portage /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-O2 -pipe -march=core2" DISTDIR="/Library/Gentoo/usr/portage/distfiles" FCFLAGS="" FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix news nostrip parallel-fetch parse-eapi-ebuild-head preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-dead_strip_dylibs" MAKEOPTS="-j3" PKGDIR="/Library/Gentoo/usr/portage/packages" PORTAGE_CONFIGROOT="/Library/Gentoo/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/Library/Gentoo/var/tmp" PORTDIR="/Library/Gentoo/usr/portage" PORTDIR_OVERLAY="/Library/Gentoo/usr/local/portage" SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix" USE="aqua bzip2 coreaudio cracklib cvs cxx git mmx mmxext modules ncurses nls objc objc++ prefix readline sse sse2 ssl subversion unicode x64-macos zlib" APACHE2_MODULES="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="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
I think this is a PATH issue
same problem on Linux
Bug in scons ebuild. Fixed that now. Will have to re-emerge scons. Reducing to Mac OS X problem for MongoDB.
Hey John, could please try the patch in bug 482178 to see if it solves this?
I finally got a chance to test this out and the SCons fix works. I was able to emerge mongo-2.4.6 with scons-2.2.0. However, mongodb still doesn't emerge out of the box on prefix OSX because libunwind refuses to emerge (which is a transitive dependency the google-perftools dependency). I had to update the mongodb ebuild to exclude the google-perftools dependency and remove the --use-system-tcmalloc argument to SCons to get the build to work. Should I file that as a new bug?
I'm sorry but this needs to be revisited.