Rebase from hash-predef source.

This commit is contained in:
Rene Rivera
2018-08-25 23:36:20 -05:00
parent 560ff5298e
commit 759400b413
7 changed files with 133 additions and 181 deletions

5
.gitignore vendored
View File

@ -1,3 +1,4 @@
/bin bin
/boost-build.jam boost-build.jam
project-config.jam project-config.jam
*.pyc

View File

@ -2,7 +2,7 @@
# subject to the Boost Software License, Version 1.0. (See accompanying # subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# #
# Copyright Rene Rivera 2015-2016. # Copyright Rene Rivera 2015-2018.
# Setting up notifications like this is optional as the default behavior # Setting up notifications like this is optional as the default behavior
# of Travis is to notify the commiter of problems. But setting a specific # of Travis is to notify the commiter of problems. But setting a specific
@ -13,13 +13,6 @@ notifications:
recipients: recipients:
- grafikrobot@gmail.com - grafikrobot@gmail.com
# For now the CI scripts only support the two main branches available
# on the boost super-project.
branches:
only:
- master
- develop
# We specify a generic language instead of C++ as Travis sets up # We specify a generic language instead of C++ as Travis sets up
# additional environment vars that point to its default toolset # additional environment vars that point to its default toolset
# instead of the one we install. The extra env doesn't interfere, # instead of the one we install. The extra env doesn't interfere,
@ -28,7 +21,7 @@ branches:
language: generic language: generic
# Speficy the default as Linux here, to avoid duplication in the matrix # Speficy the default as Linux here, to avoid duplication in the matrix
# below. We use Trausty as that's the latest we can use. And it's better # below. We use Trusty as that's the latest we can use. And it's better
# supported by the whole range of C++ toolsets we like to test on. # supported by the whole range of C++ toolsets we like to test on.
dist: trusty dist: trusty
os: linux os: linux
@ -68,14 +61,18 @@ matrix:
- env: TOOLSET=gcc-4.9 - env: TOOLSET=gcc-4.9
- env: TOOLSET=gcc-5 - env: TOOLSET=gcc-5
- env: TOOLSET=gcc-6 - env: TOOLSET=gcc-6
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++03 - env: TOOLSET=gcc-7
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++11 - env: TOOLSET=gcc-8
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++14 - env: TOOLSET=gcc-8 CXXFLAGS=-std=c++03
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++1z - env: TOOLSET=gcc-8 CXXFLAGS=-std=c++11
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++03 - env: TOOLSET=gcc-8 CXXFLAGS=-std=c++14
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++11 - env: TOOLSET=gcc-8 CXXFLAGS=-std=c++17
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++14 - env: TOOLSET=gcc-8 CXXFLAGS=-std=c++2a
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++1z - env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++03
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++11
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++14
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++17
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++2a
- env: TOOLSET=xcode-6.1 - env: TOOLSET=xcode-6.1
os: osx os: osx
- env: TOOLSET=xcode-6.4 - env: TOOLSET=xcode-6.4
@ -84,18 +81,27 @@ matrix:
- env: TOOLSET=xcode-7.3 - env: TOOLSET=xcode-7.3
os: osx os: osx
osx_image: xcode7.3 osx_image: xcode7.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++03 - env: TOOLSET=xcode-8.3
os: osx os: osx
osx_image: xcode8.3 osx_image: xcode8.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++11 - env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++03
os: osx os: osx
osx_image: xcode8.3 osx_image: xcode9.4
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++14 - env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++11
os: osx os: osx
osx_image: xcode8.3 osx_image: xcode9.4
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++1z - env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++14
os: osx os: osx
osx_image: xcode8.3 osx_image: xcode9.4
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++17
os: osx
osx_image: xcode9.4
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++2a
os: osx
osx_image: xcode9.4
- env: TOOLSET=xcode-10.0
os: osx
osx_image: xcode10.0
install: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" install install: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" install
before_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" before_script before_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" before_script
@ -104,6 +110,3 @@ before_cache: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" before_cache
after_success: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_success after_success: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_success
after_failure: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_failure after_failure: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_failure
after_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_script after_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_script
cache:
directories:
- $HOME/boostorg/boost

View File

