def pack_linux(builder): blender_executable = os.path.join(builder.install_dir, 'blender') info = buildbot_utils.VersionInfo(builder) # Strip all unused symbols from the binaries print("Stripping binaries...") buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable]) print("Stripping python...") py_target = os.path.join(builder.install_dir, info.version) buildbot_utils.call(builder.command_prefix + [ 'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';' ]) # Construct package name platform_name = 'linux64' package_name = get_package_name(builder, platform_name) package_filename = package_name + ".tar.xz" print("Creating .tar.xz archive") package_filepath = builder.install_dir + '.tar.xz' create_tar_xz(builder.install_dir, package_filepath, package_name) # Create buildbot_upload.zip create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
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' ] elif builder.platform == 'linux': command = ['make', '-s', '-j16', 'install'] else: command = ['make', '-s', '-j2', 'install'] print("CMake build:") buildbot_utils.call(builder.command_prefix + command)
def pack_mac(builder): info = buildbot_utils.VersionInfo(builder) os.chdir(builder.build_dir) cleanup_files(builder.build_dir, '.dmg') package_name = get_package_name(builder, 'macOS') package_filename = package_name + '.dmg' package_filepath = os.path.join(builder.build_dir, package_filename) release_dir = os.path.join(builder.blender_dir, 'release', 'darwin') buildbot_dir = os.path.join(builder.blender_dir, 'build_files', 'buildbot') bundle_script = os.path.join(buildbot_dir, 'worker_bundle_dmg.py') command = [bundle_script] command += ['--dmg', package_filepath] 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) create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
def update_git(builder): # Do extra git fetch because not all platform/git/buildbot combinations # update the origin remote, causing buildinfo to detect local changes. os.chdir(builder.blender_dir) print("Fetching remotes") command = ['git', 'fetch', '--all'] buildbot_utils.call(builder.command_prefix + command)
def cmake_configure(builder): # CMake configuration os.chdir(builder.build_dir) cmake_cache = os.path.join(builder.build_dir, 'CMakeCache.txt') if os.path.exists(cmake_cache): print("Removing CMake cache") os.remove(cmake_cache) print("CMake configure:") cmake_options = get_cmake_options(builder) command = ['cmake', builder.blender_dir] + cmake_options buildbot_utils.call(builder.command_prefix + command)
def cmake_build(builder): # CMake build os.chdir(builder.build_dir) if builder.platform == 'win': command = [ 'cmake', '--build', '.', '--target', 'install', '--config', 'Release' ] else: command = ['make', '-s', '-j2', 'install'] print("CMake build:") buildbot_utils.call(builder.command_prefix + command)
def pack_linux(builder): blender_executable = os.path.join(builder.install_dir, 'blender') info = buildbot_utils.VersionInfo(builder) blender_glibc = builder.name.split('_')[1] blender_arch = 'x86_64' # Strip all unused symbols from the binaries print("Stripping binaries...") buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable]) print("Stripping python...") py_target = os.path.join(builder.install_dir, info.version) buildbot_utils.call(builder.command_prefix + [ 'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';' ]) # Copy all specific files which are too specific to be copied by # the CMake rules themselves print("Copying extra scripts and libs...") extra = '/' + os.path.join('home', 'sources', 'release-builder', 'extra') mesalibs = os.path.join(extra, 'mesalibs' + str(builder.bits) + '.tar.bz2') software_gl = os.path.join(builder.blender_dir, 'release', 'bin', 'blender-softwaregl') icons = os.path.join(builder.blender_dir, 'release', 'freedesktop', 'icons') os.system('tar -xpf %s -C %s' % (mesalibs, builder.install_dir)) os.system('cp %s %s' % (software_gl, builder.install_dir)) os.system('cp -r %s %s' % (icons, builder.install_dir)) os.system('chmod 755 %s' % (os.path.join(builder.install_dir, 'blender-softwaregl'))) # Construct package name platform_name = 'linux-' + blender_glibc + '-' + blender_arch package_name = get_package_name(builder, platform_name) package_filename = package_name + ".tar.bz2" print("Creating .tar.bz2 archive") package_filepath = builder.install_dir + '.tar.bz2' create_tar_bz2(builder.install_dir, package_filepath, package_name) # Create buildbot_upload.zip create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
def pack_win(builder): info = buildbot_utils.VersionInfo(builder) os.chdir(builder.build_dir) cleanup_files(builder.build_dir, '.zip') # CPack will add the platform name cpack_name = get_package_name(builder, None) package_name = get_package_name(builder, 'windows' + str(builder.bits)) command = [ 'cmake', '-DCPACK_OVERRIDE_PACKAGENAME:STRING=' + cpack_name, '.' ] buildbot_utils.call(builder.command_prefix + command) command = ['cpack', '-G', 'ZIP'] buildbot_utils.call(builder.command_prefix + command) package_filename = package_name + '.zip' package_filepath = os.path.join(builder.build_dir, package_filename) package_files = [(package_filepath, package_filename)] if info.version_cycle == 'release': # Installer only for final release builds, otherwise will get # 'this product is already installed' messages. command = ['cpack', '-G', 'WIX'] buildbot_utils.call(builder.command_prefix + command) package_filename = package_name + '.msi' package_filepath = os.path.join(builder.build_dir, package_filename) package_files += [(package_filepath, package_filename)] create_buildbot_upload_zip(builder, package_files)
# modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> import buildbot_utils import os import sys if __name__ == "__main__": builder = buildbot_utils.create_builder_from_arguments() os.chdir(builder.blender_dir) # Run make update which handles all libraries and submodules. make_update = os.path.join(builder.blender_dir, "build_files", "utils", "make_update.py") buildbot_utils.call( [sys.executable, make_update, '--no-blender', "--use-tests"])
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> # Runs on buildbot slave, rsync zip directly to buildbot server rather # than using upload which is much slower import buildbot_utils import os import sys if __name__ == "__main__": builder = buildbot_utils.create_builder_from_arguments() # rsync, this assumes ssh keys are setup so no password is needed local_zip = "buildbot_upload.zip" remote_folder = "builder.blender.org:/data/buildbot-master/uploaded/" remote_zip = remote_folder + "buildbot_upload_" + builder.name + ".zip" command = ["rsync", "-avz", local_zip, remote_zip] buildbot_utils.call(command)
def test(builder): os.chdir(builder.build_dir) command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder) ctest_env = get_ctest_environment(builder) buildbot_utils.call(command, env=ctest_env, exit_on_error=False)
def test(builder): os.chdir(builder.build_dir) command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder) buildbot_utils.call(command)