diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-04-02 01:22:19 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-04-02 01:22:19 +0400 |
commit | 485229b7db0888e8f6e504ee41f159bd45fd42a9 (patch) | |
tree | 655312c549f1668f4e286d0ad62e80f3eb87f8aa /build_files/buildbot/slave_compile.py | |
parent | 367cf47dd68f210eeaf9ba6b51a1fdbcf93d209b (diff) |
Initial support of linux 32/64 bit for buildbot:
- Use the same config as we're using for release builds
- Added stipping (maybe it should be generalized)
- Not software gl packing, bot would be easy to add
Note, that you should have special environment to create
proper linux builts (which would work for everybody)
Diffstat (limited to 'build_files/buildbot/slave_compile.py')
-rw-r--r-- | build_files/buildbot/slave_compile.py | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py index 54150a93e61..ab9b9a61fbc 100644 --- a/build_files/buildbot/slave_compile.py +++ b/build_files/buildbot/slave_compile.py @@ -56,5 +56,67 @@ else: os.chdir(blender_dir) scons_options = [] - retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options) - sys.exit(retcode) + if builder.startswith('linux'): + import shutil + + cores = 1 + if hasattr(os, 'sysconf'): + if 'SC_NPROCESSORS_ONLN' in os.sysconf_names: + cores = os.sysconf('SC_NPROCESSORS_ONLN') + + if cores > 1: + # there're two chroot environments in one machine, + # so use only a half of power for better performance + cores = cores / 2 + + # We're using the same rules as release builder, so tweak + # build and install dirs + build_dir = os.path.join('..', 'build', builder) + install_dir = os.path.join('..', 'install', builder) + + common_options = ['BF_NUMJOBS=' + str(cores), + 'BF_BUILDDIR=' + build_dir, + 'BF_INSTALLDIR=' + install_dir] + + # Clean all directories first + retcode = subprocess.call(['python', 'scons/scons.py'] + common_options + ['clean']) + if retcode != 0: + print('Error cleaning build directory') + sys.exit(retcode) + + if os.path.isdir(install_dir): + shutil.rmtree(install_dir) + + buildbot_dir = os.path.dirname(os.path.realpath(__file__)) + config_dir = os.path.join(buildbot_dir, 'config') + + configs = [] + if builder == 'linux_x86_64_scons': + configs = ['user-config-player-x86_64.py', + 'user-config-x86_64.py'] + elif builder == 'linux_i386_scons': + configs = ['user-config-player-i686.py', + 'user-config-i686.py'] + + for config in configs: + config_fpath = os.path.join(config_dir, config) + + scons_options = [] + scons_options += common_options + + if config.find('player') == -1: + scons_options.append('blender') + else: + scons_options.append('blenderplayer') + + scons_options.append('BF_CONFIG=' + config_fpath) + + retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options) + if retcode != 0: + print('Error building rules wuth config ' + config) + sys.exit(retcode) + + sys.exit(0) + else: + retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options) + sys.exit(retcode) |