diff options
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) |