Exemple #1
0
 def command_install_rapidxml(self):
     os.chdir(self.build_dir)
     # We use RapidXML for some doc building tools.
     if not os.path.exists(os.path.join(self.build_dir, 'rapidxml.zip')):
         utils.check_call(
             "wget", "-O", "rapidxml.zip",
             "http://sourceforge.net/projects/rapidxml/files/latest/download"
         )
         utils.check_call("unzip", "-n", "-d", "rapidxml", "rapidxml.zip")
Exemple #2
0
 def command_install_asciidoctor(self):
     os.chdir(self.build_dir)
     utils.check_call("gem", "install", "asciidoctor", "--version", "1.5.8")
     utils.check_call("asciidoctor", "--version")
     utils.check_call("gem", "install", "pygments.rb", "--version", "1.2.1")
     utils.check_call("pip", "install", "--user", "Pygments==2.1")
     utils.check_call(
         "pip", "install", "--user",
         "https://github.com/bfgroup/jam_pygments/archive/master.zip")
     os.chdir(self.root_dir)
Exemple #3
0
 def command_before_cache(self):
     script_common.command_before_cache(self)
     os.chdir(self.boost_root)
     utils.check_call("git", "clean", "-dfqx")
     utils.check_call("git", "submodule", "--quiet", "foreach", "git",
                      "clean", "-dfqx")
     utils.check_call("git", "status", "-bs")
     utils.check_call("git", "submodule", "foreach", "git", "status", "-bs")
 def command_build(self):
     # Check the library for 'fitness'. This just means
     # running the built-in tests that check for library requirements,
     # etc.
     
     # Set up where we will "install" built tools.
     utils.makedirs(os.path.join(self.build_dir,'dist','bin'))
     os.environ['PATH'] = os.path.join(self.build_dir,'dist','bin')+':'+os.environ['PATH']
     os.environ['BOOST_BUILD_PATH'] = self.build_dir
     
     # Bootstrap Boost Build engine.
     os.chdir(os.path.join(self.root_dir,"tools","build"))
     utils.check_call("./bootstrap.sh")
     shutil.copy2("b2", os.path.join(self.build_dir,"dist","bin","b2"))
     utils.check_call("git","clean","-dfqx")
     
     # Run tests for library requirements checking.
     os.chdir(os.path.join(self.root_dir,"status"))
     self.b2("-d0","--check-libs-only")
    def command_build(self):
        # Check the library for 'fitness'. This just means
        # running the built-in tests that check for library requirements,
        # etc.

        # Set up where we will "install" built tools.
        utils.makedirs(os.path.join(self.build_dir, 'dist', 'bin'))
        os.environ['PATH'] = os.path.join(self.build_dir, 'dist',
                                          'bin') + ':' + os.environ['PATH']
        os.environ['BOOST_BUILD_PATH'] = self.build_dir

        # Bootstrap Boost Build engine.
        os.chdir(os.path.join(self.root_dir, "tools", "build"))
        utils.check_call("./bootstrap.sh")
        shutil.copy2("b2", os.path.join(self.build_dir, "dist", "bin", "b2"))
        utils.check_call("git", "clean", "-dfqx")

        # Run tests for library requirements checking.
        os.chdir(os.path.join(self.root_dir, "status"))
        self.b2("-d0", "--check-libs-only")
    def command_build(self):
        super(script, self).command_build()

        # Build b2

        os.chdir(self.root_dir)

        if sys.platform == "win32":
            utils.check_call('cmd.exe', '/C',
                             os.path.join(self.root_dir, "bootstrap.bat"))
        else:
            utils.check_call("./bootstrap.sh")

        # Build and install Boost

        cmd = [
            './b2',
            '-j%s' % (self.jobs), '--prefix=' + os.path.expanduser('~/.local'),
            'install'
        ]

        if self.toolset:
            cmd.append('toolset=' + self.toolset)

        if self.cxxstd:
            cmd.append('cxxstd=' + self.cxxstd)

        utils.check_call(*cmd)
    def command_build(self):

        super(script, self).command_build()

        os.chdir(self.root_dir)

        if self.commit_message:

            m = re.match(r'Update (\w+) from', self.commit_message)

            if m:

                target = 'libs/' + m.group(1) + '/test'

                if not os.path.exists(target):

                    target = 'tools/' + m.group(1) + '/test'

                if os.path.exists(target):

                    # Build b2

                    if sys.platform == 'win32':

                        utils.check_call(
                            'cmd.exe', '/C',
                            os.path.join(self.root_dir, "bootstrap.bat"))

                    else:

                        utils.check_call("./bootstrap.sh")

                    os.environ['PATH'] = os.pathsep.join(
                        [self.root_dir, os.environ['PATH']])

                    # Headers

                    utils.check_call('b2', '-d0', 'headers')

                    # Test updated library

                    cmd = ['b2', '-j%s' % (self.jobs), target]

                    if self.toolset:
                        cmd.append('toolset=' + self.toolset)

                    if self.cxxstd:
                        cmd.append('cxxstd=' + self.cxxstd)

                    utils.check_call(*cmd)
