Re: [jenkins-ci PATCH 4/5] guests: Create ccache symlink farm

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

 



Disclaimer: I don't feel like I can review the patches properly.  Not
only because I never heard the term "symlink farm" before, but mostly
because jenkins-ci.  However I noticed two nits here and there.  I hope
it won't discourage others from review.  I apologize in advance if it
does.

On Wed, Apr 18, 2018 at 05:25:21PM +0200, Andrea Bolognani wrote:
ccache can detect the name it's been called with and
transparently invoke the compiler if it matches. The Fedora
package uses this trick to enable ccache out of the box, but
other operating systems and distributions leave the task up
to the user.

Replicate the setup in the user's ~/.ccache directory so
that it works across all guests. With the linke farm in

s/linke/link/ ?

place, setting $CC in the user's shell profile is no longer
necessary.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
guests/group_vars/all/main.yml |  2 +-
guests/tasks/users.yml         | 33 ++++++++++++++++++++++++++++++++-
guests/templates/bashrc        |  3 ---
3 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml
index b364acf..cd8ef25 100644
--- a/guests/group_vars/all/main.yml
+++ b/guests/group_vars/all/main.yml
@@ -9,7 +9,7 @@ jenkins_url: https://ci.centos.org/computer/{{ inventory_hostname }}/slave-agent
# Environment variables and paths to commands/files that might be
# OS-dependent. Can be overridden on a per-host basis
VIRT_PREFIX: $HOME/build/libvirt
-PATH: $VIRT_PREFIX/bin:$PATH
+PATH: $VIRT_PREFIX/bin:$HOME/.ccache/bin:$PATH
C_INCLUDE_PATH: $VIRT_PREFIX/include
LD_LIBRARY_PATH: $VIRT_PREFIX/lib
PKG_CONFIG_PATH: $VIRT_PREFIX/lib/pkgconfig
diff --git a/guests/tasks/users.yml b/guests/tasks/users.yml
index e691b32..033ca2a 100644
--- a/guests/tasks/users.yml
+++ b/guests/tasks/users.yml
@@ -53,10 +53,13 @@

- name: '{{ flavor }}: Configure ccache'
  file:
-    path: /home/{{ flavor }}/.ccache
+    path: /home/{{ flavor }}/.{{ item }}
    state: directory
    owner: '{{ flavor }}'
    group: '{{ flavor }}'
+  with_items:
+    - ccache
+    - ccache/bin


With new enough ansible, you don't need the 'ccache' entry as this
behaves similarly to `mkdir -p`:

 "If directory, all immediate subdirectories will be created if they do
 not exist, since 1.7 they will be created with the supplied
 permissions." [1]

You can also use 'recurse' if doing more than just creating them.

[1] https://docs.ansible.com/ansible/latest/modules/file_module.html

Have a nice day
Martin

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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