|
|
|
|
@@ -71,6 +71,9 @@ def detect_context():
|
|
|
|
|
if 'CHOCO' in os.environ:
|
|
|
|
|
ci['choco'].extend(os.environ['CHOCO'].split())
|
|
|
|
|
|
|
|
|
|
if 'APT' in os.environ:
|
|
|
|
|
ci['apt'].extend(os.environ['APT'].split())
|
|
|
|
|
|
|
|
|
|
ci['test'] = True
|
|
|
|
|
if 'TEST' in os.environ and os.environ['TEST'].lower() == 'no':
|
|
|
|
|
ci['test'] = False
|
|
|
|
|
@@ -79,8 +82,14 @@ def detect_context():
|
|
|
|
|
if 'PARALLEL_MAKE' in os.environ:
|
|
|
|
|
ci['parallel_make'] = os.environ['PARALLEL_MAKE']
|
|
|
|
|
|
|
|
|
|
logger.debug('Detected a build hosted on %s, using %s on %s (%s) configured as %s (test: %s)',
|
|
|
|
|
ci['service'], ci['compiler'], ci['os'], ci['platform'], ci['configuration'], ci['test'])
|
|
|
|
|
ci['clean_deps'] = True
|
|
|
|
|
if 'CLEAN_DEPS' in os.environ and os.environ['CLEAN_DEPS'].lower() == 'no':
|
|
|
|
|
ci['clean_deps'] = False
|
|
|
|
|
|
|
|
|
|
logger.debug('Detected a build hosted on %s, using %s on %s (%s) configured as %s '
|
|
|
|
|
+ '(test: %s, clean_deps: %s)',
|
|
|
|
|
ci['service'], ci['compiler'], ci['os'], ci['platform'], ci['configuration'],
|
|
|
|
|
ci['test'], ci['clean_deps'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curdir = os.getcwd()
|
|
|
|
|
@@ -120,6 +129,7 @@ def clear_lists():
|
|
|
|
|
ci['configuration'] = '<unknown>'
|
|
|
|
|
ci['scriptsdir'] = ''
|
|
|
|
|
ci['choco'] = ['make']
|
|
|
|
|
ci['apt'] = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clear_lists()
|
|
|
|
|
@@ -634,6 +644,21 @@ def setup_for_build(args):
|
|
|
|
|
extra_makeargs.append(os.environ[tag])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def fix_etc_hosts():
|
|
|
|
|
# Several travis-ci images throw us a curveball in /etc/hosts
|
|
|
|
|
# by including two entries for localhost. The first for 127.0.1.1
|
|
|
|
|
# causes epicsSockResolveTest to fail.
|
|
|
|
|
# cat /etc/hosts
|
|
|
|
|
# ...
|
|
|
|
|
# 127.0.1.1 localhost localhost ip4-loopback
|
|
|
|
|
# 127.0.0.1 localhost nettuno travis vagrant travis-job-....
|
|
|
|
|
|
|
|
|
|
logger.debug("EXEC sudo sed -ie '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts")
|
|
|
|
|
sys.stdout.flush()
|
|
|
|
|
exitcode = sp.call(['sudo', 'sed', '-ie', '/^127\.0\.1\.1/ s|localhost\s*||g', '/etc/hosts'])
|
|
|
|
|
logger.debug('EXEC DONE')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def prepare(args):
|
|
|
|
|
host_info()
|
|
|
|
|
|
|
|
|
|
@@ -654,6 +679,9 @@ def prepare(args):
|
|
|
|
|
|
|
|
|
|
logger.debug('Effective module list: %s', modlist())
|
|
|
|
|
|
|
|
|
|
if ci['service'] == 'travis' and ci['os'] == 'linux':
|
|
|
|
|
fix_etc_hosts()
|
|
|
|
|
|
|
|
|
|
# we're working with tags (detached heads) a lot: suppress advice
|
|
|
|
|
call_git(['config', '--global', 'advice.detachedHead', 'false'])
|
|
|
|
|
|
|
|
|
|
@@ -816,6 +844,11 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
|
|
|
|
|
sp.check_call(['choco', 'install'] + ci['choco'])
|
|
|
|
|
fold_end('install.choco', 'Installing CHOCO packages')
|
|
|
|
|
|
|
|
|
|
if ci['os'] == 'linux' and ci['apt']:
|
|
|
|
|
fold_start('install.apt', 'Installing APT packages')
|
|
|
|
|
sp.check_call(['sudo', 'apt-get', '-y', 'install'] + ci['apt'])
|
|
|
|
|
fold_end('install.apt', 'Installing APT packages')
|
|
|
|
|
|
|
|
|
|
if ci['os'] == 'linux' and 'RTEMS' in os.environ:
|
|
|
|
|
tar_name = 'i386-rtems{0}-trusty-20171203-{0}.tar.bz2'.format(os.environ['RTEMS'])
|
|
|
|
|
print('Downloading RTEMS {0} cross compiler: {1}'
|
|
|
|
|
@@ -854,6 +887,8 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
|
|
|
|
|
place = places[setup[mod + "_VARNAME"]]
|
|
|
|
|
print('{0}Building dependency {1} in {2}{3}'.format(ANSI_YELLOW, mod, place, ANSI_RESET))
|
|
|
|
|
call_make(cwd=place, silent=silent_dep_builds)
|
|
|
|
|
if ci['clean_deps']:
|
|
|
|
|
call_make(args=['clean'], cwd=place, silent=silent_dep_builds)
|
|
|
|
|
fold_end('build.dependencies', 'Build missing/outdated dependencies')
|
|
|
|
|
|
|
|
|
|
print('{0}Dependency module information{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
|
|
|
@@ -876,7 +911,7 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
|
|
|
|
|
def build(args):
|
|
|
|
|
setup_for_build(args)
|
|
|
|
|
fold_start('build.module', 'Build the main module')
|
|
|
|
|
call_make(args.makeargs)
|
|
|
|
|
call_make(args.makeargs, use_extra=True)
|
|
|
|
|
fold_end('build.module', 'Build the main module')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|