Exemple #8
0
 def command_install_docbook(self):
     os.chdir(self.build_dir)
     # Local DocBook schema and stylesheets.
     if not os.path.exists(os.path.join(self.build_dir, 'docbook-xml.zip')):
         utils.check_call(
             "wget", "-O", "docbook-xml.zip",
             "http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip")
         utils.check_call("unzip", "-n", "-d", "docbook-xml",
                          "docbook-xml.zip")
     if not os.path.exists(os.path.join(self.build_dir, 'docbook-xsl.zip')):
         utils.check_call(
             "wget", "-O", "docbook-xsl.zip",
             "https://sourceforge.net/projects/docbook/files/docbook-xsl/1.79.1/docbook-xsl-1.79.1.zip/download"
         )
         utils.check_call("unzip", "-n", "-d", "docbook-xsl",
                          "docbook-xsl.zip")
    def command_build(self):

        super( script, self ).command_build()

        os.chdir( self.root_dir )

        if self.commit_message:

            m = re.match( r'Update (\w+) from', self.commit_message )

            if m:

                target = 'libs/' + m.group(1) + '/test'

                if not os.path.exists( target ):

                    target = 'tools/' + m.group(1) + '/test'

                if os.path.exists( target ):

                    # Build b2

                    if sys.platform == 'win32':

                        utils.check_call('cmd.exe', '/C', os.path.join(self.root_dir, "bootstrap.bat"))

                    else:

                        utils.check_call("./bootstrap.sh")

                    os.environ['PATH'] = os.pathsep.join([self.root_dir,os.environ['PATH']])

                    # Headers

                    utils.check_call( 'b2', '-d0', 'headers' )

                    # Test updated library

                    cmd = [ 'b2', '-j%s' % (self.jobs), target ]

                    if self.toolset:
                        cmd.append( 'toolset=' + self.toolset )

                    if self.cxxstd:
                        cmd.append( 'cxxstd=' + self.cxxstd )

                    utils.check_call( *cmd )
Exemple #10
0
 def command_install_sphinx(self):
     os.chdir(self.build_dir)
     # Need Sphinx for building some docs (ie boost python).
     utils.make_file(os.path.join(self.build_dir, 'constraints.txt'),
                     'Sphinx==1.5.6')
     utils.check_call("pip", "install", "--user", "Sphinx==1.5.6")
     utils.check_call("pip", "install", "--user", "sphinx-boost==0.0.3")
     utils.check_call(
         "pip", "install", "--user", "-c",
         os.path.join(self.build_dir, 'constraints.txt'),
         "git+https://github.com/rtfd/recommonmark@50be4978d7d91d0b8a69643c63450c8cd92d1212"
     )
     os.chdir(self.root_dir)
    def command_build(self):
        super(script,self).command_build()

        # Build b2

        os.chdir(self.root_dir)

        if sys.platform == "win32":
            utils.check_call('cmd.exe', '/C', os.path.join(self.root_dir, "bootstrap.bat"))
        else:
            utils.check_call("./bootstrap.sh")

        # Build and install Boost

        cmd = [ './b2', '-j%s' % (self.jobs), '--prefix=' + os.path.expanduser( '~/.local' ), 'install' ]

        if self.toolset:
            cmd.append( 'toolset=' + self.toolset )

        if self.cxxstd:
            cmd.append( 'cxxstd=' + self.cxxstd )

        utils.check_call( *cmd )
