0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

SERVER-11290 Don't actually build static libraries

We don't currently use the static libraries, they are just nodes in our
dependency graph. Since they are unused, building them wastes time and disk
IO.

We still need to generate the files to appease scons. They are filled with a
UUID on the assumption that if scons thinks that a library needs to be rebuilt
then anything that depends on the library should also be rebuilt.
This commit is contained in:
Mathias Stearn 2014-07-11 13:58:13 -04:00
parent 3982b2f3ac
commit df27bbcf24

View File

@ -26,6 +26,7 @@ import textwrap
import types
import urllib
import urllib2
import uuid
from buildscripts import utils
from buildscripts import moduleconfig
@ -485,8 +486,6 @@ if optBuild:
if has_option("propagate-shell-environment"):
env['ENV'] = dict(os.environ);
env['_LIBDEPS'] = '$_LIBDEPS_OBJS'
# Ignore requests to build fast and loose for release builds.
if get_option('build-fast-and-loose') == "on" and not has_option('release'):
# See http://www.scons.org/wiki/GoFastButton for details
@ -502,6 +501,24 @@ if has_option('mute'):
env.Append( SHLINKCOMSTR = env["LINKCOMSTR"] )
env.Append( ARCOMSTR = "Generating library $TARGET" )
env['_LIBDEPS'] = '$_LIBDEPS_OBJS'
if env['_LIBDEPS'] == '$_LIBDEPS_OBJS':
# The libraries we build in LIBDEPS_OBJS mode are just placeholders for tracking dependencies.
# This avoids wasting time and disk IO on them.
def write_uuid_to_file(env, target, source):
with open(env.File(target[0]).abspath, 'w') as fake_lib:
fake_lib.write(str(uuid.uuid4()))
fake_lib.write('\n')
def noop_action(env, target, source):
pass
env['ARCOM'] = write_uuid_to_file
env['ARCOMSTR'] = 'Generating placeholder library $TARGET'
env['RANLIBCOM'] = noop_action
env['RANLIBCOMSTR'] = 'Skipping ranlib for $TARGET'
libdeps.setup_environment( env )
if env['PYSYSPLATFORM'] == 'linux3':