summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2019-02-11 18:01:43 -0500
committerAndrew Morrow <acm@mongodb.com>2019-02-18 13:43:26 -0500
commitd5fcd42d4fdf7432e6cb916e37aed4108b6efcd4 (patch)
tree8727bde260077923a0555bb65d885a5c7a4d74f8
parent62b59e76360beba3854d74a27693ef4c84182c50 (diff)
downloadmongo-d5fcd42d4fdf7432e6cb916e37aed4108b6efcd4.tar.gz
SERVER-33958 Allow thin archives to interact with the cache
(cherry picked from commit 2244659e80a511232cf681b5fb8c90705d4709ea) (cherry picked from commit 9649bddad9cb9649d17becf7b6733b8c318c57a6)
-rw-r--r--SConstruct49
1 files changed, 28 insertions, 21 deletions
diff --git a/SConstruct b/SConstruct
index 48a56dae3ab..188927e702a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1174,27 +1174,6 @@ if has_option("cache"):
env.FatalError("Mixing --cache and --gcov doesn't work correctly yet. See SERVER-11084")
env.CacheDir(str(env.Dir(cacheDir)))
- if get_option("cache") == "nolinked":
- def noCacheEmitter(target, source, env):
- for t in target:
- env.NoCache(t)
- return target, source
-
- def addNoCacheEmitter(builder):
- origEmitter = builder.emitter
- if SCons.Util.is_Dict(origEmitter):
- for k,v in origEmitter:
- origEmitter[k] = SCons.Builder.ListEmitter([v, noCacheEmitter])
- elif SCons.Util.is_List(origEmitter):
- emitter.append(noCacheEmitter)
- else:
- builder.emitter = SCons.Builder.ListEmitter([origEmitter, noCacheEmitter])
-
- addNoCacheEmitter(env['BUILDERS']['Program'])
- addNoCacheEmitter(env['BUILDERS']['StaticLibrary'])
- addNoCacheEmitter(env['BUILDERS']['SharedLibrary'])
- addNoCacheEmitter(env['BUILDERS']['LoadableModule'])
-
# Normalize the link model. If it is auto, then for now both developer and release builds
# use the "static" mode. Somday later, we probably want to make the developer build default
# dynamic, but that will require the hygienic builds project.
@@ -3310,6 +3289,34 @@ try:
except NotImplementedError:
pass
+# Keep this late in the game so that we can investigate attributes set by all the tools that have run.
+if has_option("cache"):
+ if get_option("cache") == "nolinked":
+ def noCacheEmitter(target, source, env):
+ for t in target:
+ try:
+ if getattr(t.attributes, 'thin_archive', False):
+ continue
+ except(AttributeError):
+ pass
+ env.NoCache(t)
+ return target, source
+
+ def addNoCacheEmitter(builder):
+ origEmitter = builder.emitter
+ if SCons.Util.is_Dict(origEmitter):
+ for k,v in origEmitter:
+ origEmitter[k] = SCons.Builder.ListEmitter([v, noCacheEmitter])
+ elif SCons.Util.is_List(origEmitter):
+ origEmitter.append(noCacheEmitter)
+ else:
+ builder.emitter = SCons.Builder.ListEmitter([origEmitter, noCacheEmitter])
+
+ addNoCacheEmitter(env['BUILDERS']['Program'])
+ addNoCacheEmitter(env['BUILDERS']['StaticLibrary'])
+ addNoCacheEmitter(env['BUILDERS']['SharedLibrary'])
+ addNoCacheEmitter(env['BUILDERS']['LoadableModule'])
+
env.SConscript(
dirs=[
'src',