diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-11-07 18:50:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-11-13 11:24:41 +0300 |
commit | c73a99ef902b21cc0ed2b03daffa9f1adfb70412 (patch) | |
tree | dff6e68daedb646fc315a7f80d4c3b3b132f151a /build_files/buildbot/slave_compile.py | |
parent | d32520932ff58b00b0b67d168c51c050035176fe (diff) |
Initial implementation of code signing routines
This changes integrates code signing steps into a buildbot worker
process.
The configuration requires having a separate machine running with
a shared folder access between the signing machine and worker machine.
Actual signing is happening as a "POST-INSTALL" script run by CMake,
which allows to sign any binary which ends up in the final bundle.
Additionally, such way allows to avoid signing binaries in the build
folder (if we were signing as a built process, which iwas another
alternative).
Such complexity is needed on platforms which are using CPack to
generate final bundle: CPack runs INSTALL target into its own location,
so it is useless to run signing on a folder which is considered INSTALL
by the buildbot worker.
There is a signing script which can be used as a standalone tool,
making it possible to hook up signing for macOS's bundler.
There is a dummy Linux signer implementation, which can be activated
by returning True from mock_codesign in linux_code_signer.py.
Main purpose of this signer is to give an ability to develop the
scripts on Linux environment, without going to Windows VM.
The code is based on D6036 from Nathan Letwory.
Differential Revision: https://developer.blender.org/D6216
Diffstat (limited to 'build_files/buildbot/slave_compile.py')
-rw-r--r-- | build_files/buildbot/slave_compile.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py index 0da0ead819f..f8bab19a1e9 100644 --- a/build_files/buildbot/slave_compile.py +++ b/build_files/buildbot/slave_compile.py @@ -18,13 +18,19 @@ # <pep8 compliant> -import buildbot_utils import os import shutil +import buildbot_utils + def get_cmake_options(builder): + post_install_script = os.path.join( + builder.blender_dir, 'build_files', 'buildbot', 'slave_codesign.cmake') + config_file = "build_files/cmake/config/blender_release.cmake" - options = ['-DCMAKE_BUILD_TYPE:STRING=Release', '-DWITH_GTESTS=ON'] + options = ['-DCMAKE_BUILD_TYPE:STRING=Release', + '-DWITH_GTESTS=ON', + '-DPOSTINSTALL_SCRIPT:PATH=' + post_install_script] if builder.platform == 'mac': options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64') @@ -84,6 +90,16 @@ def cmake_build(builder): # CMake build os.chdir(builder.build_dir) + # NOTE: CPack will build an INSTALL target, which would mean that code + # signing will happen twice when using `make install` and CPack. + # The tricky bit here is that it is not possible to know whether INSTALL + # target is used by CPack or by a buildbot itaself. Extra level on top of + # this is that on Windows it is required to build INSTALL target in order + # to have unit test binaries to run. + # So on the one hand we do an extra unneeded code sign on Windows, but on + # a positive side we don't add complexity and don't make build process more + # fragile trying to avoid this. The signing process is way faster than just + # a clean build of buildbot, especially with regression tests enabled. if builder.platform == 'win': command = ['cmake', '--build', '.', '--target', 'install', '--config', 'Release'] else: |