5 Commits

Author SHA1 Message Date
Ralph Lange
b3091e6d6f cue: fix EXTRA settings for build action 2020-06-23 17:35:13 +02:00
Ralph Lange
1a996e5407 cue: fix erroneous entries in /etc/hosts on Travis 2020-06-23 15:46:46 +02:00
Ralph Lange
f927e475ff cue: install apt packages from APT on linux 2020-06-22 15:04:22 +02:00
Ralph Lange
fbd6bac81a cue: clean dependencies after build (reduces cache size)
- support CLEAN_DEPS=NO to leave dependencies uncleaned
  (fixes #48)
2020-06-19 17:10:02 +02:00
Ralph Lange
12d769835e cue: fix issue introduced in 35f5befa
- was leading to jobs failing if setup file was
  not found in the first directory of search path
2020-06-15 14:16:16 +02:00
4 changed files with 47 additions and 7 deletions

View File

@@ -80,6 +80,7 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- CMP: vs2019
BASE: 3.15
CLEAN_DEPS: NO
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- CMP: vs2019
BASE: 3.14

View File

@@ -98,7 +98,7 @@ jobs:
- env: SET=test01 BCFG=static-debug
dist: bionic
- env: SET=test01
- env: SET=test01 CLEAN_DEPS=NO
dist: trusty
- env: SET=test01 BCFG=static-debug

View File

@@ -251,6 +251,10 @@ location for the dependency builds. [default is `$HOME/.cache`]
Set `PARALLEL_MAKE` to the number of parallel make jobs that you want your
build to use. [default is the number of CPUs on the runner]
Set `CLEAN_DEPS` to `NO` if you want to leave the object file directories
(`**/O.*`) in the cached dependencies. [default is to run `make clean`
after building a dependency]
Service specific options are described in the README files
in the service specific subdirectories:

47
cue.py
View File

@@ -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()
@@ -271,9 +281,9 @@ def source_set(name):
setup[assign[0]] = assign[1]
logger.debug('Done with setup file %s', set_file)
break
else:
raise NameError("{0}Setup file {1}.set does not exist in SETUP_PATH search path ({2}){3}"
.format(ANSI_RED, name, setup_dirs, ANSI_RESET))
else:
raise NameError("{0}Setup file {1}.set does not exist in SETUP_PATH search path ({2}){3}"
.format(ANSI_RED, name, setup_dirs, ANSI_RESET))
# update_release_local(var, location)
@@ -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')