[Bf-blender-cvs] [aacedd78617] blender-v2.83-release: Buildbot: make code signing of packages optional with --codesign parameter

Brecht Van Lommel noreply at git.blender.org
Tue Aug 4 16:39:35 CEST 2020


Commit: aacedd786177f0e8689bbcd5f96c157cd1e156d5
Author: Brecht Van Lommel
Date:   Fri Jul 31 16:04:02 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBaacedd786177f0e8689bbcd5f96c157cd1e156d5

Buildbot: make code signing of packages optional with --codesign parameter

This is in preparation of doing builds per commit that will not be code signed.

Ref D8438

Differential Revision: https://developer.blender.org/D8451

===================================================================

M	build_files/buildbot/buildbot_utils.py
M	build_files/buildbot/worker_bundle_dmg.py
M	build_files/buildbot/worker_compile.py
M	build_files/buildbot/worker_pack.py

===================================================================

diff --git a/build_files/buildbot/buildbot_utils.py b/build_files/buildbot/buildbot_utils.py
index acede05869a..fd0f90e48d4 100644
--- a/build_files/buildbot/buildbot_utils.py
+++ b/build_files/buildbot/buildbot_utils.py
@@ -67,6 +67,7 @@ def create_builder_from_arguments():
     parser = argparse.ArgumentParser()
     parser.add_argument('builder_name')
     parser.add_argument('branch', default='master', nargs='?')
+    parser.add_argument("--codesign", action="store_true")
     args = parser.parse_args()
     return Builder(args.builder_name, args.branch)
 
diff --git a/build_files/buildbot/worker_bundle_dmg.py b/build_files/buildbot/worker_bundle_dmg.py
index cd3da85e12a..31e10d51610 100755
--- a/build_files/buildbot/worker_bundle_dmg.py
+++ b/build_files/buildbot/worker_bundle_dmg.py
@@ -82,6 +82,10 @@ def create_argument_parser():
         type=Path,
         help="Optional path to applescript to set up folder looks of DMG."
              "If not provided default Blender's one is used.")
+    parser.add_argument(
+        '--codesign',
+        action="store_true"
+        help="Code sign and notarize DMG contents.")
     return parser
 
 
@@ -395,7 +399,8 @@ def create_final_dmg(app_bundles: List[Path],
                      dmg_filepath: Path,
                      background_image_filepath: Path,
                      volume_name: str,
-                     applescript: Path) -> None:
+                     applescript: Path,
+                     codesign: bool) -> None:
     """
     Create DMG with all app bundles
 
@@ -421,7 +426,8 @@ def create_final_dmg(app_bundles: List[Path],
     #
     # This allows to recurs into the content of bundles without worrying about
     # possible interfereice of Application symlink.
-    codesign_app_bundles_in_dmg(mount_directory)
+    if codesign:
+        codesign_app_bundles_in_dmg(mount_directory)
 
     copy_background_if_needed(background_image_filepath, mount_directory)
     create_applications_link(mount_directory)
@@ -434,7 +440,8 @@ def create_final_dmg(app_bundles: List[Path],
     compress_dmg(writable_dmg_filepath, dmg_filepath)
     writable_dmg_filepath.unlink()
 
-    codesign_and_notarize_dmg(dmg_filepath)
+    if codesign:
+        codesign_and_notarize_dmg(dmg_filepath)
 
 
 def ensure_dmg_extension(filepath: Path) -> Path:
@@ -521,6 +528,7 @@ def main():
     source_dir = args.source_dir.absolute()
     background_image_filepath = get_background_image(args.background_image)
     applescript = get_applescript(args.applescript)
+    codesign = args.codesign
 
     app_bundles = collect_and_log_app_bundles(source_dir)
     if not app_bundles:
@@ -535,7 +543,8 @@ def main():
                      dmg_filepath,
                      background_image_filepath,
                      volume_name,
-                     applescript)
+                     applescript,
+                     codesign)
 
 
 if __name__ == "__main__":
diff --git a/build_files/buildbot/worker_compile.py b/build_files/buildbot/worker_compile.py
index 705614660cf..6df112713a4 100644
--- a/build_files/buildbot/worker_compile.py
+++ b/build_files/buildbot/worker_compile.py
@@ -24,7 +24,7 @@ import shutil
 import buildbot_utils
 
 def get_cmake_options(builder):
-    post_install_script = os.path.join(
+    codesign_script = os.path.join(
         builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
 
     config_file = "build_files/cmake/config/blender_release.cmake"
@@ -36,7 +36,8 @@ def get_cmake_options(builder):
         options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
     elif builder.platform == 'win':
         options.extend(['-G', 'Visual Studio 15 2017 Win64'])
-        options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + post_install_script])
+        if builder.codesign:
+            options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + codesign_script])
     elif builder.platform == 'linux':
         config_file = "build_files/buildbot/config/blender_linux.cmake"
 
diff --git a/build_files/buildbot/worker_pack.py b/build_files/buildbot/worker_pack.py
index 87ee49c87d8..96c8db8e6c8 100644
--- a/build_files/buildbot/worker_pack.py
+++ b/build_files/buildbot/worker_pack.py
@@ -117,6 +117,8 @@ def pack_mac(builder):
     if info.is_development_build:
         background_image = os.path.join(release_dir, 'buildbot', 'background.tif')
         command += ['--background-image', background_image]
+    if builder.codesign:
+        command += ['--codesign']
     command += [builder.install_dir]
     buildbot_utils.call(command)
 
@@ -150,7 +152,8 @@ def pack_win(builder):
 
         package_filename = package_name + '.msi'
         package_filepath = os.path.join(builder.build_dir, package_filename)
-        sign_file_or_directory(package_filepath)
+        if builder.codesign:
+            sign_file_or_directory(package_filepath)
 
         package_files += [(package_filepath, package_filename)]



More information about the Bf-blender-cvs mailing list