Exemple #12
0
    def command_before_build(self):
        script_common.command_before_build(self)

        # Clone boost super-project.
        if self.repo != 'boost':
            utils.git_clone('boost',
                            self.branch,
                            cwd=self.ci.work_dir,
                            no_submodules=True)
            utils.check_call("git", "submodule", "update", "--quiet", "--init",
                             "tools/build")
            utils.check_call("git", "submodule", "update", "--quiet", "--init",
                             "tools/boostdep")
            # The global jamfiles require config as they trigger build config checks.
            utils.check_call("git", "submodule", "update", "--quiet", "--init",
                             "libs/config")

        # Find the path for the submodule of the repo we are testing.
        if self.repo != 'boost':
            self.repo_dir = os.path.join(self.boost_root, self.repo_path)

        if self.repo != 'boost':
            utils.check_call("git", "submodule", "update", "--quiet", "--init",
                             self.repo_path)
            if self.commit:
                # Checkout the library commit we are testing.
                os.chdir(self.repo_dir)
                if not self.pull_request:
                    utils.check_call("git", "checkout", "-qf", self.commit)
                else:
                    utils.check_call(
                        "git", "fetch", "origin", "-q",
                        "+refs/pull/{}/merge".format(self.pull_request))
                    utils.check_call("git", "checkout", "-qf", "FETCH_HEAD")

        # Fetch the dependencies for the library we are testing.
        if self.repo != 'boost':
            os.chdir(self.boost_root)
            utils.check_call(sys.executable,
                             'tools/boostdep/depinst/depinst.py', self.repo)

        # Create config file for toolset.
        if not isinstance(self.ci, ci_cli):
            cxxflags = None
            if self.cxxflags:
                cxxflags = self.cxxflags.split()
                cxxflags = " <cxxflags>".join(cxxflags)
            utils.make_file(
                os.path.join(self.boost_root, 'project-config.jam'), """
using %(toolset)s : %(version)s : %(command)s : %(cxxflags)s ;
using python : %(pyversion)s : "%(python)s" ;
""" % {
                    'toolset':
                    toolset_info[self.toolset]['toolset'],
                    'version':
                    toolset_info[self.toolset]['version'],
                    'command':
                    toolset_info[self.toolset]['command'],
                    'cxxflags':
                    "<cxxflags>" + cxxflags if cxxflags else "",
                    'pyversion':
                    "%s.%s" % (sys.version_info[0], sys.version_info[1]),
                    'python':
                    sys.executable.replace("\\", "\\\\")
                })
Exemple #13
0
 def command_install_docutils(self):
     os.chdir(self.build_dir)
     # Need docutils for building some docs.
     utils.check_call("pip", "install", "--user", "docutils==0.12")
     os.chdir(self.root_dir)
