diff --git a/ros_buildfarm/argument.py b/ros_buildfarm/argument.py index 4d07bd23e..ae5c7ddec 100644 --- a/ros_buildfarm/argument.py +++ b/ros_buildfarm/argument.py @@ -448,6 +448,11 @@ def add_argument_require_gpu_support(parser): help='GPU acceleration is needed in the build container') +def add_argument_shared_ccache(parser): + parser.add_argument( + '--shared-ccache', action='store_true', + help='User\'s ccache directory is shared in the build container') + def add_argument_skip_cleanup(parser): parser.add_argument( '--skip-cleanup', action='store_true', diff --git a/ros_buildfarm/devel_job.py b/ros_buildfarm/devel_job.py index 87a9d74c3..47e75be0b 100644 --- a/ros_buildfarm/devel_job.py +++ b/ros_buildfarm/devel_job.py @@ -252,7 +252,8 @@ def configure_devel_job( build_targets=None, dry_run=False, run_abichecker=None, - require_gpu_support=None): + require_gpu_support=None, + shared_ccache=None): """ Configure a single Jenkins devel job. @@ -271,6 +272,9 @@ def configure_devel_job( if build_targets is not None: build_file.targets = build_targets + if shared_ccache is not None: + build_file.shared_ccache = shared_ccache + if index is None: index = get_index(config.rosdistro_index_url) if dist_file is None: diff --git a/scripts/prerelease/generate_prerelease_script.py b/scripts/prerelease/generate_prerelease_script.py index 9bd94560e..927bbb6c2 100755 --- a/scripts/prerelease/generate_prerelease_script.py +++ b/scripts/prerelease/generate_prerelease_script.py @@ -33,6 +33,7 @@ from ros_buildfarm.argument import add_argument_os_name from ros_buildfarm.argument import add_argument_output_dir from ros_buildfarm.argument import add_argument_rosdistro_name +from ros_buildfarm.argument import add_argument_shared_ccache from ros_buildfarm.config import get_index as get_config_index from ros_buildfarm.config import get_release_build_files from ros_buildfarm.config import get_source_build_files @@ -56,6 +57,7 @@ def main(argv=sys.argv[1:]): add_argument_build_tool(parser) add_argument_custom_rosdep_update_options(parser) add_argument_output_dir(parser, required=True) + add_argument_shared_ccache(parser) group = parser.add_argument_group( 'Repositories in underlay workspace', @@ -225,7 +227,8 @@ def beforeInclude(self, *_, **kwargs): index=index, dist_file=dist_file, dist_cache=dist_cache, jenkins=False, views=False, source_repository=source_repository, - build_targets=release_targets_combined) + build_targets=release_targets_combined, + shared_ccache=args.shared_ccache) templates.template_hooks = None