def gen_tarball_updated_factory(rooturl, nocheck=False, omega=True, configure_opts=[]): """ Make a factory for doing builds from tarballs. """ configure_cmd = ["sh", "configure", ] + configure_opts f = factory.BuildFactory() f.addStep(shell.ShellCommand(command = ["python", "-c", "try: import urllib2 as u\nexcept: import urllib.request as u\nopen('get_tarballs.py', 'wb').write(u.urlopen('%s').read())" % 'http://trac.xapian.org/export/HEAD/trunk/xapian-maintainer-tools/buildbot/scripts/get_tarballs.py'], workdir='.', haltOnFailure=True)) f.addStep(shell.ShellCommand(command = ["python", 'get_tarballs.py', rooturl], workdir='.', haltOnFailure=True)) f.addStep(shell.Configure(workdir='build/xapian-core', command=configure_cmd)) f.addStep(shell.Compile(workdir='build/xapian-core')) if not nocheck: f.addStep(shell.Test(workdir='build/xapian-core', name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="])) if omega: f.addStep(shell.Configure(workdir='build/xapian-omega', command = ["./configure", xapian_config_arg] + configure_opts)) f.addStep(shell.Compile(workdir='build/xapian-omega')) if not nocheck: f.addStep(shell.Test(workdir='build/xapian-omega', name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="])) f.addStep(shell.Configure(workdir='build/xapian-bindings', command = ["./configure", xapian_config_arg] + configure_opts)) f.addStep(shell.Compile(workdir='build/xapian-bindings', command = ["make"])) if not nocheck: f.addStep(shell.Test(workdir='build/xapian-bindings', name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="])) # If everything passed, there's not much point keeping the build - we'd # delete the old build tree and download new tarballs next time anyway. f.addStep(slave.RemoveDirectory('build')) return f
def gen_tarball_updated_factory(rooturl, configure_opts=[]): """ Make a factory for doing builds from tarballs. """ configure_cmd = [ "sh", "configure", ] + configure_opts f = factory.BuildFactory() f.addStep( shell.ShellCommand(command=[ "python", "-c", "import urllib2;open('get_tarballs.py', 'wb').write(urllib2.urlopen('%s').read())" % 'http://trac.xapian.org/export/HEAD/trunk/xapian-maintainer-tools/buildbot/scripts/get_tarballs.py' ], workdir='.', haltOnFailure=True)) f.addStep( shell.ShellCommand(command=["python", 'get_tarballs.py'], workdir='.', haltOnFailure=True)) f.addStep( shell.Configure(workdir='build/xapian-core', command=configure_cmd)) f.addStep(shell.Compile(workdir='build/xapian-core')) f.addStep( shell.Test(workdir='build/xapian-core', name="check", command=[ "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=" ])) f.addStep( shell.Configure(workdir='build/xapian-omega', command=["./configure", xapian_config_arg] + configure_opts)) f.addStep(shell.Compile(workdir='build/xapian-omega')) f.addStep( shell.Test(workdir='build/xapian-omega', name="check", command=[ "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=" ])) f.addStep( shell.Configure(workdir='build/xapian-bindings', command=["./configure", xapian_config_arg] + configure_opts)) f.addStep(shell.Compile(workdir='build/xapian-bindings', command=["make"])) f.addStep( shell.Test(workdir='build/xapian-bindings', name="check", command=[ "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=" ])) return f
def MakeDebBuilder(distro, version, is_64_bit): arch = "amd64" if is_64_bit else "i386" env = { "DEB_BUILD_OPTIONS": "parallel=4", } cmake_cmd = [ "cmake", "..", "-DWITH_DEBIAN=ON", "-DDEB_ARCH=" + arch, "-DDEB_DIST=" + version, "-DFORCE_GIT_REVISION=", "-DENABLE_SPOTIFY_BLOB=OFF", ] make_cmd = ["make", "deb"] f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("Clementine"))) f.addStep( shell.ShellCommand(name="cmake", command=cmake_cmd, haltOnFailure=True, workdir="source/bin")) f.addStep( shell.Compile(command=make_cmd, haltOnFailure=True, workdir="source/bin", env=env)) f.addStep(OutputFinder(pattern="bin/clementine_*.deb")) f.addStep(UploadPackage("%s-%s" % (distro, version))) return f
def MakeFedoraBuilder(distro, unused_is_64_bit): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("Clementine"))) f.addStep( shell.ShellCommand(name="clean", workdir="source/bin", command="find ~/rpmbuild/ -type f -delete")) f.addStep( shell.ShellCommand(name="cmake", workdir="source/bin", haltOnFailure=True, command=["cmake", ".."])) f.addStep( shell.ShellCommand(name="maketarball", workdir="source/bin", haltOnFailure=True, command=["../dist/maketarball.sh"])) f.addStep( shell.ShellCommand( name="movetarball", workdir="source/bin", haltOnFailure=True, command="mv clementine-*.tar.xz ~/rpmbuild/SOURCES")) f.addStep( shell.Compile(name="rpmbuild", workdir="source/bin", haltOnFailure=True, command=["rpmbuild", "-ba", "../dist/clementine.spec"])) f.addStep(OutputFinder(pattern="~/rpmbuild/RPMS/*/clementine-*.rpm")) f.addStep(UploadPackage("fedora-" + distro)) return f
def gen_git_updated_lcov_factory(repourl, configure_opts=[]): """ Factory for doing build from git master, without cleaning first, and using lcov to generate a coverage report. This one is much more expensive, so should be run with a higher stable time. """ f = factory.BuildFactory() f.addStep(source.Git(repourl=repourl, mode="update")) f.addStep(Bootstrap()) f.addStep( shell.Configure(command=[ "sh", "configure", "--enable-maintainer-mode", "--disable-shared", "--disable-documentation", "CXXFLAGS=-O0 --coverage", "VALGRIND=", "CCACHE_DISABLE=1" ] + configure_opts, workdir="build/xapian-core")) f.addStep(shell.Compile(workdir="build/xapian-core")) f.addStep( shell.ShellCommand( command=["make", "coverage-check", "GENHTML_ARGS=--html-gzip"], workdir="build/xapian-core", haltOnFailure=True)) f.addStep( shell.ShellCommand(command=["chmod", "-R", "a+rX", "lcov"], workdir="build/xapian-core", haltOnFailure=True)) f.addStep( shell.ShellCommand( command= 'NOW=`date -u +%Y-%m-%d`; cp -a lcov/. /var/www/"$NOW" && ln -sfT "$NOW" /var/www/latest', workdir="build/xapian-core", haltOnFailure=True)) return f
def gen_svn_updated_valgrind_factory(baseURL, configure_opts=[]): """ Factory for doing HEAD build from SVN, without cleaning first, and using valgrind to check. This one is much more expensive, so should be run with a higher stable time. """ f = factory.BuildFactory() f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk', mode="update")) f.addStep(Bootstrap()) configure_opts.append("--disable-documentation") f.addStep( shell.Configure(command=["sh", "configure", "CXXFLAGS=-O0 -g"] + configure_opts)) f.addStep( QuietenLibtool([ 'xapian-core/libtool', 'xapian-applications/omega/libtool', 'xapian-bindings/libtool' ])) f.addStep(shell.Compile()) f.addStep( shell.Test(name="check", command=["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain"], workdir='build/xapian-core')) return f
def gen_svn_debug_updated_factory(baseURL, opts, nocheck=False): """ Make a factory for doing a debug HEAD build from SVN, but without cleaning first. This build is intended to catch commonly made mistakes quickly. """ f = factory.BuildFactory() f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk', mode="update")) f.addStep(Bootstrap()) opts.append("--disable-documentation") f.addStep(shell.Configure(command=[ "sh", "configure", ] + opts)) f.addStep( QuietenLibtool([ 'xapian-core/libtool', 'xapian-applications/omega/libtool', 'xapian-bindings/libtool' ])) f.addStep(shell.Compile()) if not nocheck: f.addStep( shell.Test(name="check", command=[ "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=" ])) return f
def gen_svn_updated_valgrind_factory(baseURL, configure_opts=[]): """ Factory for doing HEAD build from SVN, without cleaning first, and using valgrind to check. This one is much more expensive, so should be run with a higher stable time. """ f = factory.BuildFactory() f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk', mode="update")) f.addStep(Bootstrap()) f.addStep( shell.Configure(command=["sh", "configure", "CXXFLAGS=-O0 -g"] + configure_opts)) f.addStep(shell.Compile()) f.addStep( shell.Test(name="check", command=["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain"], workdir='build/xapian-core')) #for target in ("check-none", "check-inmemory", "check-remoteprog", # "check-chert"): # f.addStep(shell.Test(name=target, command = ["make", target, "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=/home/olly/install/bin/valgrind"], workdir='build/xapian-core')) # ## Currently, valgrind incorrectly reports leaked memory for the remotetcp ## backend, so check that one without using valgrind. #f.addStep(shell.Test(name="check-remotetcp", command = ["make", "check-remotetcp", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=/home/olly/install/bin/valgrind"], workdir='build/xapian-core')) return f
def core_factory(repourl, usedocs=False, configure=None, audit=False, clean=False, nocheck = False, configure_opts=None): f = factory.BuildFactory() mode = "update" if clean: #f.addStep(MakeWritable, workdir='.') f.addStep(shell.ShellCommand(command = ["chmod", "-R", "+w", "."], workdir='.')) mode = "clobber" f.addStep(source.Git(repourl=repourl, mode=mode)) if audit: f.addStep(shell.ShellCommand(command = ["python", 'audit.py'], workdir='build/xapian-maintainer-tools')) f.addStep(shell.ShellCommand(command = ["chmod", '644', 'copyright.csv', 'fixmes.csv'], workdir='build/xapian-maintainer-tools')) f.addStep(shell.ShellCommand(command = ["mv", 'copyright.csv', 'fixmes.csv', '/var/www/'], workdir='build/xapian-maintainer-tools')) f.addStep(Bootstrap()) if configure: f.addStep(shell.Configure(command=configure)) else: if configure_opts is None: configure_opts = [] if not usedocs: configure_opts.append("--disable-documentation") if configure_opts: f.addStep(shell.Configure(command=["sh", "configure"] + configure_opts)) else: f.addStep(shell.Configure()) f.addStep(shell.Compile()) if not nocheck: f.addStep(shell.Test(name="check", command=["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="])) return f
def gen_svn_updated_lcov_factory(baseURL, configure_opts=[]): """ Factory for doing HEAD build from SVN, without cleaning first, and using lcov to generate a coverage report. This one is much more expensive, so should be run with a higher stable time. """ f = factory.BuildFactory() f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk', mode="update")) f.addStep(Bootstrap()) f.addStep( shell.Configure(command=[ "sh", "configure", "--disable-shared", "CXXFLAGS=-O0 --coverage" ] + configure_opts, workdir="build/xapian-core")) f.addStep(shell.Compile(workdir="build/xapian-core")) f.addStep( shell.ShellCommand( command=["make", "coverage-check", "GENHTML_ARGS=--html-gzip"], workdir="build/xapian-core", haltOnFailure=True)) f.addStep( shell.ShellCommand(command=["chmod", "-R", "a+rX", "lcov"], workdir="build/xapian-core", haltOnFailure=True)) f.addStep( shell.ShellCommand( command= 'NOW=`date -u +%Y-%m-%d`; cp -a lcov/. /var/www/"$NOW" && ln -sfT "$NOW" /var/www/latest', workdir="build/xapian-core", haltOnFailure=True)) return f
def MakeDebBuilder(distro, version): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("strawberry", "master"))) f.addStep( shell.ShellCommand( name="run cmake", workdir="source/build", command=["cmake", ".."], haltOnFailure=True ) ) f.addStep( shell.Compile( name="run dpkg-buildpackage", workdir="source", command=["dpkg-buildpackage", "-b", "-d", "-uc", "-us", "-nc", "-tc"], haltOnFailure=True ) ) f.addStep( steps.SetPropertyFromCommand( name="get output filename for deb", workdir="source", command=["sh", "-c", "ls -dt ../strawberry_*.deb | head -n 1"], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) f.addStep(UploadPackage("%s/%s" % (distro, version))) f.addStep( steps.SetPropertyFromCommand( name="get output filename for deb dbgsym", workdir="source", command=["sh", "-c", "ls -dt ../strawberry-dbgsym_*.*deb | head -n 1"], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) f.addStep(UploadPackage("%s/%s" % (distro, version))) f.addStep( shell.ShellCommand( name="delete file", workdir=".", command="rm -f *.deb *.ddeb *.buildinfo *.changes", haltOnFailure=True ) ) return f
def test_class_args(self): # since this step is just a pre-configured WarningCountingShellCommand, # there' not much to test! step = self.setupStep(shell.Compile()) self.assertEqual(step.name, "compile") self.assertTrue(step.haltOnFailure) self.assertTrue(step.flunkOnFailure) self.assertEqual(step.description, ["compiling"]) self.assertEqual(step.descriptionDone, ["compile"]) self.assertEqual(step.command, ["make", "all"])
def MakeMacBuilder(): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("Clementine"))) f.addStep( shell.ShellCommand( name="cmake", workdir="source/bin", env={"PKG_CONFIG_PATH": "/target/lib/pkgconfig"}, command=[ "cmake", "..", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_OSX_ARCHITECTURES=x86_64", "-DBOOST_ROOT=/target", "-DPROTOBUF_LIBRARY=/target/lib/libprotobuf.dylib", "-DPROTOBUF_INCLUDE_DIR=/target/include/", "-DPROTOBUF_PROTOC_EXECUTABLE=/target/bin/protoc", "-DQT_QMAKE_EXECUTABLE=/target/bin/qmake", "-DSPOTIFY=/target/libspotify.framework", "-DGLEW_INCLUDE_DIRS=/target/include", "-DGLEW_LIBRARIES=/target/lib/libGLEW.dylib", "-DLASTFM_INCLUDE_DIRS=/target/include/", "-DLASTFM_LIBRARIES=/target/lib/liblastfm.dylib", "-DFFTW3_DIR=/target", "-DCMAKE_INCLUDE_PATH=/target/include", "-DCMAKE_LIBRARY_PATH=/target/lib", "-DAPPLE_DEVELOPER_ID='Developer ID Application: John Maguire (CZ8XD8GTGZ)'", ], haltOnFailure=True, )) f.addStep( shell.Compile(command=["make"], workdir="source/bin", haltOnFailure=True)) f.addStep( shell.ShellCommand(name="install", command=["make", "install"], haltOnFailure=True, workdir="source/bin")) f.addStep( shell.ShellCommand(name="sign", command=["make", "sign"], haltOnFailure=True, workdir="source/bin")) f.addStep( shell.ShellCommand(name="dmg", command=["make", "dmg"], haltOnFailure=True, workdir="source/bin")) f.addStep(OutputFinder(pattern="bin/clementine-*.dmg")) f.addStep(UploadPackage("mac")) return f
def gen_git_debug_updated_factory(repourl, opts, nocheck=False): """ Make a factory for doing a debug build from git master, but without cleaning first. This build is intended to catch commonly made mistakes quickly. """ f = factory.BuildFactory() f.addStep(source.Git(repourl=repourl, mode="update")) f.addStep(Bootstrap()) opts.append("--disable-documentation") f.addStep(shell.Configure(command = ["sh", "configure", ] + opts)) f.addStep(shell.Compile()) if not nocheck: f.addStep(shell.Test(name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="])) return f
def MakeMXEBuilder(): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("strawberry-mxe", "master"))) f.addStep( shell.Compile( name="compile", workdir="source", command=["make", "-j", MAKE_JOBS], timeout=108000, haltOnFailure=True, ) ) return f
def gen_git_updated_valgrind_factory(repourl, configure_opts=[]): """ Factory for doing build from git master, without cleaning first, and using valgrind to check. This one is much more expensive, so should be run with a higher stable time. """ f = factory.BuildFactory() f.addStep(source.Git(repourl=repourl, mode="update")) f.addStep(Bootstrap()) configure_opts.append("--disable-documentation") f.addStep(shell.Configure(command = ["sh", "configure", "CXXFLAGS=-O0 -g"] + configure_opts)) f.addStep(shell.Compile()) f.addStep(shell.Test(name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain"], workdir='build/xapian-core')) return f
def MakeMacCrossBuilder(): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("Clementine"))) f.addStep( shell.ShellCommand( name="cmake", workdir="source/bin", env={ "PKG_CONFIG_PATH": "/target/lib/pkgconfig", "PATH": "/usr/bin:/bin:/target/bin", }, command=[ "cmake", "..", "-DCMAKE_TOOLCHAIN_FILE=/src/macosx/Toolchain-Darwin.cmake", "-DCMAKE_OSX_ARCHITECTURES=x86_64", "-DQT_HEADERS_DIR=/target/include", "-DQT_LIBRARY_DIR=/target/lib", "-DQT_BINARY_DIR=/target/bin", "-DQT_USE_FRAMEWORKS=ON", "-DQT_MKSPECS_DIR=/target/mkspecs", "-DQT_QMAKE_EXECUTABLE=/target/bin/qmake", "-DCMAKE_CFLAGS='-m64 -I/target/include --stdlib=libc++ -Qunused-arguments -isysroot /Developer/SDKs/MacOSX10.10.sdk'", "-DCMAKE_CXXFLAGS='-m64 -I/target/include --stdlib=libc++ -Qunused-arguments -isysroot /Developer/SDKs/MacOSX10.10.sdk'", "-DCMAKE_EXE_LINKER_FLAGS='-Wl,-syslibroot,/Developer/SDKs/MacOSX10.10.sdk -m64 -L/target/lib -lc++'", "-DSPOTIFY=/target/libspotify.framework", ], haltOnFailure=True, )) f.addStep( shell.Compile(command=["make"], workdir="source/bin", haltOnFailure=True)) f.addStep( shell.ShellCommand(name="install", command=["make", "install"], haltOnFailure=True, workdir="source/bin")) f.addStep( shell.ShellCommand(name="dmg", command=["make", "dmg"], haltOnFailure=True, workdir="source/bin")) f.addStep(OutputFinder(pattern="bin/clementine-*.dmg")) f.addStep(UploadPackage("mac")) return f
def MakeTransifexPotPushBuilder(): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("Clementine"))) f.addStep( shell.ShellCommand(name="cmake", haltOnFailure=True, workdir="source/bin", command=["cmake", ".."])) f.addStep( shell.Compile(haltOnFailure=True, workdir="source/bin", command=["make", "-j4"])) _AddTxSetupForRepo(f, "Clementine") f.addStep( shell.ShellCommand(name="tx_push", workdir="source", haltOnFailure=True, command=["tx", "push", "-s"])) return f
def gen_svn_debug_updated_factory(baseURL, opts): """ Make a factory for doing a debug HEAD build from SVN, but without cleaning first. This build is intended to catch commonly made mistakes quickly. """ f = factory.BuildFactory() f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk', mode="update")) f.addStep(Bootstrap()) f.addStep(shell.Configure(command=[ "sh", "configure", ] + opts)) f.addStep(shell.Compile()) f.addStep( shell.Test(name="check", command=[ "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=" ])) return f
def MakeSpotifyBlobBuilder(): cmake_cmd = [ "cmake", "..", "-DCMAKE_INSTALL_PREFIX=source/bin/installprefix", ] f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("Clementine"))) f.addStep( shell.ShellCommand(name="cmake", workdir="source/bin", haltOnFailure=True, command=cmake_cmd)) f.addStep( shell.Compile(workdir="source/bin", haltOnFailure=True, command=["make", "clementine-spotifyblob", "-j4"])) f.addStep( shell.ShellCommand(name="install", workdir="source/bin/ext/clementine-spotifyblob", haltOnFailure=True, command=["make", "install"])) f.addStep( shell.ShellCommand(name="strip", workdir="source/bin", haltOnFailure=True, command="strip spotify/version*/blob")) f.addStep(OutputFinder(pattern="bin/spotify/version*-*bit")) f.addStep( shell.SetProperty(command=["echo", SPOTIFYBASE], property="spotifybase")) f.addStep( master.MasterShellCommand(name="verify", command=util.Interpolate(""" openssl dgst -sha512 -verify %(prop:spotifybase)s/clementine-spotify-public.pem \ -signature %(prop:spotifybase)s/%(prop:output-filename)s/blob.sha512 \ %(prop:spotifybase)s/%(prop:output-filename)s/blob """))) return f
def testAllSteps(self): # make sure that steps can be created from the factories that they # return for s in ( dummy.Dummy(), dummy.FailingDummy(), dummy.RemoteDummy(), maxq.MaxQ("testdir"), python.BuildEPYDoc(), python.PyFlakes(), python_twisted.HLint(), python_twisted.Trial(testpath=None, tests="tests"), python_twisted.ProcessDocs(), python_twisted.BuildDebs(), python_twisted.RemovePYCs(), shell.ShellCommand(), shell.TreeSize(), shell.Configure(), shell.Compile(), shell.Test(), source.CVS("cvsroot", "module"), source.SVN("svnurl"), source.Darcs("repourl"), source.Git("repourl"), source.Arch("url", "version"), source.Bazaar("url", "version", "archive"), source.Bzr("repourl"), source.Mercurial("repourl"), source.P4("p4base"), source.P4Sync(1234, "p4user", "passwd", "client", mode="copy"), source.Monotone("server", "branch"), transfer.FileUpload("src", "dest"), transfer.FileDownload("src", "dest"), ): try: self._loop(s) except: print "error checking %s" % s raise
def EnableTest(self, test): """Enable Test to be run. test: test to be run. """ if test == "audioproc_unittest": self.AddCommonMakeStep(test, descriptor="_test") self.AddCommonTestRunStep( test, cmd=["../../../out/Debug/audioproc_unittest"], workdir="build/trunk/test/data/audio_processing") # Fixed point run: self.AddCommonGYPStep("src/modules/modules.gyp", gyp_params=["-Dprefer_fixed_point=1"], descriptor="tests_fp") self.AddCommonMakeStep(test, "_test_(FP)") self.AddCommonTestRunStep( test, descriptor="_(FP)", cmd=["../../../out/Debug/audioproc_unittest"], workdir="build/trunk/test/data/audio_processing") elif test == "signal_processing_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "resampler_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "vad_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "rtp_rtcp_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "video_coding_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "test_bwe": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "audio_device_test_api": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "audio_device_test_func": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "audio_coding_module_test": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "video_processing_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "test_fec": self.AddCommonTestSteps(test) elif test == "system_wrappers_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "cng_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "g711_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "g722_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "pcm16b_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "audio_conference_mixer_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "media_file_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "udp_transport_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "webrtc_utility_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "neteq_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "vp8_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "libyuv_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "voice_engine_unittests": self.AddCommonTestRunStep(test, descriptor="_test") elif test == "vie_auto_test": self.addStep( shell.Compile(command=( 'xvfb-run --server-args="-screen 0 ' '800x600x24 -extension Composite" out/Debug/vie_auto_test --automated ' '--gtest_filter="ViEStandardIntegrationTest.*:ViEApiIntegrationTest.*" ' '--capture_test_ensure_resolution_alignment_in_capture_device=false' ), workdir="build/trunk", description=[test, "running..."], descriptionDone=[test, "done..."], name="%s" % test)) elif test == "voe_auto_test": self.addStep( shell.Compile(command=('out/Debug/voe_auto_test --automated ' '--gtest_filter="-*Manual*"'), workdir="build/trunk", description=[test, "running..."], descriptionDone=[test, "done..."], name="%s" % test)) else: print "No supported tests are found..."
def MakeWindowsBuilder(is_debug, is_64, with_qt6): mingw32_name = ("x86_64-w64-mingw32.shared" if is_64 else "i686-w64-mingw32.shared") qt_dir = ("qt6" if with_qt6 else "qt5") mxe_path = "/persistent-data/mingw/mxe/source" target_path = mxe_path + "/usr/" + mingw32_name env = { "PKG_CONFIG_LIBDIR": target_path + "/lib/pkgconfig", "PATH": ":".join([ mxe_path + "/usr/x86_64-pc-linux-gnu/bin", "/usr/local/bin", "/usr/bin", "/bin", ]), } cmake_cmd = [ "cmake", "..", "-DCMAKE_TOOLCHAIN_FILE=/config/dist/" + ("Toolchain-x86_64-w64-mingw32.cmake" if is_64 else "Toolchain-i686-w64-mingw32.cmake"), "-DCMAKE_BUILD_TYPE=" + ("Debug" if is_debug else "Release"), "-DCMAKE_PREFIX_PATH=" + target_path + "/" + qt_dir + "/lib/cmake", "-DARCH=" + ("x86_64" if is_64 else "x86"), "-DENABLE_WIN32_CONSOLE=" + ("ON" if is_debug else "OFF"), "-DQT_MAJOR_VERSION=" + ("6" if with_qt6 else "5"), "-DENABLE_DBUS=OFF", "-DENABLE_LIBGPOD=OFF", "-DENABLE_LIBMTP=OFF", ] strip_cmd = mxe_path + "/usr/bin/" + mingw32_name + "-strip" extra_binary_fileslist = [ "sqlite3.exe", "killproc.exe", "gdb.exe", "gst-launch-1.0.exe", "gst-discoverer-1.0.exe", "libfreetype-6.dll", ("libssl-1_1-x64.dll" if is_64 else "libssl-1_1.dll"), ("libcrypto-1_1-x64.dll" if is_64 else "libcrypto-1_1.dll"), ] extra_binary_files = [] for i in extra_binary_fileslist: extra_binary_files.append(target_path + "/bin/" + i) nsi_files = [ "strawberry.nsi", "Capabilities.nsh", "FileAssociation.nsh", "strawberry.ico", ] imageformats_filelist = [ "qgif.dll", "qjpeg.dll", "qico.dll", ] imageformats_files = [] for i in imageformats_filelist: imageformats_files.append(target_path + "/" + qt_dir + "/plugins/imageformats/" + i) gstreamer_plugins_path = target_path + "/bin/gstreamer-1.0/" gstreamer_plugins_filelist = [ "libgstapp.dll", "libgstcoreelements.dll", "libgstaudioconvert.dll", "libgstaudiofx.dll", "libgstaudiomixer.dll", "libgstaudioparsers.dll", "libgstaudiorate.dll", "libgstaudioresample.dll", "libgstaudiotestsrc.dll", "libgstautodetect.dll", "libgstplayback.dll", "libgstvolume.dll", "libgstspectrum.dll", "libgstequalizer.dll", "libgstreplaygain.dll", "libgsttypefindfunctions.dll", "libgstgio.dll", "libgstdirectsound.dll", "libgstwasapi.dll", "libgstpbtypes.dll", "libgstapetag.dll", "libgsticydemux.dll", "libgstid3demux.dll", "libgsttaglib.dll", "libgsttcp.dll", "libgstudp.dll", "libgstsoup.dll", "libgstcdio.dll", "libgstrtp.dll", "libgstrtsp.dll", "libgstflac.dll", "libgstwavparse.dll", "libgstwavpack.dll", "libgstogg.dll", "libgstvorbis.dll", "libgstopus.dll", "libgstopusparse.dll", "libgstspeex.dll", "libgstlame.dll", "libgstaiff.dll", "libgstfaac.dll", "libgstfaad.dll", "libgstisomp4.dll", "libgstasf.dll", "libgstasfmux.dll", "libgstlibav.dll", ] gstreamer_plugins_files = [] for i in gstreamer_plugins_filelist: gstreamer_plugins_files.append(gstreamer_plugins_path + "/" + i) f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("strawberry", "master"))) f.addStep( shell.ShellCommand( name="run cmake", workdir="source/build", command=cmake_cmd, env=env, haltOnFailure=True ) ) f.addStep( shell.Compile( name="compile", command=[ "make", "-j", MAKE_JOBS ], workdir="source/build", haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="mkdir platforms/sqldrivers/imageformats/styles/gstreamer-plugins/nsisplugins", workdir="source/build", command=[ "mkdir", "-p", "gio-modules" "platforms", "sqldrivers", "imageformats", "styles", "gstreamer-plugins", "nsisplugins", ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy libgiognutls.dll", workdir="source/build/gio-modules", command=[ "cp", target_path + "/lib/gio/modules/libgiognutls.dll", "." ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy qwindows.dll", workdir="source/build/platforms", command=[ "cp", target_path + "/" + qt_dir + "/plugins/platforms/qwindows.dll", "." ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy qsqlite.dll", workdir="source/build/sqldrivers", command=[ "cp", target_path + "/" + qt_dir + "/plugins/sqldrivers/qsqlite.dll", ".", ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy qt imageformats", workdir="source/build/imageformats", command=[ "cp", imageformats_files, "." ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy qt styles", workdir="source/build/styles", command=[ "cp", target_path + "/" + qt_dir + "/plugins/styles/qwindowsvistastyle.dll", "." ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy gstreamer-plugins", workdir="source/build/gstreamer-plugins", command=[ "cp", gstreamer_plugins_files, "." ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy extra binaries", workdir="source/build", command=[ "cp", extra_binary_files, "." ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copydlldeps.sh", workdir="source/build", command=[ mxe_path + "/tools/copydlldeps.sh", "-c", "-d", ".", "-F", ".", "-F", "./platforms", "-F", "./sqldrivers", "-F", "./imageformats", "-F", "./styles", "-F", "./gstreamer-plugins", "-X", target_path + "/apps", "-R", target_path, ], haltOnFailure=True ) ) if not is_debug: f.addStep( shell.ShellCommand( name="run strip", workdir="source/build", command=[ "/config/dist/win-strip.sh", strip_cmd ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy nsi files", workdir="source/dist/windows", command=["cp", nsi_files, "../../build/" ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy COPYING file", workdir="source", command=["cp", "COPYING", "build/" ], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="run makensis", command=[ "makensis", "strawberry.nsi" ], workdir="source/build", haltOnFailure=True ) ) f.addStep( steps.SetPropertyFromCommand( name="get output filename 1", workdir="source", command=[ "sh", "-c", "ls -dt " + "build/StrawberrySetup-*.exe" + " | head -n 1" ], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) f.addStep(UploadPackage("windows")) f.addStep( shell.ShellCommand( name="delete files", workdir="source/build", command="rm -rf *.exe *.dll gio-modules platforms sqldrivers imageformats styles gstreamer-plugins nsisplugins", haltOnFailure=True ) ) return f
def MakeAppImageBuilder(name): git_args = GitArgs("strawberry", "master") git_args["mode"] = "full" git_args["method"] = "fresh" f = factory.BuildFactory() f.addStep(git.Git(**git_args)) f.addStep( shell.ShellCommand( name="clean build", workdir="source", command="rm -rf build/AppDir", haltOnFailure=True ) ) cmake_qt_flag = "-DBUILD_WITH_QT6=ON" if name == "Qt6" else "-DBUILD_WITH_QT5=ON" f.addStep( shell.ShellCommand( name="run cmake", workdir="source/build", command=["cmake", "..", "-DCMAKE_INSTALL_PREFIX=/usr", cmake_qt_flag], haltOnFailure=True ) ) f.addStep( steps.SetPropertyFromCommand( name="get version", workdir="source", command=["git", "describe", "--tags", "--always"], property="output-version", haltOnFailure=True ) ) env_version = { "VERSION": util.Interpolate("%(prop:output-version)s-%(kw:name)s", name=name) } f.addStep( shell.Compile( name="compile", workdir="source/build", command=["make", "-j", MAKE_JOBS], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="run make install", workdir="source/build", command=["make", "install", "DESTDIR=AppDir"], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="rename strawberry-tagreader", workdir="source/build", command=["mv", "AppDir/usr/bin/strawberry-tagreader", "./AppDir/usr/bin/strawberry-tagreader-bin"], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy strawberry-tagreader.sh", workdir="source/build", command=["cp", "/config/dist/strawberry-tagreader.sh", "./AppDir/usr/bin/strawberry-tagreader"], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="cp appdata", workdir="source/build", haltOnFailure=True, command=["cp", "./AppDir/usr/share/metainfo/org.strawberrymusicplayer.strawberry.appdata.xml", "./AppDir/"] ) ) f.addStep( shell.ShellCommand( name="cp icon", workdir="source/build", haltOnFailure=True, command=["cp", "./AppDir/usr/share/icons/hicolor/128x128/apps/strawberry.png", "./AppDir/"] ) ) f.addStep( shell.ShellCommand( name="run appimagetool deploy", workdir="source/build", command=["appimagetool", "-s", "deploy", "AppDir/usr/share/applications/org.strawberrymusicplayer.strawberry.desktop"], env=env_version, haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy gst-plugin-scanner.sh", workdir="source/build", command=["cp", "/config/dist/gst-plugin-scanner.sh", "./AppDir/usr/libexec/gstreamer-1.0/"], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="run appimagetool", workdir="source/build", command=["appimagetool", "AppDir"], env=env_version, haltOnFailure=True ) ) f.addStep( steps.SetPropertyFromCommand( name="get output filename", workdir="source", command=[ "sh", "-c", "ls -dt build/Strawberry*.AppImage | head -n 1" ], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) f.addStep(UploadPackage("appimage")) f.addStep( shell.ShellCommand( name="delete files", workdir="source/build", command="rm -rf AppDir *.AppImage", haltOnFailure=True ) ) return f
def MakePacmanBuilder(distro, version): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("strawberry", "master"))) f.addStep( shell.ShellCommand( name="clean build", workdir="source", command="rm -rf build", haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="run cmake", workdir="source/build", command=["cmake", ".."], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="run maketarball", workdir="source/build", command=["../dist/scripts/maketarball.sh"], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="copy PKGBUILD", workdir="source/build", command=["cp", "../dist/unix/PKGBUILD", "."], haltOnFailure=True ) ) f.addStep( shell.Compile( name="run makepkg", workdir="source/build", command=["makepkg", "-f"], haltOnFailure=True ) ) f.addStep( steps.SetPropertyFromCommand( name="get output filename", workdir="source", command=[ "sh", "-c", "ls -dt build/strawberry-*.pkg.tar.xz | head -n 1" ], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) #f.addStep(UploadPackage(distro)) f.addStep( shell.ShellCommand( name="delete file", workdir="source/build", command="rm -f *.xz", haltOnFailure=True ) ) return f
def __init__ ( self, baseURL, useBuildType=None, arguments=[]): """Factory for CMake out-of-source builds with extra buildbot code. Uses the following builder properties (strings) when generating a build: - generator: CMake generator - arguments: build-specific CMake arguments @cvar baseURL: url of the svn repository @cvar useBuildType: for multi-configuration generators (see CMAKE_BUILD_TYPE) @cvar arguments: extra CMake arguments """ assert baseURL is not None assert type(arguments) == type([]) from buildbot.steps import source, slave, shell from buildbot.process.properties import WithProperties, Property BuildFactory.__init__(self) if useBuildType is None: buildTypeArgument=[] else: buildTypeArgument=["--config", useBuildType] # update svn self.addStep(source.SVN( workdir=self.sourcedir, mode='update', baseURL=baseURL, defaultBranch='trunk', retry=(30,2) )) # recreate build dir self.addStep(slave.RemoveDirectory( dir=self.workdir, haltOnFailure=False, flunkOnFailure=False)) self.addStep(slave.MakeDirectory( dir=self.workdir)) # configure self.addStep(shell.Configure( command=["cmake", "../source", WithProperties("-G%s", 'generator'), arguments, Property('extra_arguments', default=[])], logEnviron=False)) # compile - the install target builds and then copies files to the # production directory (default is subdirectory 'install') and removes # full paths from library dependencies so it works when you copy the # production files elsewhere self.addStep(shell.Compile( command=["cmake", "--build", ".", "--target", "install"] + buildTypeArgument, logEnviron=False)) # package - the package target creates an installer/package/archive # that contains the production files; the target is only available if # CPack and a package generator are available self.addStep(shell.SetProperty( haltOnFailure = True, flunkOnFailure = True, extract_fn=lambda rc, stdout, stderr: {"WITH_CPACK": stdout.find("WITH_CPACK:BOOL=ON") != -1}, command=["cmake", "-N", "-LA"], logEnviron=False)) self.addStep(shell.ShellCommand( name = "Package", description = ["packaging"], descriptionDone = ["package"], haltOnFailure = False, flunkOnFailure = False, doStepIf=lambda step: step.build.getProperty("WITH_CPACK"), command=["cmake", "--build", ".", "--target", "package"] + buildTypeArgument, logEnviron=False))
def MakeRPMBuilder(distro, version): f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("strawberry", "master"))) f.addStep( shell.ShellCommand( name="run cmake", workdir="source/build", command=["cmake", ".."], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="run maketarball", workdir="source/build", command=["../dist/scripts/maketarball.sh"], haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="move tarball to SOURCES", workdir="source/build", command="mv strawberry-*.tar.xz ~/rpmbuild/SOURCES", haltOnFailure=True ) ) f.addStep( shell.Compile( name="run rpmbuild", workdir="source/build", command=["rpmbuild", "-ba", "../dist/unix/strawberry.spec"], haltOnFailure=True ) ) if not version in ['tumbleweed']: # Upload RPM package. f.addStep( steps.SetPropertyFromCommand( name="get output rpm filename", workdir="source", command=[ "sh", "-c", "ls -dt ~/rpmbuild/RPMS/*/strawberry-*.rpm | grep -v debuginfo | grep -v debugsource | head -n 1" ], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) f.addStep(UploadPackage(distro + "/" + version)) # Upload debugsource package. f.addStep( steps.SetPropertyFromCommand( name="get output debugsource rpm filename", workdir="source", command=["sh", "-c", "ls -dt ~/rpmbuild/RPMS/*/strawberry-debugsource-*.rpm | head -n 1"], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) f.addStep(UploadPackage(distro + "/" + version)) # Upload debuginfo package. f.addStep( steps.SetPropertyFromCommand( name="get output debuginfo rpm filename", workdir="source", command=["sh", "-c", "ls -dt ~/rpmbuild/RPMS/*/strawberry-debuginfo-*.rpm | head -n 1"], property="output-filepath", haltOnFailure=True ) ) f.addStep(steps.SetProperties(properties=get_base_filename)) f.addStep(UploadPackage(distro + "/" + version)) f.addStep( shell.ShellCommand( name="delete files", workdir="source", command="rm -f ~/rpmbuild/SOURCES/*.xz ~/rpmbuild/RPMS/*/*.rpm", haltOnFailure=True ) ) f.addStep( shell.ShellCommand( name="clean rpmbuild", workdir="source/build", command="find ~/rpmbuild/ -type f -delete" ) ) return f
def MakeWindowsBuilder(is_debug, is_portable): env = { "PKG_CONFIG_LIBDIR": "/target/lib/pkgconfig", "PATH": ":".join([ "/mingw/bin", "/usr/local/bin", "/usr/bin", "/bin", ]), } cmake_cmd = [ "cmake", "..", "-DCMAKE_TOOLCHAIN_FILE=/src/Toolchain-mingw32.cmake", "-DCMAKE_BUILD_TYPE=" + ("Debug" if is_debug else "Release"), "-DENABLE_WIN32_CONSOLE=" + ("ON" if is_debug else "OFF"), "-DQT_HEADERS_DIR=/target/include", "-DQT_LIBRARY_DIR=/target/bin", "-DPROTOBUF_PROTOC_EXECUTABLE=/usr/bin/protoc", ] executable_files = [ "clementine.exe", "clementine-tagreader.exe", "clementine-spotifyblob.exe", ] strip_command = "i686-w64-mingw32-strip" if is_portable: nsi_filename = "clementine-portable.nsi" output_glob = "Clementine-PortableSetup*.exe" upload_dest = "portable" else: nsi_filename = "clementine.nsi" output_glob = "ClementineSetup*.exe" upload_dest = ("debug" if is_debug else "release") f = factory.BuildFactory() f.addStep(git.Git(**GitArgs("Clementine"))) f.addStep( shell.ShellCommand(name="cmake", workdir="source/bin", env=env, haltOnFailure=True, command=cmake_cmd)) f.addStep( shell.ShellCommand(name="link dependencies", workdir="source/dist/windows", haltOnFailure=True, command="ln -svf /src/windows/clementine-deps/* .")) f.addStep( shell.ShellCommand(name="link output", workdir="source/dist/windows", haltOnFailure=True, command=["ln", "-svf"] + ["../../bin/" + x for x in executable_files] + ["."])) f.addStep( shell.Compile(command=["make", "-j4"], workdir="source/bin", haltOnFailure=True)) f.addStep( shell.ShellCommand(name="strip", workdir="source/bin", haltOnFailure=True, env=env, command=[strip_command] + executable_files)) f.addStep( shell.ShellCommand(name="makensis", command=["makensis", nsi_filename], workdir="source/dist/windows", haltOnFailure=True)) f.addStep(OutputFinder(pattern="dist/windows/" + output_glob)) f.addStep(UploadPackage("win32/" + upload_dest)) return f