Exemple #14
0
    def command_build(self):
        super(script, self).command_build()

        # if --release, switch to release layout

        if self.release:

            os.chdir(self.build_dir)
            utils.check_call(
                'wget',
                'https://raw.githubusercontent.com/boostorg/release-tools/develop/MakeBoostDistro.py'
            )
            utils.check_call('chmod', '+x', 'MakeBoostDistro.py')

            os.chdir(self.root_dir)
            utils.check_call(
                'python', os.path.join(self.build_dir, 'MakeBoostDistro.py'),
                self.root_dir, 'release')

            self.root_dir = os.path.join(self.root_dir, 'release')

        # Build b2

        os.chdir(self.root_dir)
        if sys.platform == "win32":
            utils.check_call('cmd.exe', '/C',
                             os.path.join(self.root_dir, "bootstrap.bat"))
        else:
            utils.check_call("./bootstrap.sh")
        os.environ['PATH'] = os.pathsep.join(
            [self.root_dir, os.environ['PATH']])

        if self.target == 'none':

            # Simple integrated status tests check. Only verifies that
            # we will not get build system errors from things like missing
            # test files.

            utils.check_call("b2", "headers")
            os.chdir(os.path.join(self.root_dir, "status"))
            utils.check_call("b2", "-n", "-d0")

        else:

            # Build specified target in status/Jamfile

            os.chdir(os.path.join(self.root_dir, "status"))

            cmd = ['b2', '-j%s' % (self.jobs), self.target]

            if self.toolset:
                cmd.append('toolset=' + self.toolset)

            if self.cxxstd:
                cmd.append('cxxstd=' + self.cxxstd)

            utils.check_call(*cmd)
Exemple #15
0
 def command_info(self):
     super(script, self).command_info()
     utils.log("ci_boost_release: eol='%s', mode='%s'" %
               (self.eol, self.mode))
     utils.check_call('xsltproc', '--version')
Exemple #16
0
    def upload_archives(self, *filenames):
        if not self.sf_releases_key and not self.bintray_key:
            utils.log(
                "ci_boost_release: upload_archives: no sf_releases_key and no bintray_key"
            )
            return
        curl_cfg_data = []
        curl_cfg = os.path.join(self.build_dir, 'curl.cfg')
        if self.sf_releases_key:
            curl_cfg_data += [
                'data = "api_key=%s"' % (self.sf_releases_key),
            ]
        if self.bintray_key:
            curl_cfg_data += [
                'user = "******"' % ('boostsys', self.bintray_key),
            ]
        utils.make_file(curl_cfg, *curl_cfg_data)
        # Create version ahead of uploading to avoid invalid version errors.
        if self.bintray_key:
            utils.make_file(
                os.path.join(self.build_dir, 'bintray_release.json'),
                '{ "name" : "%s", "desc" : "" }' % (self.commit))
            utils.check_call(
                'curl',
                '-K',
                curl_cfg,
                '-T',
                os.path.join(self.build_dir, 'bintray_release.json'),
                'https://api.bintray.com/packages/boostorg/%s/snapshot/versions'
                % (
                    # repo
                    self.branch))
        # Setup before we can upload to the release services.
        for filename in filenames:
            if self.sf_releases_key:
                pass
            if self.bintray_key:
                # You'd think that we would need to specify api.bintray.com/content/boostorg/*/snapshot/
                # as the root path to delete the existing archive. But Bintray has an API
                # (where A == asymetric), and hence nothing is intuitive.
                utils.check_call(
                    'curl',
                    '-K',
                    curl_cfg,
                    '-X',
                    'DELETE',
                    'https://api.bintray.com/content/boostorg/%s/%s' % (
                        # repo, file
                        self.branch,
                        filename))
                utils.check_call(
                    'curl',
                    '-K',
                    curl_cfg,
                    '-X',
                    'DELETE',
                    'https://api.bintray.com/content/boostorg/%s/%s.asc' % (
                        # repo, file
                        self.branch,
                        filename))

        # # The uploads to the release services happen in parallel to minimize clock time.
        # uploads = []

        for filename in filenames:
            if self.sf_releases_key:
                # uploads.append(parallel_call(
                utils.check_call(
                    'curl', 'sshpass', '-e', 'rsync', '-e', 'ssh', filename,
                    '%[email protected]:/home/frs/project/boost/boost/snapshots/%s/'
                    % (os.environ['SSHUSER'], self.branch))
            if self.bintray_key:
                # You'd think that we would need to specify api.bintray.com/content/boostorg/*/snapshot/
                # as the root path to delete the existing archive. But Bintray has an API
                # (where A == asymetric), and hence nothing is intuitive.
                # uploads.append(parallel_call('curl',
                utils.check_call(
                    'curl',
                    '-K',
                    curl_cfg,
                    '-T',
                    filename,
                    'https://api.bintray.com/content/boostorg/%s/snapshot/%s/%s?publish=1&override=1'
                    % (
                        # repo, version, file
                        self.branch,
                        self.commit,
                        filename))

        # for upload in uploads:
        #     upload.join()

        # Configuration after uploads, like setting uploaded file properties.
        for filename in filenames:
            if self.sf_releases_key:
                pass
            if self.bintray_key:
                pass