@ -235,7 +235,7 @@ commonly emulated by other compilers by defining the same base macros. To
account for this detection headers are allowed to define `*_EMULATED` predefs account for this detection headers are allowed to define `*_EMULATED` predefs
when this situation is detected. The emulated predefs will be set to the when this situation is detected. The emulated predefs will be set to the
version number of the detection instead of the regular predef macro for that version number of the detection instead of the regular predef macro for that
detection. For example MSVC will set `BOOST_COMP_MSVC_EMULATED` but not set `BOOST_COM_MSVC`, and it will also set `BOOST_COMP_MSVC_AVAILABLE`. detection. For example MSVC will set `BOOST_COMP_MSVC_EMULATED` but not set `BOOST_COMP_MSVC`, and it will also set `BOOST_COMP_MSVC_AVAILABLE`.
[heading Using the `BOOST_VERSION_NUMBER` macro] [heading Using the `BOOST_VERSION_NUMBER` macro]
@ -401,7 +401,7 @@ We also need to provide the `*_AVAILABLE` versions of the predef.
And for convenience we also want to provide a `*_NAME` macro: And for convenience we also want to provide a `*_NAME` macro:
`` ``
#define BOOST_catagory_tag_NAME "Name" #define BOOST_category_tag_NAME "Name"
`` ``
The testing of the predef macros is automated to generate checks for all The testing of the predef macros is automated to generate checks for all
@ -507,7 +507,7 @@ uses a simple 3-digit version macro (M,N,P). It can be decomposed
and defined as: and defined as:
`` ``
#define BOOST_CCOMP_EDG BOOST_PREDEF_MAKE_N_N_N(__EDG_VERSION__) #define BOOST_COMP_EDG BOOST_PREDEF_MAKE_N_N_N(__EDG_VERSION__)
`` ``
The decomposition macros are split into three types: decimal The decomposition macros are split into three types: decimal

View File

@ -38,7 +38,7 @@ Version number available as major, minor, and patch.
# define BOOST_COMP_DEC_DETECTION BOOST_PREDEF_MAKE_10_VVRR0PP00(__DECC_VER) # define BOOST_COMP_DEC_DETECTION BOOST_PREDEF_MAKE_10_VVRR0PP00(__DECC_VER)
# endif # endif
# if !defined(BOOST_COMP_DEC_DETECTION) # if !defined(BOOST_COMP_DEC_DETECTION)
# define BOOST_COM_DEC_DETECTION BOOST_VERSION_NUMBER_AVAILABLE # define BOOST_COMP_DEC_DETECTION BOOST_VERSION_NUMBER_AVAILABLE
# endif # endif
#endif #endif

View File

@ -102,8 +102,8 @@ local rule change_term_to_def ( term )
if $(parts[3]) if $(parts[3])
{ {
local version_number = [ regex.split $(parts[3]) "[.]" ] ; local version_number = [ regex.split $(parts[3]) "[.]" ] ;
if ! $(version_number[3]) { version_number += "0" ; }
if ! $(version_number[2]) { version_number += "0" ; } if ! $(version_number[2]) { version_number += "0" ; }
if ! $(version_number[3]) { version_number += "0" ; }
parts = $(parts[1-2]) BOOST_VERSION_NUMBER($(version_number:J=",")) ; parts = $(parts[1-2]) BOOST_VERSION_NUMBER($(version_number:J=",")) ;
} }
return <define>CHECK=\"$(parts:J=" ")\" ; return <define>CHECK=\"$(parts:J=" ")\" ;

View File

