diff options
author | Sam Kleinman <samk@10gen.com> | 2016-07-28 15:09:00 -0400 |
---|---|---|
committer | Sam Kleinman <samk@10gen.com> | 2016-08-01 20:10:00 -0400 |
commit | 72bbaf4f5c3ab1c76dd9b67ce83be46c44092a80 (patch) | |
tree | 4c2977ecf120cdbeed215fa8f418ed5b27fb63be /buildscripts/generate_compile_expansions.py | |
parent | 3666300beabc81feda5ce58e733527068c33dc56 (diff) | |
download | mongo-72bbaf4f5c3ab1c76dd9b67ce83be46c44092a80.tar.gz |
SERVER-25171: add scons cache support and enable on relevant non-push variants
Diffstat (limited to 'buildscripts/generate_compile_expansions.py')
-rw-r--r-- | buildscripts/generate_compile_expansions.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/buildscripts/generate_compile_expansions.py b/buildscripts/generate_compile_expansions.py index 016a8c379a2..8e5b4e774b2 100644 --- a/buildscripts/generate_compile_expansions.py +++ b/buildscripts/generate_compile_expansions.py @@ -12,6 +12,8 @@ import fileinput import json import re +import os +import sys # This function matches a version string and captures the "extra" part # If the version is a release like "2.3.4" or "2.3.4-rc0", this will return @@ -57,3 +59,21 @@ else: print "src_suffix: r{0}".format(version_line) print "version: {0}".format(version_line) + +# configuration for scons cache. +# +if sys.platform.startswith("win"): + system_id_path = r"c:\mongodb-build-system-id" + default_cache_path_base = r"z:\data\scons-cache" +else: + system_id_path = "/etc/mongodb-build-system-id" + default_cache_path_base = "/data/scons-cache" + +if os.path.isfile(system_id_path): + with open(system_id_path, "r") as f: + default_cache_path = os.path.join(default_cache_path_base, f.readline()) + + print "scons_cache_path: {0}".format(default_cache_path) + + if os.getenv("USE_SCONS_CACHE") not in (None, False, "false", ""): + print "scons_cache_args: --cache --cache-dir={0}".format(default_cache_path) |