Exemple #17
0
    def command_build(self):
        super(script, self).command_build()
        # Build a packaged release. This involves building a fresh set
        # of docs and selectively packging parts of the tree. We try and
        # avoid creating extra files in the base tree to avoid including
        # extra stuff in the archives. Which means that we reset the git
        # tree state to cleanup after building.

        # Set up where we will "install" built tools.
        utils.makedirs(os.path.join(self.build_dir, 'dist', 'bin'))
        os.environ['PATH'] = os.path.join(self.build_dir, 'dist',
                                          'bin') + ':' + os.environ['PATH']
        os.environ['BOOST_BUILD_PATH'] = self.build_dir

        # Bootstrap Boost Build engine.
        os.chdir(os.path.join(self.root_dir, "tools", "build"))
        utils.check_call("./bootstrap.sh")
        shutil.copy2("b2", os.path.join(self.build_dir, "dist", "bin", "b2"))
        utils.check_call("git", "clean", "-dfqx")

        # Generate include dir structure.
        os.chdir(self.root_dir)
        self.b2("-q", "-d0", "headers")

        # Determine if we generate index on the docs. Which we limit as they
        # horrendous amounts of time to generate.
        enable_auto_index = self.ci.time_limit > 60 and self.branch == "master" and self.mode == "build"

        # Build various tools:
        # * Quickbook documentation tool.
        # * auto-index documentation tool.
        self.b2('-q', '-d0', '--build-dir=%s' % (self.build_dir),
                '--distdir=%s' % (os.path.join(self.build_dir, 'dist')),
                'tools/quickbook',
                'tools/auto_index/build' if enable_auto_index else '')

        # Clean up build byproducts.
        os.chdir(os.path.join(self.root_dir, "tools", "quickbook"))
        utils.check_call("git", "clean", "-dfqx")
        os.chdir(os.path.join(self.root_dir, "tools", "auto_index"))
        utils.check_call("git", "clean", "-dfqx")

        # Set up build config.
        utils.make_file(
            os.path.join(self.build_dir,
                         'site-config.jam'), 'using quickbook : "%s" ;' %
            (os.path.join(self.build_dir, 'dist', 'bin', 'quickbook')),
            'using auto-index : "%s" ;' %
            (os.path.join(self.build_dir, 'dist', 'bin', 'auto_index'))
            if enable_auto_index else '',
            'using docutils : /usr/share/docutils ;', 'using doxygen ;',
            'using boostbook : "%s" : "%s" ;' %
            (os.path.join(self.build_dir, 'docbook-xsl', 'docbook-xsl-1.79.1'),
             os.path.join(self.build_dir, 'docbook-xml')),
            'using asciidoctor ;', 'using saxonhe ;')

        # Build the full docs, and all the submodule docs.
        os.chdir(os.path.join(self.root_dir, "doc"))

        if self.mode == "check":
            self.b2('-q', '-d0', '-n', '--build-dir=%s' % (self.build_dir),
                    '--distdir=%s' % (os.path.join(self.build_dir, 'dist')),
                    '--release-build', 'auto-index=off')
            return

        doc_build = self.b2(
            '-q',  # '-d0',
            '--build-dir=%s' % (self.build_dir),
            '--distdir=%s' % (os.path.join(self.build_dir, 'dist')),
            '--release-build',
            '--exclude-libraries=beast',
            'auto-index=on' if enable_auto_index else 'auto-index=off',
            '--enable-index' if enable_auto_index else '',
            parallel=True)
        while doc_build.is_alive():
            time.sleep(3 * 60)
            print("--- Building ---")
            utils.mem_info()
        doc_build.join()

        try:
            self.b2(
                '-q',  # '-d0',
                '--build-dir=%s' % (self.build_dir),
                '--distdir=%s' % (os.path.join(self.build_dir, 'dist')),
                '../libs/beast/doc//boostrelease')
        except:
            pass

        # Download some generated files.
        os.chdir(self.root_dir)
        utils.check_call(
            'wget', '-O', 'libs/libraries.htm',
            'http://www.boost.org/doc/generate.php?page=libs/libraries.htm&version=%s'
            % (self.boost_version))
        utils.check_call(
            'wget', '-O', 'index.html',
            'http://www.boost.org/doc/generate.php?page=index.html&version=%s'
            % (self.boost_version))

        # Clean up some extra build files that creep in. These are
        # from stuff that doesn't obey the build-dir options.
        utils.rmtree(
            os.path.join(self.root_dir, "libs", "config", "checks",
                         "architecture", "bin"))
        utils.check_call("git", "submodule", "--quiet", "foreach", "rm", "-fr",
                         "doc/bin")

        # Make the real distribution tree from the base tree.
        os.chdir(os.path.join(self.build_dir))
        utils.check_call(
            'wget',
            'https://raw.githubusercontent.com/boostorg/release-tools/develop/MakeBoostDistro.py'
        )
        utils.check_call('chmod', '+x', 'MakeBoostDistro.py')
        os.chdir(os.path.dirname(self.root_dir))
        utils.check_call('python',
                         os.path.join(self.build_dir, 'MakeBoostDistro.py'),
                         self.root_dir, self.boost_release_name)

        packages = []
        archive_files = []

        # Create packages for LF style content.
        if self.eol == 'LF':
            os.chdir(os.path.dirname(self.root_dir))
            os.environ['GZIP'] = "-9"
            os.environ['BZIP2'] = "-9"
            archive_files.append('%s%s.tar.gz' %
                                 (self.boost_release_name, self.archive_tag))
            packages.append(
                parallel_call(
                    'tar', '-zcf', '%s%s.tar.gz' %
                    (self.boost_release_name, self.archive_tag),
                    self.boost_release_name))
            archive_files.append('%s%s.tar.bz2' %
                                 (self.boost_release_name, self.archive_tag))
            packages.append(
                parallel_call(
                    'tar', '-jcf', '%s%s.tar.bz2' %
                    (self.boost_release_name, self.archive_tag),
                    self.boost_release_name))

        # Create packages for CRLF style content.
        if self.eol == 'CRLF':
            os.chdir(os.path.dirname(self.root_dir))
            archive_files.append('%s%s.zip' %
                                 (self.boost_release_name, self.archive_tag))
            packages.append(
                parallel_call(
                    'zip', '-qr', '-9',
                    '%s%s.zip' % (self.boost_release_name, self.archive_tag),
                    self.boost_release_name))
            archive_files.append('%s%s.7z' %
                                 (self.boost_release_name, self.archive_tag))
            with open('/dev/null') as dev_null:
                utils.check_call('7z',
                                 'a',
                                 '-bd',
                                 '-m0=lzma',
                                 '-mx=9',
                                 '-mfb=64',
                                 '-md=32m',
                                 '-ms=on',
                                 '%s%s.7z' %
                                 (self.boost_release_name, self.archive_tag),
                                 self.boost_release_name,
                                 stdout=dev_null)

        for package in packages:
            package.join()

        # Create archive info data files.
        for archive_file in archive_files:
            sha256_sum = hashlib.sha256(open(archive_file).read()).hexdigest()
            utils.make_file("%s.json" % (archive_file), "{",
                            '"sha256":"%s",' % (sha256_sum),
                            '"file":"%s",' % (archive_file),
                            '"branch":"%s",' % (self.branch),
                            '"commit":"%s"' % (self.commit), "}")

        # List the results for debugging.
        utils.check_call('ls', '-la')