@ -254,6 +254,26 @@ toolset_info = {
'toolset' : 'clang', 'toolset' : 'clang',
'version' : '' 'version' : ''
}, },
'xcode-9.2' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
'xcode-9.3' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
'xcode-9.4' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
'xcode-10.0' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
} }
class SystemCallError(Exception): class SystemCallError(Exception):
@ -435,24 +455,24 @@ class utils:
return boost_version return boost_version
@staticmethod @staticmethod
def git_clone(sub_repo, branch, commit = None, cwd = None, no_submodules = False): def git_clone(owner, repo, branch, commit = None, repo_dir = None, submodules = False, url_format = "https://github.com/%(owner)s/%(repo)s.git"):
''' '''
This clone mimicks the way Travis-CI clones a project's repo. So far This clone mimicks the way Travis-CI clones a project's repo. So far
Travis-CI is the most limiting in the sense of only fetching partial Travis-CI is the most limiting in the sense of only fetching partial
history of the repo. history of the repo.
''' '''
if not cwd: if not repo_dir:
cwd = cwd = os.getcwd() repo_dir = os.path.join(os.getcwd(), owner+','+repo)
root_dir = os.path.join(cwd,'boostorg',sub_repo) utils.makedirs(os.path.dirname(repo_dir))
if not os.path.exists(os.path.join(root_dir,'.git')): if not os.path.exists(os.path.join(repo_dir,'.git')):
utils.check_call("git","clone", utils.check_call("git","clone",
"--depth=1", "--depth=1",
"--branch=%s"%(branch), "--branch=%s"%(branch),
"https://github.com/boostorg/%s.git"%(sub_repo), url_format%{'owner':owner,'repo':repo},
root_dir) repo_dir)
os.chdir(root_dir) os.chdir(repo_dir)
else: else:
os.chdir(root_dir) os.chdir(repo_dir)
utils.check_call("git","pull", utils.check_call("git","pull",
# "--depth=1", # Can't do depth as we get merge errors. # "--depth=1", # Can't do depth as we get merge errors.
"--quiet","--no-recurse-submodules") "--quiet","--no-recurse-submodules")
@ -463,12 +483,12 @@ class utils:
utils.check_call('dir',os.path.join('.git','modules')) utils.check_call('dir',os.path.join('.git','modules'))
else: else:
utils.check_call('ls','-la',os.path.join('.git','modules')) utils.check_call('ls','-la',os.path.join('.git','modules'))
if not no_submodules: if submodules:
utils.check_call("git","submodule","--quiet","update", utils.check_call("git","submodule","--quiet","update",
"--quiet","--init","--recursive", "--quiet","--init","--recursive",
) )
utils.check_call("git","submodule","--quiet","foreach","git","fetch") utils.check_call("git","submodule","--quiet","foreach","git","fetch")
return root_dir return repo_dir
class parallel_call(threading.Thread): class parallel_call(threading.Thread):
''' '''
@ -496,7 +516,7 @@ def set_arg(args, k, v = None):
class script_common(object): class script_common(object):
''' '''
Main script to run Boost C++ Libraries continuous integration. Main script to run continuous integration.
''' '''
def __init__(self, ci_klass, **kargs): def __init__(self, ci_klass, **kargs):
@ -521,7 +541,7 @@ class script_common(object):
set_arg(kargs,'branch',None) set_arg(kargs,'branch',None)
set_arg(kargs,'commit',None) set_arg(kargs,'commit',None)
set_arg(kargs,'repo',None) set_arg(kargs,'repo',None)
set_arg(kargs,'root_dir',None) set_arg(kargs,'repo_dir',None)
set_arg(kargs,'actions',None) set_arg(kargs,'actions',None)
set_arg(kargs,'pull_request', None) set_arg(kargs,'pull_request', None)
@ -533,9 +553,9 @@ class script_common(object):
self.actions = kargs.get('actions',None) self.actions = kargs.get('actions',None)
if not self.actions or self.actions == []: if not self.actions or self.actions == []:
self.actions = [ 'info' ] self.actions = [ 'info' ]
if not self.root_dir: if not self.repo_dir:
self.root_dir = os.getcwd() self.repo_dir = os.getcwd()
self.build_dir = os.path.join(os.path.dirname(self.root_dir), "build") self.build_dir = os.path.join(os.path.dirname(self.repo_dir), "build")
# API keys. # API keys.
self.bintray_key = os.getenv('BINTRAY_KEY') self.bintray_key = os.getenv('BINTRAY_KEY')
@ -562,8 +582,8 @@ class script_common(object):
ci_script = getattr(self, action_m, None) ci_script = getattr(self, action_m, None)
if ci_command or ci_script: if ci_command or ci_script:
utils.log( "### %s.."%(action) ) utils.log( "### %s.."%(action) )
if os.path.exists(self.root_dir): if os.path.exists(self.repo_dir):
os.chdir(self.root_dir) os.chdir(self.repo_dir)
if ci_command: if ci_command:
ci_command() ci_command()
elif ci_script: elif ci_script:
@ -614,9 +634,9 @@ class ci_cli(object):
The common way to use this variant is to invoke something like: The common way to use this variant is to invoke something like:
mkdir boost-ci mkdir ci
cd boost-ci cd ci
python path-to/ci_boost_<script>.py --branch=develop [--repo=mylib] ... python path-to/library_test.py --branch=develop [--repo=mylib] ...
Status: In working order. Status: In working order.
''' '''
@ -630,31 +650,23 @@ class ci_cli(object):
if os.path.isdir(doxygen_path): if os.path.isdir(doxygen_path):
os.environ["PATH"] = doxygen_path+':'+os.environ['PATH'] os.environ["PATH"] = doxygen_path+':'+os.environ['PATH']
self.script = script self.script = script
self.work_dir = os.getcwd() self.repo_dir = os.getcwd()
self.exit_result = 0 self.exit_result = 0
def init(self, opt, kargs): def init(self, opt, kargs):
kargs['actions'] = [ kargs['actions'] = [
'clone', # 'clone',
'install', 'install',
'before_build', 'before_build',
'build', 'build',
'before_cache', 'before_cache',
'finish' 'finish'
] ]
opt.add_option( '--repo',
help="Boost repo short name we are testing with, and hence the repo we clone.")
set_arg(kargs,'repo','boost')
return kargs return kargs
def finish(self, result): def finish(self, result):
self.exit_result = result self.exit_result = result
def command_clone(self):
self.script.root_dir = os.path.join(self.work_dir,'boostorg',self.script.repo)
self.script.build_dir = os.path.join(os.path.dirname(self.script.root_dir), "build")
utils.git_clone(self.script.repo, self.script.branch, self.script.commit, self.work_dir)
def command_finish(self): def command_finish(self):
exit(self.exit_result) exit(self.exit_result)
@ -665,10 +677,9 @@ class ci_travis(object):
def __init__(self,script): def __init__(self,script):
self.script = script self.script = script
self.work_dir = os.getenv("HOME")
def init(self, opt, kargs): def init(self, opt, kargs):
set_arg(kargs,'root_dir', os.getenv("TRAVIS_BUILD_DIR")) set_arg(kargs,'repo_dir', os.getenv("TRAVIS_BUILD_DIR"))
set_arg(kargs,'branch', os.getenv("TRAVIS_BRANCH")) set_arg(kargs,'branch', os.getenv("TRAVIS_BRANCH"))
set_arg(kargs,'commit', os.getenv("TRAVIS_COMMIT")) set_arg(kargs,'commit', os.getenv("TRAVIS_COMMIT"))
set_arg(kargs,'repo', os.getenv("TRAVIS_REPO_SLUG").split("/")[1]) set_arg(kargs,'repo', os.getenv("TRAVIS_REPO_SLUG").split("/")[1])
@ -686,7 +697,7 @@ class ci_travis(object):
''' '''
info = toolset_info[toolset] info = toolset_info[toolset]
if sys.platform.startswith('linux'): if sys.platform.startswith('linux'):
os.chdir(self.work_dir) os.chdir(self.script.build_dir)
if 'ppa' in info: if 'ppa' in info:
for ppa in info['ppa']: for ppa in info['ppa']:
utils.check_call( utils.check_call(
@ -748,10 +759,9 @@ class ci_circleci(object):
def __init__(self,script): def __init__(self,script):
self.script = script self.script = script
self.work_dir = os.getenv("HOME")
def init(self, opt, kargs): def init(self, opt, kargs):
set_arg(kargs,'root_dir', os.path.join(os.getenv("HOME"),os.getenv("CIRCLE_PROJECT_REPONAME"))) set_arg(kargs,'repo_dir', os.path.join(os.getenv("HOME"),os.getenv("CIRCLE_PROJECT_REPONAME")))
set_arg(kargs,'branch', os.getenv("CIRCLE_BRANCH")) set_arg(kargs,'branch', os.getenv("CIRCLE_BRANCH"))
set_arg(kargs,'commit', os.getenv("CIRCLE_SHA1")) set_arg(kargs,'commit', os.getenv("CIRCLE_SHA1"))
set_arg(kargs,'repo', os.getenv("CIRCLE_PROJECT_REPONAME").split("/")[1]) set_arg(kargs,'repo', os.getenv("CIRCLE_PROJECT_REPONAME").split("/")[1])
@ -768,7 +778,7 @@ class ci_circleci(object):
utils.check_call("pip","install","--user","PyYAML") utils.check_call("pip","install","--user","PyYAML")
def command_checkout_post(self): def command_checkout_post(self):
os.chdir(self.script.root_dir) os.chdir(self.script.repo_dir)
utils.check_call("git","submodule","update","--quiet","--init","--recursive") utils.check_call("git","submodule","update","--quiet","--init","--recursive")
def command_dependencies_pre(self): def command_dependencies_pre(self):
@ -777,7 +787,7 @@ class ci_circleci(object):
import yaml import yaml
utils.check_call('sudo','-E','apt-get','-yqq','update') utils.check_call('sudo','-E','apt-get','-yqq','update')
utils.check_call('sudo','apt-get','-yqq','purge','texlive*') utils.check_call('sudo','apt-get','-yqq','purge','texlive*')
with open(os.path.join(self.script.root_dir,'.travis.yml')) as yml: with open(os.path.join(self.script.repo_dir,'.travis.yml')) as yml:
travis_yml = yaml.load(yml) travis_yml = yaml.load(yml)
utils.check_call('sudo','apt-get','-yqq', utils.check_call('sudo','apt-get','-yqq',
'--no-install-suggests','--no-install-recommends','--force-yes','install', '--no-install-suggests','--no-install-recommends','--force-yes','install',
@ -817,10 +827,9 @@ class ci_appveyor(object):
def __init__(self,script): def __init__(self,script):
self.script = script self.script = script
self.work_dir = os.path.dirname(os.getenv("APPVEYOR_BUILD_FOLDER"))
def init(self, opt, kargs): def init(self, opt, kargs):
set_arg(kargs,'root_dir',os.getenv("APPVEYOR_BUILD_FOLDER")) set_arg(kargs,'repo_dir',os.getenv("APPVEYOR_BUILD_FOLDER"))
set_arg(kargs,'branch',os.getenv("APPVEYOR_REPO_BRANCH")) set_arg(kargs,'branch',os.getenv("APPVEYOR_REPO_BRANCH"))
set_arg(kargs,'commit',os.getenv("APPVEYOR_REPO_COMMIT")) set_arg(kargs,'commit',os.getenv("APPVEYOR_REPO_COMMIT"))
set_arg(kargs,'repo',os.getenv("APPVEYOR_REPO_NAME").split("/")[1]) set_arg(kargs,'repo',os.getenv("APPVEYOR_REPO_NAME").split("/")[1])
@ -839,7 +848,7 @@ class ci_appveyor(object):
self.script.command_install() self.script.command_install()
def command_before_build(self): def command_before_build(self):
os.chdir(self.script.root_dir) os.chdir(self.script.repo_dir)
utils.check_call("git","submodule","update","--quiet","--init","--recursive") utils.check_call("git","submodule","update","--quiet","--init","--recursive")
self.script.command_before_build() self.script.command_before_build()

View File

@ -40,34 +40,7 @@ class script(script_common):
def start(self): def start(self):
script_common.start(self) script_common.start(self)
# Some setup we need to redo for each invocation. # Some setup we need to redo for each invocation.
self.boost_root = os.path.join(self.ci.work_dir,'boostorg','boost') self.b2_dir = os.path.join(self.build_dir, 'b2')
@property
def repo_path(self):
if not hasattr(self,'_repo_path'):
# Find the path for the submodule of the repo we are testing.
if self.repo != 'boost':
self._repo_path = None
with open(os.path.join(self.boost_root,'.gitmodules'),"rU") as f:
path = None
url = None
for line in f:
line = line.strip()
if line.startswith("[submodule"):
path = None
url = None
else:
name = line.split("=")[0].strip()
value = line.split("=")[1].strip()
if name == "path":
path = value
elif name == "url":
url = value
if name and url and url.endswith("/%s.git"%(self.repo)):
self._repo_path = path
if not self._repo_path:
self._repo_path = "libs/%s"%(self.repo)
return self._repo_path
def command_install(self): def command_install(self):
script_common.command_install(self) script_common.command_install(self)
@ -79,38 +52,16 @@ class script(script_common):
def command_before_build(self): def command_before_build(self):
script_common.command_before_build(self) script_common.command_before_build(self)
# Clone boost super-project. # Fetch dependencies.
if self.repo != 'boost': utils.git_clone('boostorg','build','develop',repo_dir=self.b2_dir)
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. # Create config file for b2 toolset.
if self.repo != 'boost':
self.repo_dir = os.path.join(self.boost_root,self.repo_path)
if self.repo != 'boost':
# Copy in the existing library tree checkout.
shutil.rmtree(self.repo_path)
shutil.copytree(self.root_dir, self.repo_path)
# 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): if not isinstance(self.ci, ci_cli):
cxxflags = None cxxflags = None
if self.cxxflags: if self.cxxflags:
cxxflags = self.cxxflags.split() cxxflags = self.cxxflags.split()
cxxflags = " <cxxflags>".join(cxxflags) cxxflags = " <cxxflags>".join(cxxflags)
utils.make_file(os.path.join(self.boost_root, 'project-config.jam'), utils.make_file(os.path.join(self.repo_dir, 'project-config.jam'),
""" """
using %(toolset)s : %(version)s : %(command)s : %(cxxflags)s ; using %(toolset)s : %(version)s : %(command)s : %(cxxflags)s ;
using python : %(pyversion)s : "%(python)s" ; using python : %(pyversion)s : "%(python)s" ;
@ -127,72 +78,60 @@ using python : %(pyversion)s : "%(python)s" ;
script_common.command_build(self) script_common.command_build(self)
# Set up tools. # 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']: if not isinstance(self.ci, ci_cli) and toolset_info[self.toolset]['command']:
os.environ['PATH'] = os.pathsep.join([ os.environ['PATH'] = os.pathsep.join([
os.path.dirname(toolset_info[self.toolset]['command']), os.path.dirname(toolset_info[self.toolset]['command']),
os.path.join(self.build_dir,'dist','bin'),
os.environ['PATH']]) 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. # Bootstrap Boost Build engine.
os.chdir(os.path.join(self.boost_root,"tools","build")) os.chdir(self.b2_dir)
if sys.platform == 'win32': if sys.platform == 'win32':
utils.check_call(".\\bootstrap.bat") utils.check_call(".\\bootstrap.bat")
shutil.copy2("b2.exe", os.path.join(self.build_dir,"dist","bin","b2.exe"))
else: else:
utils.check_call("./bootstrap.sh") utils.check_call("./bootstrap.sh")
shutil.copy2("b2", os.path.join(self.build_dir,"dist","bin","b2")) os.environ['PATH'] = os.pathsep.join([self.b2_dir, os.environ['PATH']])
utils.check_call("git","clean","-dfqx") os.environ['BOOST_BUILD_PATH'] = self.b2_dir
# Run the limited tests. # Run the limited tests.
if self.repo != 'boost': print("--- Testing %s ---"%(self.repo_dir))
print("--- Testing %s ---"%(self.repo_path)) os.chdir(os.path.join(self.repo_dir,'test'))
os.chdir(os.path.join(self.boost_root,'status')) toolset_to_test = ""
to_test = self.repo_path.split("/") if self.toolset:
del to_test[0] if not isinstance(self.ci, ci_cli):
toolset_to_test = "" toolset_to_test = toolset_info[self.toolset]['toolset']
if self.toolset: else:
if not isinstance(self.ci, ci_cli): toolset_to_test = self.toolset
toolset_to_test = toolset_info[self.toolset]['toolset'] self.b2(
else: '-d1',
toolset_to_test = self.toolset '-p0',
self.b2( 'preserve-test-targets=off',
'-d1', '--dump-tests',
'-p0', '--verbose-test',
'--include-tests=%s'%("/".join(to_test)), '--build-dir=%s'%(self.build_dir),
'preserve-test-targets=off', '--out-xml=%s'%(os.path.join(self.build_dir,'regression.xml')),
'--dump-tests', '' if not toolset_to_test else 'toolset=%s'%(toolset_to_test),
'--build-dir=%s'%(self.build_dir), '' if not self.address_model else 'address-model=%s'%(self.address_model),
'--out-xml=%s'%(os.path.join(self.build_dir,'regression.xml')), 'variant=%s'%(self.variant),
'' if not toolset_to_test else 'toolset=%s'%(toolset_to_test), self.target
'' 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. # Generate a readable test report.
import build_log import build_log
log_main = build_log.Main([ log_main = build_log.Main([
'--output=console', '--output=console',
os.path.join(self.build_dir,'regression.xml')]) os.path.join(self.build_dir,'regression.xml')])
# And exit with an error if the report contains failures. # And exit with an error if the report contains failures.
# This lets the CI notice the error and report a failed build. # This lets the CI notice the error and report a failed build.
# And hence trigger the failure machinery, like sending emails. # And hence trigger the failure machinery, like sending emails.
if log_main.failed: if log_main.failed:
self.ci.finish(-1) self.ci.finish(-1)
def command_before_cache(self): def command_before_cache(self):
script_common.command_before_cache(self) script_common.command_before_cache(self)
os.chdir(self.boost_root) os.chdir(self.b2_dir)
utils.check_call("git","clean","-dfqx") 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","status","-bs")
utils.check_call("git","submodule","foreach","git","status","-bs") # utils.check_call("git","submodule","--quiet","foreach","git","clean","-dfqx")
# utils.check_call("git","submodule","foreach","git","status","-bs")
main(script) main(script)