Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not install ccache unless shared_ccache is used in binarydeb #1021

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ros_buildfarm/argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,12 @@ def add_argument_skip_tests(parser):
help='Skip execution of tests as part of the package build process.')


def add_argument_install_ccache(parser):
parser.add_argument(
'--install-ccache', action='store_true',
help='Install the ccache binary packages in the system.')


def check_len_action(minargs, maxargs):
class CheckLength(argparse.Action):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ros_buildfarm.argument import add_argument_distribution_repository_urls
from ros_buildfarm.argument import add_argument_dockerfile_dir
from ros_buildfarm.argument import add_argument_env_vars
from ros_buildfarm.argument import add_argument_install_ccache
from ros_buildfarm.argument import add_argument_os_code_name
from ros_buildfarm.argument import add_argument_os_name
from ros_buildfarm.argument import add_argument_package_name
Expand Down Expand Up @@ -56,6 +57,7 @@ def main(argv=sys.argv[1:]):
add_argument_dockerfile_dir(parser)
add_argument_env_vars(parser)
add_argument_skip_tests(parser)
add_argument_install_ccache(parser)
args = parser.parse_args(argv)

debian_package_name = get_os_package_name(
Expand Down Expand Up @@ -107,6 +109,7 @@ def main(argv=sys.argv[1:]):
'dependencies': debian_pkg_names,
'dependency_versions': debian_pkg_versions,
'skip_tests': args.skip_tests,
'install_ccache': args.install_ccache,
'install_lists': [],

'rosdistro_name': args.rosdistro_name,
Expand Down
3 changes: 3 additions & 0 deletions ros_buildfarm/scripts/release/run_binarydeb_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from ros_buildfarm.argument import add_argument_distribution_repository_urls
from ros_buildfarm.argument import add_argument_dockerfile_dir
from ros_buildfarm.argument import add_argument_env_vars
from ros_buildfarm.argument import add_argument_install_ccache
from ros_buildfarm.argument import add_argument_os_code_name
from ros_buildfarm.argument import add_argument_os_name
from ros_buildfarm.argument import add_argument_package_name
Expand Down Expand Up @@ -55,6 +56,7 @@ def main(argv=sys.argv[1:]):
add_argument_append_timestamp(parser)
add_argument_env_vars(parser)
add_argument_skip_tests(parser)
add_argument_install_ccache(parser)
args = parser.parse_args(argv)

data = copy.deepcopy(args.__dict__)
Expand All @@ -69,6 +71,7 @@ def main(argv=sys.argv[1:]):

'skip_download_sourcepkg': args.skip_download_sourcepkg,
'skip_tests': args.skip_tests,
'install_ccache': args.install_ccache,

'binarypkg_dir': '/tmp/binarydeb',
'build_environment_variables': ['%s=%s' % key_value for key_value in args.env_vars.items()],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ cmds.append(
' --binarypkg-dir ' + binarypkg_dir +
' --env-vars ' + ' '.join(build_environment_variables) +
' --dockerfile-dir ' + dockerfile_dir +
(' --install-ccache ' if install_ccache else '') +
(' --skip-tests' if skip_tests else ''))
}@
CMD ["@(' && '.join(cmds))"]
1 change: 1 addition & 0 deletions ros_buildfarm/templates/release/deb/binarypkg_job.xml.em
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ but disabled since the package is blacklisted (or not whitelisted) in the config
' --dockerfile-dir $WORKSPACE/docker_generating_docker' +
' --env-vars ' + ' '.join(build_environment_variables) +
(' --append-timestamp' if append_timestamp else '') +
(' --install-ccache' if shared_ccache else '') +
(' --skip-tests' if skip_tests else ''),
'echo "# END SECTION"',
'',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ RUN . /etc/os-release && test "$VERSION_ID" = "20.04" && test "$(uname -m)" = "a
os_code_name=os_code_name,
))@

@[if install_ccache]@
@(TEMPLATE(
'snippet/install_ccache.Dockerfile.em',
os_name=os_name,
os_code_name=os_code_name,
))@
@[end if]@

@(TEMPLATE(
'snippet/set_environment_variables.Dockerfile.em',
Expand Down
Loading