Exemple #18
0
 def command_before_build(self):
     super(script, self).command_before_build()
     # Fetch the rest of the Boost submodules in the appropriate
     # EOL style.
     if self.eol == 'LF':
         utils.check_call("git", "config", "--global", "core.eol", "lf")
         utils.check_call("git", "config", "--global", "core.autocrlf",
                          "input")
     else:
         utils.check_call("git", "config", "--global", "core.eol", "crlf")
         utils.check_call("git", "config", "--global", "core.autocrlf",
                          "true")
     utils.check_call("git", "rm", "--quiet", "--cache", "-r", ".")
     utils.check_call("git", "reset", "--quiet", "--hard", "HEAD")
     utils.check_call("git", "submodule", "--quiet", "foreach",
                      "--recursive", "git", "rm", "--quiet", "--cache",
                      "-r", ".")
     utils.check_call("git", "submodule", "--quiet", "foreach",
                      "--recursive", "git", "reset", "--quiet", "--hard",
                      "HEAD")
Exemple #19
0
    def command_build(self):
        super(script, self).command_build()

        # if --release, switch to release layout

        if self.release:

            os.chdir(self.build_dir)
            utils.check_call(
                'wget',
                'https://raw.githubusercontent.com/boostorg/release-tools/develop/MakeBoostDistro.py'
            )
            utils.check_call('chmod', '+x', 'MakeBoostDistro.py')

            os.chdir(self.root_dir)
            utils.check_call(
                'python', os.path.join(self.build_dir, 'MakeBoostDistro.py'),
                self.root_dir, 'release')

            self.root_dir = os.path.join(self.root_dir, 'release')

        # Build b2

        os.chdir(self.root_dir)

        if sys.platform == "win32":
            utils.check_call('cmd.exe', '/C',
                             os.path.join(self.root_dir, "bootstrap.bat"))
        else:
            utils.check_call("./bootstrap.sh")

        # Build (stage) Boost

        cmd = ['./b2', '-j%s' % (self.jobs)]

        if self.toolset:
            cmd.append('toolset=' + self.toolset)

        if self.cxxstd:
            cmd.append('cxxstd=' + self.cxxstd)

        utils.check_call(*cmd)

        # Install Boost

        cmd.append('--prefix=' + os.path.expanduser('~/.local'))
        cmd.append('install')

        utils.check_call(*cmd)
