Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-3331: Changes to the client SConstruct to improve windows buil…

…ding.
  • Loading branch information...
commit b099fd4ba8c01742ae367979531e6774f0ff19c7 1 parent 19d5b5b
@andy10gen andy10gen authored
Showing with 23 additions and 6 deletions.
  1. +21 −5 buildscripts/build_and_test_client.py
  2. +2 −1  distsrc/client/SConstruct
View
26 buildscripts/build_and_test_client.py
@@ -19,6 +19,7 @@
import sys
import tempfile
import tarfile
+import zipfile
import utils
@@ -27,21 +28,36 @@ def main(args):
scons_args = args[2:]
build_and_test(archive_file, scons_args)
-def build_and_test(archive, scons_args):
+def build_and_test(archive_name, scons_args):
work_dir = tempfile.mkdtemp()
try:
+ archive = open_archive(archive_name)
extracted_root = extract_archive(work_dir, archive)
run_scons(extracted_root, scons_args)
smoke_client(extracted_root)
finally:
shutil.rmtree(work_dir)
-def extract_archive(work_dir, archive):
- tf = tarfile.open(archive, 'r')
- tf.extractall(path=work_dir)
+def open_tar(archive_name):
+ return tarfile.open(archive_name, 'r')
+
+def open_zip(archive_name):
+ class ZipWrapper(zipfile.ZipFile):
+ def getnames(self):
+ return self.namelist()
+ return ZipWrapper(archive_name, 'r')
+
+def open_archive(archive_name):
+ try:
+ return open_tar(archive_name)
+ except:
+ return open_zip(archive_name)
+
+def extract_archive(work_dir, archive_file):
+ archive_file.extractall(path=work_dir)
return os.path.join(
work_dir,
- os.path.dirname([n for n in tf.getnames() if n.endswith('SConstruct')][0])
+ os.path.dirname([n for n in archive_file.getnames() if n.endswith('SConstruct')][0])
)
def run_scons(extracted_root, scons_args):
View
3  distsrc/client/SConstruct
@@ -53,8 +53,9 @@ elif sys.platform in ("linux2", "linux3"):
nix = True
linux = True
-if sys.platform is 'win32':
+if sys.platform == 'win32':
env['DIST_ARCHIVE_SUFFIX'] = '.zip'
+ env.Append(CCFLAGS=['/EHsc', '/O2'])
else:
env['DIST_ARCHIVE_SUFFIX'] = '.tgz'
Please sign in to comment.
Something went wrong with that request. Please try again.