[SERVER-9486] "scons all" build fails when mongdb is a git submodule Created: 26/Apr/13  Updated: 11/Jul/16  Resolved: 11/Jun/13

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.4.3
Fix Version/s: 2.5.1

Type: Bug Priority: Major - P3
Reporter: Steve Sperandeo Assignee: Matt Kangas
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux ubuntu 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux


Attachments: File mongo-git-fixes.diff    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

In a pre-existing git repo, add the official repository as a submodule:

git submodule add git://github.com/mongodb/mongo.git apps/mongo
cd apps/mongo
scons all

Participants:

 Description   

g++ -o build/linux2/normal/mongo/pch.o -c -Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -fno-builtin-memcmp -O3 -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -Ibuild/linux2/normal/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/linux2/normal/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/normal/third_party/boost -Isrc/third_party/boost -Ibuild/linux2/normal/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/linux2/normal -Isrc -Ibuild/linux2/normal/mongo -Isrc/mongo -Ibuild/linux2/normal/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/normal/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/normal/third_party/v8/include -Isrc/third_party/v8/include src/mongo/pch.cpp
generate_buildinfo(["build/buildinfo.cpp"], ['\n#include <string>\n#include <boost/version.hpp>\n\n#include "mongo/util/version.h"\n\nnamespace mongo {\n const char * gitVersion()

{ return "%(git_version)s"; }

\n const char * compiledJSEngine()

{ return "%(js_engine)s"; }

\n const char * allocator()

{ return "%(allocator)s"; }

\n const char * loaderFlags()

{ return "%(loader_flags)s"; }

\n const char * compilerFlags()

{ return "%(compiler_flags)s"; }

\n std::string sysInfo()

{ return "%(sys_info)s BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; }

\n} // namespace mongo\n'])
scons: *** [build/buildinfo.cpp] .git/HEAD: Not a directory
scons: building terminated because of errors.



 Comments   
Comment by Andrew Stormont [ 16/Dec/15 ]

Here is a better fix that uses the git commands to get the info instead of trying to read and parse it directly from the git dir.

Comment by auto [ 11/Jun/13 ]

Author:

{u'username': u'gjmurakami-10gen', u'name': u'Gary Murakami', u'email': u'gary.murakami@10gen.com'}

Message: SERVER-9486 git submodule scons build issue fix

If you add mongo to a parent project via "git submodule add", you need these fixes to build mongo.

Signed-off-by: Matt Kangas <matt.kangas@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/42255e2d5a9fa8eff2426d78be3e292f45a39cbc

Comment by Steve Sperandeo [ 26/Apr/13 ]

I forgot to mention the distro:

Ubuntu Server 12.04 LTS 32bit

Generated at Thu Feb 08 03:20:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.