Exemple #20
0
    def command_build(self):
        script_common.command_build(self)

        # Set up tools.
        utils.makedirs(os.path.join(self.build_dir, 'dist', 'bin'))
        if not isinstance(self.ci,
                          ci_cli) and toolset_info[self.toolset]['command']:
            os.environ['PATH'] = os.pathsep.join([
                os.path.dirname(toolset_info[self.toolset]['command']),
                os.path.join(self.build_dir, 'dist', 'bin'), os.environ['PATH']
            ])
        else:
            os.environ['PATH'] = os.pathsep.join([
                os.path.join(self.build_dir, 'dist', 'bin'), os.environ['PATH']
            ])
        os.environ['BOOST_BUILD_PATH'] = self.build_dir

        # Bootstrap Boost Build engine.
        os.chdir(os.path.join(self.boost_root, "tools", "build"))
        if sys.platform == 'win32':
            utils.check_call(".\\bootstrap.bat")
            shutil.copy2("b2.exe",
                         os.path.join(self.build_dir, "dist", "bin", "b2.exe"))
        else:
            utils.check_call("./bootstrap.sh")
            shutil.copy2("b2", os.path.join(self.build_dir, "dist", "bin",
                                            "b2"))
        utils.check_call("git", "clean", "-dfqx")

        # Run the limited tests.
        if self.repo != 'boost':
            print("--- Testing %s ---" % (self.repo_path))
            os.chdir(os.path.join(self.boost_root, 'status'))
            to_test = self.repo_path.split("/")
            del to_test[0]
            toolset_to_test = ""
            if self.toolset:
                if not isinstance(self.ci, ci_cli):
                    toolset_to_test = toolset_info[self.toolset]['toolset']
                else:
                    toolset_to_test = self.toolset
            self.b2(
                '-d1', '-p0', '--include-tests=%s' % ("/".join(to_test)),
                'preserve-test-targets=off', '--dump-tests',
                '--build-dir=%s' % (self.build_dir), '--out-xml=%s' %
                (os.path.join(self.build_dir, 'regression.xml')),
                '' if not toolset_to_test else 'toolset=%s' %
                (toolset_to_test),
                '' if not self.address_model else 'address-model=%s' %
                (self.address_model), 'variant=%s' % (self.variant),
                '--test-type=%s' % (self.target), '--verbose-test')

            # Generate a readable test report.
            import build_log
            log_main = build_log.Main([
                '--output=console',
                os.path.join(self.build_dir, 'regression.xml')
            ])
            # And exit with an error if the report contains failures.
            # This lets the CI notice the error and report a failed build.
            # And hence trigger the failure machinery, like sending emails.
            if log_main.failed:
                self.ci.finish(-1)
    def command_build(self):
        super(script,self).command_build()

        # Build b2

        os.chdir(self.root_dir)
        if sys.platform == "win32":
            utils.check_call('cmd.exe', '/C', os.path.join(self.root_dir, "bootstrap.bat"))
        else:
            utils.check_call("./bootstrap.sh")
        os.environ['PATH'] = os.pathsep.join([self.root_dir,os.environ['PATH']])

        if self.target == 'none':

            # Simple integrated status tests check. Only verifies that
            # we will not get build system errors from things like missing
            # test files.

            utils.check_call("b2","headers")
            utils.check_call("b2","-n")
            os.chdir(os.path.join(self.root_dir,"status"))
            utils.check_call("b2","-n","-d0")

        else:

            # Build specified target in status/Jamfile

            os.chdir(os.path.join(self.root_dir,"status"))

            cmd = [ 'b2', '-j%s' % (self.jobs), self.target ]

            if self.toolset:
                cmd.append( 'toolset=' + self.toolset )

            if self.cxxstd:
                cmd.append( 'cxxstd=' + self.cxxstd )

            utils.check_call( *cmd )
Exemple #22
0
    def command_build(self):
        super(script, self).command_build()

        # Build b2

        os.chdir(self.root_dir)
        if sys.platform == "win32":
            utils.check_call('cmd.exe', '/C',
                             os.path.join(self.root_dir, "bootstrap.bat"))
        else:
            utils.check_call("./bootstrap.sh")
        os.environ['PATH'] = os.pathsep.join(
            [self.root_dir, os.environ['PATH']])

        if self.target == 'none':

            # Simple integrated status tests check. Only verifies that
            # we will not get build system errors from things like missing
            # test files.

            utils.check_call("b2", "headers")
            utils.check_call("b2", "-n")
            os.chdir(os.path.join(self.root_dir, "status"))
            utils.check_call("b2", "-n", "-d0")

        else:

            # Build specified target in status/Jamfile

            os.chdir(os.path.join(self.root_dir, "status"))

            cmd = ['b2', '-j%s' % (self.jobs), self.target]

            if self.toolset:
                cmd.append('toolset=' + self.toolset)

            if self.cxxstd:
                cmd.append('cxxstd=' + self.cxxstd)

            utils.check_call(*cmd)
 def command_info(self):
     super(script, self).command_info()
     utils.check_call('xsltproc', '--version')