Having the wrappers inside $HOME works fine when we have control over which user will run the build, as is the case for the current Jenkins-based environment, but not when the user is chosen by an external entity, as is the case for container-based builds. Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- guests/playbooks/update/main.yml | 1 + guests/playbooks/update/tasks/global.yml | 14 ++++++++++++++ guests/playbooks/update/tasks/users.yml | 21 --------------------- guests/playbooks/update/templates/bashrc.j2 | 2 +- 4 files changed, 16 insertions(+), 22 deletions(-) create mode 100644 guests/playbooks/update/tasks/global.yml diff --git a/guests/playbooks/update/main.yml b/guests/playbooks/update/main.yml index 107a78a..a5a4de8 100644 --- a/guests/playbooks/update/main.yml +++ b/guests/playbooks/update/main.yml @@ -51,6 +51,7 @@ - include: '{{ playbook_base }}/tasks/kludges.yml' - include: '{{ playbook_base }}/tasks/bootloader.yml' - include: '{{ playbook_base }}/tasks/services.yml' + - include: '{{ playbook_base }}/tasks/global.yml' - include: '{{ playbook_base }}/tasks/users.yml' # Configure the Jenkins agent diff --git a/guests/playbooks/update/tasks/global.yml b/guests/playbooks/update/tasks/global.yml new file mode 100644 index 0000000..504a549 --- /dev/null +++ b/guests/playbooks/update/tasks/global.yml @@ -0,0 +1,14 @@ +--- +- name: 'Create ccache wrappers' + file: + path: /usr/local/share/ccache-wrappers + state: directory + +- name: 'Create ccache wrappers' + file: + src: '{{ ccache }}' + dest: /usr/local/share/ccache-wrappers/{{ item }} + state: link + with_items: + - cc + - '{{ cc | basename }}' diff --git a/guests/playbooks/update/tasks/users.yml b/guests/playbooks/update/tasks/users.yml index 931d79b..30e5fca 100644 --- a/guests/playbooks/update/tasks/users.yml +++ b/guests/playbooks/update/tasks/users.yml @@ -53,27 +53,6 @@ when: - flavor == 'test' -- name: '{{ flavor }}: Configure ccache' - file: - path: /home/{{ flavor }}/.{{ item }} - state: directory - owner: '{{ flavor }}' - group: '{{ flavor }}' - with_items: - - ccache - - ccache/bin - -- name: '{{ flavor }}: Create ccache wrappers' - file: - src: '{{ ccache }}' - dest: /home/{{ flavor }}/.ccache/bin/{{ item }} - state: link - owner: '{{ flavor }}' - group: '{{ flavor }}' - with_items: - - cc - - '{{ cc | basename }}' - - name: '{{ flavor }}: Create shell profile' template: src: '{{ playbook_base }}/templates/{{ item }}.j2' diff --git a/guests/playbooks/update/templates/bashrc.j2 b/guests/playbooks/update/templates/bashrc.j2 index 898d30b..77c8fb8 100644 --- a/guests/playbooks/update/templates/bashrc.j2 +++ b/guests/playbooks/update/templates/bashrc.j2 @@ -8,7 +8,7 @@ export MAKEFLAGS="-j{{ install_vcpus|int + 1 }}" export CCACHE_MAXSIZE="2G" export VIRT_PREFIX="$HOME/build/libvirt" -export PATH="$VIRT_PREFIX/bin:$HOME/.ccache/bin:$PATH" +export PATH="$VIRT_PREFIX/bin:/usr/local/share/ccache-wrappers:$PATH" export C_INCLUDE_PATH="$VIRT_PREFIX/include" export LD_LIBRARY_PATH="$VIRT_PREFIX/lib" export PKG_CONFIG_PATH="$VIRT_PREFIX/lib/pkgconfig" -- 2.25.1