Commit df683079 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

ccache → sccache

parent 747a9991
Pipeline #15922 failed with stage
in 4 minutes and 53 seconds
# Generated by Django 3.2.5 on 2021-09-06 15:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rainboard', '0059_auto_20210826_1411'),
]
operations = [
migrations.RemoveField(
model_name='project',
name='ccache',
),
]
......@@ -222,7 +222,6 @@ class Project(Links, NamedModel, TimeStampedModel):
allow_format_failure = models.BooleanField(default=True)
has_python = models.BooleanField(default=True)
accept_pr_to_master = models.BooleanField(default=False)
ccache = models.BooleanField(default=True)
def save(self, *args, **kwargs):
self.name = valid_name(self.name)
......@@ -962,7 +961,6 @@ class Image(models.Model):
'ROBOTPKG': self.robotpkg,
'CATEGORY': self.robotpkg.category,
'REGISTRY': settings.PUBLIC_REGISTRY if self.public else settings.PRIVATE_REGISTRY,
'CCACHE': self.robotpkg.project.ccache,
}
if not self.robotpkg.project.public:
ret['IMAGE'] = 'robotpkg-jrl'
......@@ -1300,24 +1298,24 @@ def to_release_in_robotpkg():
def ordered_projects():
""" helper for gepetto/buildfarm/generate_all.py """
fields = 'category', 'name', 'project__main_namespace__slug', 'project__ccache'
fields = 'category', 'name', 'project__main_namespace__slug'
projects = Project.objects.exclude(BAD_ONES)
rpkgs = list(Robotpkg.objects.filter(project__in=projects).values_list(*fields))
deps_cache = {}
def get_deps(cat, pkg, ns, rpkgs, ccache):
def get_deps(cat, pkg, ns, rpkgs):
"""Get the robotpkg dependencies for a given robotpkg."""
with (settings.RAINBOARD_RPKG / cat / pkg / 'Makefile').open() as file_handle:
cont = file_handle.read()
deps = [d_pkg for d_cat, d_pkg, _, _ in rpkgs if f'\ninclude ../../{d_cat}/{d_pkg}/depend.mk\n' in cont]
if pkg.startswith('py-') and (cat, pkg[3:], ns, ccache) in rpkgs:
if pkg.startswith('py-') and (cat, pkg[3:], ns) in rpkgs:
deps.append(pkg[3:])
deps_cache[pkg] = sorted(set(deps))
return deps_cache[pkg]
rpkgs = [[cat, pkg, ns, get_deps(cat, pkg, ns, rpkgs, ccache), ccache] for cat, pkg, ns, ccache in rpkgs]
rpkgs = [[cat, pkg, ns, get_deps(cat, pkg, ns, rpkgs)] for cat, pkg, ns in rpkgs]
def get_rdeps(deps):
"""Recursively get robotpkg dependencies for a given robotpkg."""
......@@ -1333,7 +1331,7 @@ def ordered_projects():
def project_sort_key(prj):
"""Generate a key to sort projects: by number of recursive dependencies, then python bindings, then name."""
cat, pkg, ns, deps, ccache = prj
cat, pkg, ns, deps = prj
return (len(get_rdeps(deps)), 1 if pkg.startswith('py-') else 0, pkg)
return sorted(rpkgs, key=project_sort_key)
# https://rainboard.laas.fr/project/{{ project.slug }}/.gitlab-ci.yml
{% if project.ccache %}variables:
CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
cache:
paths:
- ccache
{% endif %}
{% for robotpkg in project.ordered_robotpkg %}.robotpkg-{{ robotpkg }}: &robotpkg-{{ robotpkg }}
retry:
max: 2
......@@ -15,9 +7,7 @@ cache:
except:
- gh-pages
script:
{% if project.ccache %} - mkdir -p ccache
- echo "CCACHE_DIR=${CI_PROJECT_DIR}/ccache" >> /opt/openrobots/etc/robotpkg.conf
{% endif %}
- sccache -s
- cd /root/robotpkg/{{ robotpkg.category }}
- git pull
{% if robotpkg.without_py %} - cd {{ robotpkg.without_py }}
......@@ -28,6 +18,7 @@ cache:
- make install
- build=$(make show-var VARNAME=CONFIGURE_DIRS); cd $(make show-var VARNAME=WRKSRC); cd $build
{% if project.tests %} - make test
- sccache -s
{% endif %}
{% for image in robotpkg.valid_images %}{{ image.get_job_name }}:
<<: *robotpkg-{{ robotpkg }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment