BuildBot: various changes to support building branches.
This commit is contained in:
@@ -53,7 +53,7 @@ c['builders'] = []
|
|||||||
buildernames = []
|
buildernames = []
|
||||||
|
|
||||||
|
|
||||||
def add_builder(c, name, libdir, factory):
|
def add_builder(c, name, libdir, factory, branch=''):
|
||||||
slavenames = []
|
slavenames = []
|
||||||
|
|
||||||
for slave in master_private.slaves:
|
for slave in master_private.slaves:
|
||||||
@@ -61,24 +61,26 @@ def add_builder(c, name, libdir, factory):
|
|||||||
slavenames.append(slave['name'])
|
slavenames.append(slave['name'])
|
||||||
|
|
||||||
if len(slavenames) > 0:
|
if len(slavenames) > 0:
|
||||||
f = factory(name, libdir)
|
f = factory(name, libdir, branch)
|
||||||
c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, factory=f, category='blender'))
|
c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, factory=f, category='blender'))
|
||||||
buildernames.append(name)
|
buildernames.append(name)
|
||||||
|
|
||||||
# common steps
|
# common steps
|
||||||
|
|
||||||
|
|
||||||
def svn_step():
|
def svn_step(branch=''):
|
||||||
|
if branch:
|
||||||
|
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/branches/%%BRANCH%%', mode='update', defaultBranch=branch, workdir='blender')
|
||||||
|
else:
|
||||||
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
|
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
|
||||||
|
|
||||||
|
|
||||||
def lib_svn_step(dir):
|
def lib_svn_step(dir):
|
||||||
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
|
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
|
||||||
|
|
||||||
# generic builder
|
# generic builder
|
||||||
|
|
||||||
|
|
||||||
def generic_builder(id, libdir=""):
|
def generic_builder(id, libdir='', branch=''):
|
||||||
filename = 'buildbot_upload_' + id + '.zip'
|
filename = 'buildbot_upload_' + id + '.zip'
|
||||||
compile_script = '../blender/build_files/buildbot/slave_compile.py'
|
compile_script = '../blender/build_files/buildbot/slave_compile.py'
|
||||||
test_script = '../blender/build_files/buildbot/slave_test.py'
|
test_script = '../blender/build_files/buildbot/slave_test.py'
|
||||||
@@ -86,13 +88,13 @@ def generic_builder(id, libdir=""):
|
|||||||
unpack_script = 'master_unpack.py'
|
unpack_script = 'master_unpack.py'
|
||||||
|
|
||||||
f = BuildFactory()
|
f = BuildFactory()
|
||||||
f.addStep(svn_step())
|
f.addStep(svn_step(branch))
|
||||||
if libdir != '':
|
if libdir != '':
|
||||||
f.addStep(lib_svn_step(libdir))
|
f.addStep(lib_svn_step(libdir))
|
||||||
|
|
||||||
f.addStep(Compile(command=['python', compile_script, id]))
|
f.addStep(Compile(command=['python', compile_script, id]))
|
||||||
f.addStep(Test(command=['python', test_script, id]))
|
f.addStep(Test(command=['python', test_script, id]))
|
||||||
f.addStep(ShellCommand(name='package', command=['python', pack_script, id], description='packaging', descriptionDone='packaged'))
|
f.addStep(ShellCommand(name='package', command=['python', pack_script, id, branch], description='packaging', descriptionDone='packaged'))
|
||||||
if id.find('cmake') != -1:
|
if id.find('cmake') != -1:
|
||||||
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
|
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
|
||||||
else:
|
else:
|
||||||
@@ -102,12 +104,19 @@ def generic_builder(id, libdir=""):
|
|||||||
|
|
||||||
# builders
|
# builders
|
||||||
|
|
||||||
add_builder(c, 'mac_x86_64_cmake', 'darwin-9.x.universal', generic_builder)
|
add_builder(c, 'mac_x86_64_scons', 'darwin-9.x.universal', generic_builder)
|
||||||
add_builder(c, 'mac_i386_cmake', 'darwin-9.x.universal', generic_builder)
|
add_builder(c, 'salad_mac_x86_64_scons', 'darwin-9.x.universal', generic_builder, 'soc-2011-salad')
|
||||||
add_builder(c, 'mac_ppc_cmake', 'darwin-9.x.universal', generic_builder)
|
add_builder(c, 'mac_i386_scons', 'darwin-9.x.universal', generic_builder)
|
||||||
add_builder(c, 'linux_x86_64_cmake', '', generic_builder)
|
add_builder(c, 'mac_ppc_scons', 'darwin-9.x.universal', generic_builder)
|
||||||
|
#add_builder(c, 'linux_x86_64_cmake', '', generic_builder)
|
||||||
|
add_builder(c, 'linux_i386_scons', '', generic_builder)
|
||||||
|
add_builder(c, 'salad_linux_i386_scons', '', generic_builder, 'soc-2011-salad')
|
||||||
add_builder(c, 'linux_x86_64_scons', '', generic_builder)
|
add_builder(c, 'linux_x86_64_scons', '', generic_builder)
|
||||||
|
add_builder(c, 'salad_linux_x86_64_scons', '', generic_builder, 'soc-2011-salad')
|
||||||
add_builder(c, 'win32_scons', 'windows', generic_builder)
|
add_builder(c, 'win32_scons', 'windows', generic_builder)
|
||||||
|
add_builder(c, 'salad_win32_scons', 'windows', generic_builder, 'soc-2011-salad')
|
||||||
|
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder)
|
||||||
|
#add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder)
|
||||||
|
|
||||||
# SCHEDULERS
|
# SCHEDULERS
|
||||||
#
|
#
|
||||||
@@ -149,7 +158,7 @@ authz_cfg = authz.Authz(
|
|||||||
pingBuilder=False,
|
pingBuilder=False,
|
||||||
stopBuild=False,
|
stopBuild=False,
|
||||||
stopAllBuilds=False,
|
stopAllBuilds=False,
|
||||||
cancelPendingBuild=False,
|
cancelPendingBuild=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
|
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
|
||||||
|
@@ -43,6 +43,7 @@ def get_platform(filename):
|
|||||||
# platform out, but there may be some variations, so we fiddle a
|
# platform out, but there may be some variations, so we fiddle a
|
||||||
# bit to handle current and hopefully future names
|
# bit to handle current and hopefully future names
|
||||||
filename = strip_extension(filename)
|
filename = strip_extension(filename)
|
||||||
|
filename = strip_extension(filename)
|
||||||
|
|
||||||
tokens = filename.split("-")
|
tokens = filename.split("-")
|
||||||
platforms = ('osx', 'mac', 'bsd',
|
platforms = ('osx', 'mac', 'bsd',
|
||||||
@@ -63,6 +64,21 @@ def get_platform(filename):
|
|||||||
|
|
||||||
return '-'.join(platform_tokens)
|
return '-'.join(platform_tokens)
|
||||||
|
|
||||||
|
def get_branch(filename):
|
||||||
|
tokens = filename.split("-")
|
||||||
|
branch = ""
|
||||||
|
|
||||||
|
for token in tokens:
|
||||||
|
if branch == "":
|
||||||
|
branch = token
|
||||||
|
else:
|
||||||
|
branch = branch + "-" + token
|
||||||
|
|
||||||
|
if token == "blender":
|
||||||
|
return branch
|
||||||
|
|
||||||
|
return ""
|
||||||
|
|
||||||
# get filename
|
# get filename
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
sys.stderr.write("Not enough arguments, expecting file to unpack\n")
|
sys.stderr.write("Not enough arguments, expecting file to unpack\n")
|
||||||
@@ -88,8 +104,9 @@ if len(z.namelist()) != 1:
|
|||||||
package = z.namelist()[0]
|
package = z.namelist()[0]
|
||||||
packagename = os.path.basename(package)
|
packagename = os.path.basename(package)
|
||||||
|
|
||||||
# detect platform
|
# detect platform and branch
|
||||||
platform = get_platform(packagename)
|
platform = get_platform(packagename)
|
||||||
|
branch = get_branch(packagename)
|
||||||
|
|
||||||
if platform == '':
|
if platform == '':
|
||||||
sys.stderr.write('Failed to detect platform ' +
|
sys.stderr.write('Failed to detect platform ' +
|
||||||
@@ -113,10 +130,10 @@ except Exception, ex:
|
|||||||
sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
|
sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# remove other files from the same platform
|
# remove other files from the same platform and branch
|
||||||
try:
|
try:
|
||||||
for f in os.listdir(directory):
|
for f in os.listdir(directory):
|
||||||
if platform.lower() in f.lower():
|
if get_platform(f) == platform and get_branch(f) == branch:
|
||||||
if f != packagename:
|
if f != packagename:
|
||||||
os.remove(os.path.join(directory, f))
|
os.remove(os.path.join(directory, f))
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
|
@@ -38,11 +38,11 @@ if builder.find('cmake') != -1:
|
|||||||
# set build options
|
# set build options
|
||||||
cmake_options = ['-DCMAKE_BUILD_TYPE:STRING=Release']
|
cmake_options = ['-DCMAKE_BUILD_TYPE:STRING=Release']
|
||||||
|
|
||||||
if builder == 'mac_x86_64_cmake':
|
if builder.endswith('mac_x86_64_cmake'):
|
||||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
|
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
|
||||||
elif builder == 'mac_i386_cmake':
|
elif builder.endswith('mac_i386_cmake'):
|
||||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=i386')
|
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=i386')
|
||||||
elif builder == 'mac_ppc_cmake':
|
elif builder.endswith('mac_ppc_cmake'):
|
||||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
|
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
|
||||||
|
|
||||||
# configure and make
|
# configure and make
|
||||||
@@ -75,10 +75,10 @@ else:
|
|||||||
config_dir = os.path.join(buildbot_dir, 'config')
|
config_dir = os.path.join(buildbot_dir, 'config')
|
||||||
|
|
||||||
configs = []
|
configs = []
|
||||||
if builder == 'linux_x86_64_scons':
|
if builder.endswith('linux_x86_64_scons'):
|
||||||
configs = ['user-config-player-x86_64.py',
|
configs = ['user-config-player-x86_64.py',
|
||||||
'user-config-x86_64.py']
|
'user-config-x86_64.py']
|
||||||
elif builder == 'linux_i386_scons':
|
elif builder.endswith('linux_i386_scons'):
|
||||||
configs = ['user-config-player-i686.py',
|
configs = ['user-config-player-i686.py',
|
||||||
'user-config-i686.py']
|
'user-config-i686.py']
|
||||||
|
|
||||||
|
@@ -33,11 +33,15 @@ if len(sys.argv) < 2:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
builder = sys.argv[1]
|
builder = sys.argv[1]
|
||||||
|
branch = ''
|
||||||
|
|
||||||
|
if len(sys.argv) >= 3:
|
||||||
|
branch = sys.argv[2]
|
||||||
|
|
||||||
# scons does own packaging
|
# scons does own packaging
|
||||||
if builder.find('scons') != -1:
|
if builder.find('scons') != -1:
|
||||||
os.chdir('../blender')
|
os.chdir('../blender')
|
||||||
scons_options = ['BF_QUICK=slnt', 'buildslave']
|
scons_options = ['BF_QUICK=slnt', 'BUILDBOT_BRANCH=' + branch, 'buildslave']
|
||||||
|
|
||||||
if builder.startswith('linux'):
|
if builder.startswith('linux'):
|
||||||
buildbot_dir = os.path.dirname(os.path.realpath(__file__))
|
buildbot_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
@@ -52,9 +56,9 @@ if builder.find('scons') != -1:
|
|||||||
|
|
||||||
config = None
|
config = None
|
||||||
|
|
||||||
if builder == 'linux_x86_64_scons':
|
if builder.endswith('linux_x86_64_scons'):
|
||||||
config = 'user-config-x86_64.py'
|
config = 'user-config-x86_64.py'
|
||||||
elif builder == 'linux_i386_scons':
|
elif builder.endswith('linux_i386_scons'):
|
||||||
config = 'user-config-x86_64.py'
|
config = 'user-config-x86_64.py'
|
||||||
|
|
||||||
if config is not None:
|
if config is not None:
|
||||||
|
@@ -134,7 +134,8 @@ def validate_arguments(args, bc):
|
|||||||
'BF_RAYOPTIMIZATION_SSE_FLAGS',
|
'BF_RAYOPTIMIZATION_SSE_FLAGS',
|
||||||
'BF_NO_ELBEEM',
|
'BF_NO_ELBEEM',
|
||||||
'WITH_BF_CXX_GUARDEDALLOC',
|
'WITH_BF_CXX_GUARDEDALLOC',
|
||||||
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC'
|
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
|
||||||
|
'BUILDBOT_BRANCH'
|
||||||
]
|
]
|
||||||
|
|
||||||
# Have options here that scons expects to be lists
|
# Have options here that scons expects to be lists
|
||||||
@@ -501,7 +502,9 @@ def read_opts(env, cfg, args):
|
|||||||
|
|
||||||
(BoolVariable('WITH_BF_RAYOPTIMIZATION', 'Enable raytracer SSE/SIMD optimization.', False)),
|
(BoolVariable('WITH_BF_RAYOPTIMIZATION', 'Enable raytracer SSE/SIMD optimization.', False)),
|
||||||
('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', ''),
|
('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', ''),
|
||||||
(BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False))
|
(BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)),
|
||||||
|
|
||||||
|
('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
|
||||||
) # end of opts.AddOptions()
|
) # end of opts.AddOptions()
|
||||||
|
|
||||||
return localopts
|
return localopts
|
||||||
@@ -546,7 +549,7 @@ def buildslave(target=None, source=None, env=None):
|
|||||||
Builder for buildbot integration. Used by buildslaves of http://builder.blender.org only.
|
Builder for buildbot integration. Used by buildslaves of http://builder.blender.org only.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
|
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'darwin'):
|
||||||
extension = '.zip'
|
extension = '.zip'
|
||||||
else:
|
else:
|
||||||
extension = '.tar.bz2'
|
extension = '.tar.bz2'
|
||||||
@@ -560,9 +563,15 @@ def buildslave(target=None, source=None, env=None):
|
|||||||
platform = 'linux-glibc27-x86_64'
|
platform = 'linux-glibc27-x86_64'
|
||||||
elif bitness == '32bit':
|
elif bitness == '32bit':
|
||||||
platform = 'linux-glibc27-i686'
|
platform = 'linux-glibc27-i686'
|
||||||
|
if platform == 'darwin':
|
||||||
|
platform = 'OSX-' + env['MACOSX_ARCHITECTURE']
|
||||||
|
|
||||||
|
branch = env['BUILDBOT_BRANCH']
|
||||||
|
|
||||||
outdir = os.path.abspath(env['BF_INSTALLDIR'])
|
outdir = os.path.abspath(env['BF_INSTALLDIR'])
|
||||||
package_name = 'blender-' + VERSION+'-'+REVISION + '-' + platform
|
package_name = 'blender-' + VERSION+'-'+REVISION + '-' + platform
|
||||||
|
if branch != '':
|
||||||
|
package_name = branch + '-' + package_name
|
||||||
package_dir = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name)
|
package_dir = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name)
|
||||||
package_archive = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name + extension)
|
package_archive = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name + extension)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user