Bug 1479878 Add a --skip-revert option to build-clang.py r=glandium
authorTom Ritter <tom@mozilla.com>
Wed, 15 Aug 2018 06:13:14 +0000
changeset 486721 e7b659d978e1a945a3de7859d6196e48d9422557
parent 486720 8f6dd1a7738bf26cb62ed917e844d37a9aa39eab
child 486722 bf786c1aca5f35302edb23ae14015ac0f39887ff
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1479878
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1479878 Add a --skip-revert option to build-clang.py r=glandium Differential Revision: https://phabricator.services.mozilla.com/D2580
build/build-clang/build-clang.py
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -351,16 +351,19 @@ if __name__ == "__main__":
     parser.add_argument('-b', '--base-dir', required=False,
                         help="Base directory for code and build artifacts")
     parser.add_argument('--clean', required=False,
                         action='store_true',
                         help="Clean the build directory")
     parser.add_argument('--skip-tar', required=False,
                         action='store_true',
                         help="Skip tar packaging stage")
+    parser.add_argument('--skip-checkout', required=False,
+                        action='store_true',
+                        help="Do not checkout/revert source")
 
     args = parser.parse_args()
 
     # The directories end up in the debug info, so the easy way of getting
     # a reproducible build is to run it in a know absolute directory.
     # We use a directory that is registered as a volume in the Docker image.
 
     if args.base_dir:
@@ -482,28 +485,29 @@ if __name__ == "__main__":
         os.makedirs(source_dir)
 
     def checkout_or_update(repo, checkout_dir):
         if os.path.exists(checkout_dir):
             svn_update(checkout_dir, llvm_revision)
         else:
             svn_co(source_dir, repo, checkout_dir, llvm_revision)
 
-    checkout_or_update(llvm_repo, llvm_source_dir)
-    checkout_or_update(clang_repo, clang_source_dir)
-    checkout_or_update(compiler_repo, compiler_rt_source_dir)
-    checkout_or_update(libcxx_repo, libcxx_source_dir)
-    if lld_repo:
-        checkout_or_update(lld_repo, lld_source_dir)
-    if libcxxabi_repo:
-        checkout_or_update(libcxxabi_repo, libcxxabi_source_dir)
-    if extra_repo:
-        checkout_or_update(extra_repo, extra_source_dir)
-    for p in config.get("patches", []):
-        patch(p, source_dir)
+    if not args.skip_checkout:
+        checkout_or_update(llvm_repo, llvm_source_dir)
+        checkout_or_update(clang_repo, clang_source_dir)
+        checkout_or_update(compiler_repo, compiler_rt_source_dir)
+        checkout_or_update(libcxx_repo, libcxx_source_dir)
+        if lld_repo:
+            checkout_or_update(lld_repo, lld_source_dir)
+        if libcxxabi_repo:
+            checkout_or_update(libcxxabi_repo, libcxxabi_source_dir)
+        if extra_repo:
+            checkout_or_update(extra_repo, extra_source_dir)
+        for p in config.get("patches", []):
+            patch(p, source_dir)
 
     symlinks = [(clang_source_dir,
                  llvm_source_dir + "/tools/clang"),
                 (extra_source_dir,
                  llvm_source_dir + "/tools/clang/tools/extra"),
                 (lld_source_dir,
                  llvm_source_dir + "/tools/lld"),
                 (compiler_rt_source_dir,