cue: clean dependencies after build (reduces cache size)

- support CLEAN_DEPS=NO to leave dependencies uncleaned
  (fixes #48)
This commit is contained in:
Ralph Lange
2020-06-19 16:55:51 +02:00
parent 12d769835e
commit fbd6bac81a
4 changed files with 16 additions and 3 deletions

View File

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

View File

@@ -98,7 +98,7 @@ jobs:
- env: SET=test01 BCFG=static-debug - env: SET=test01 BCFG=static-debug
dist: bionic dist: bionic
- env: SET=test01 - env: SET=test01 CLEAN_DEPS=NO
dist: trusty dist: trusty
- env: SET=test01 BCFG=static-debug - 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 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] 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 Service specific options are described in the README files
in the service specific subdirectories: in the service specific subdirectories:

12
cue.py
View File

@@ -79,8 +79,14 @@ def detect_context():
if 'PARALLEL_MAKE' in os.environ: if 'PARALLEL_MAKE' in os.environ:
ci['parallel_make'] = os.environ['PARALLEL_MAKE'] 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['clean_deps'] = True
ci['service'], ci['compiler'], ci['os'], ci['platform'], ci['configuration'], ci['test']) 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() curdir = os.getcwd()
@@ -854,6 +860,8 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
place = places[setup[mod + "_VARNAME"]] place = places[setup[mod + "_VARNAME"]]
print('{0}Building dependency {1} in {2}{3}'.format(ANSI_YELLOW, mod, place, ANSI_RESET)) print('{0}Building dependency {1} in {2}{3}'.format(ANSI_YELLOW, mod, place, ANSI_RESET))
call_make(cwd=place, silent=silent_dep_builds) 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') fold_end('build.dependencies', 'Build missing/outdated dependencies')
print('{0}Dependency module information{1}'.format(ANSI_CYAN, ANSI_RESET)) print('{0}Dependency module information{1}'.format(ANSI_CYAN, ANSI_RESET))