[libvirt-jenkins-ci PATCH 7/7] lcitool: Create and expose ccache wrappers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



VM-based builds have used ccache by default for a very long time,
and now container-based builds will too.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 guests/lcitool | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/guests/lcitool b/guests/lcitool
index 117e1a5..011fc07 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -651,6 +651,8 @@ class Application:
             varmap = self._dockerfile_build_varmap_rpm(facts, mappings, pip_mappings, projects, cross_arch)
 
         varmap["package_manager"] = facts["package_manager"]
+        varmap["cc"] = facts["cc"]
+        varmap["ccache"] = facts["ccache"]
         varmap["make"] = facts["make"]
         varmap["ninja"] = facts["ninja"]
         varmap["python"] = facts["python"]
@@ -864,6 +866,21 @@ class Application:
                     "{package_manager} clean all -y",
                 ])
 
+        commands.extend([
+            "mkdir -p /usr/local/share/ccache-wrappers",
+        ])
+
+        if cross_arch:
+            commands.extend([
+                "ln -s {ccache} /usr/local/share/ccache-wrappers/{cross_abi}-cc",
+                "ln -s {ccache} /usr/local/share/ccache-wrappers/{cross_abi}-$(basename {cc})",
+            ])
+        else:
+            commands.extend([
+                "ln -s {ccache} /usr/local/share/ccache-wrappers/cc",
+                "ln -s {ccache} /usr/local/share/ccache-wrappers/$(basename {cc})",
+            ])
+
         script = "\nRUN " + (" && \\\n    ".join(commands)) + "\n"
         sys.stdout.write(script.format(**varmap))
 
@@ -900,6 +917,7 @@ class Application:
 
         sys.stdout.write(textwrap.dedent("""
             ENV LANG "en_US.UTF-8"
+            ENV PATH "/usr/local/share/ccache-wrappers:$PATH"
 
             ENV MAKE "{make}"
             ENV NINJA "{ninja}"
-- 
2.25.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux