aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2018-02-14 08:24:07 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-14 15:32:27 +0000
commit13ec4d211f07b7d1a4cfae14d897d422d7926290 (patch)
tree254e882c9734c528bc6e950db01a6a625f5b01af /infra
parentafe6cae2bac73b51f051f87c56b44cc4e164e688 (diff)
Trim down Emscripten SDK asset size
These cuts reduce the number of files by 2/3 and the size by 1/3 There's not too much more that could be trimmed - now the size is dominated by the specially compiled LLVM/Clang binaries Bug: skia:7186 Change-Id: Ie88fb6f2277eafbefac0f676daaca809dcb53f62 Reviewed-on: https://skia-review.googlesource.com/107061 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'infra')
-rw-r--r--infra/bots/assets/emscripten_sdk/VERSION2
-rwxr-xr-xinfra/bots/assets/emscripten_sdk/create_and_upload.py41
-rw-r--r--infra/bots/tasks.json2
3 files changed, 32 insertions, 13 deletions
diff --git a/infra/bots/assets/emscripten_sdk/VERSION b/infra/bots/assets/emscripten_sdk/VERSION
index 56a6051ca2..d8263ee986 100644
--- a/infra/bots/assets/emscripten_sdk/VERSION
+++ b/infra/bots/assets/emscripten_sdk/VERSION
@@ -1 +1 @@
-1 \ No newline at end of file
+2 \ No newline at end of file
diff --git a/infra/bots/assets/emscripten_sdk/create_and_upload.py b/infra/bots/assets/emscripten_sdk/create_and_upload.py
index 56e41a232b..1d17deb86d 100755
--- a/infra/bots/assets/emscripten_sdk/create_and_upload.py
+++ b/infra/bots/assets/emscripten_sdk/create_and_upload.py
@@ -12,6 +12,7 @@
import argparse
import common
import os
+import shutil
import subprocess
import sys
import utils
@@ -26,17 +27,35 @@ def main():
parser.add_argument('--sdk_path', '-s', required=True)
args = parser.parse_args()
- with utils.tmp_dir():
- upload_script = os.path.join(common.FILE_DIR, 'upload.py')
-
- try:
- cmd = ['python', upload_script, '-t', args.sdk_path]
- if args.gsutil:
- cmd.extend(['--gsutil', args.gsutil])
- subprocess.check_call(cmd)
- except subprocess.CalledProcessError:
- # Trap exceptions to avoid printing two stacktraces.
- sys.exit(1)
+ upload_script = os.path.join(common.FILE_DIR, 'upload.py')
+
+ try:
+ # Remove large directories that we don't need to use the sdk
+ # (e.g. intermediate build products)
+ rmpath = os.path.join(args.sdk_path, 'clang', 'fastcomp',
+ 'build_incoming_64')
+ # We can ignore errors, for example, if the folders were already deleted.
+ shutil.rmtree(os.path.join(rmpath, 'lib'), ignore_errors=True)
+ shutil.rmtree(os.path.join(rmpath, 'tools') , ignore_errors=True)
+
+ # Remove the source code, which has lots of small files which slows
+ # extraction. We don't need the source code - we mostly care about the
+ # binaries in $SDK/clang/fastcomp/build_incoming_64/bin.
+ src = os.path.join(args.sdk_path, 'clang', 'fastcomp', 'src')
+ for name in os.listdir(src):
+ p = os.path.join(src, name)
+ # Purposely don't delete src/emscripten-version.txt, which can cause
+ # compilation warnings about "can't verify version".
+ if os.path.isdir(p):
+ shutil.rmtree(p)
+
+ cmd = ['python', upload_script, '-t', args.sdk_path]
+ if args.gsutil:
+ cmd.extend(['--gsutil', args.gsutil])
+ subprocess.check_call(cmd)
+ except subprocess.CalledProcessError:
+ # Trap exceptions to avoid printing two stacktraces.
+ sys.exit(1)
if __name__ == '__main__':
diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json
index 9d48b34e6b..a2b70eb575 100644
--- a/infra/bots/tasks.json
+++ b/infra/bots/tasks.json
@@ -4587,7 +4587,7 @@
{
"name": "skia/bots/emscripten_sdk",
"path": "emscripten_sdk",
- "version": "version:1"
+ "version": "version:2"
}
],
"dimensions": [