From nobody Mon May 6 13:19:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524065135713614.8250230150531; Wed, 18 Apr 2018 08:25:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFCF23180D45; Wed, 18 Apr 2018 15:25:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95FC775CE7; Wed, 18 Apr 2018 15:25:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3903A4CA99; Wed, 18 Apr 2018 15:25:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IFPTSq006919 for ; Wed, 18 Apr 2018 11:25:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id A96231C723; Wed, 18 Apr 2018 15:25:29 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4BF2A7C26 for ; Wed, 18 Apr 2018 15:25:29 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 17:25:18 +0200 Message-Id: <20180418152522.17923-2-abologna@redhat.com> In-Reply-To: <20180418152522.17923-1-abologna@redhat.com> References: <20180418152522.17923-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 1/5] guests: Reorder tasks X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 18 Apr 2018 15:25:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We're going to introduce more customization steps that need to be performed after installing some packages. To avoid hacking too much around the core issue, just move all environment customization after package installation and be done with it. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- guests/site.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/guests/site.yml b/guests/site.yml index a13e0e9..46d2db6 100644 --- a/guests/site.yml +++ b/guests/site.yml @@ -31,12 +31,6 @@ project: blacklist state: absent =20 - # Configure environment. Needs to happen after installing base packages - - include: tasks/bootloader.yml - - include: tasks/services.yml - - include: tasks/kludges.yml - - include: tasks/users.yml - # Install build dependencies for each project - include: tasks/packages.yml with_items: @@ -53,11 +47,13 @@ when: - flavor =3D=3D "jenkins" =20 + # Configure environment. Needs to happen after installing packages + - include: tasks/bootloader.yml + - include: tasks/services.yml + - include: tasks/kludges.yml + - include: tasks/users.yml + # Configure the Jenkins agent - include: tasks/jenkins.yml when: - flavor =3D=3D 'jenkins' - - # Some of the kludges involve tweaking files that are included in - # the packages we just installed, so go through them again here - - include: tasks/kludges.yml --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 13:19:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524065164180310.1139235377706; Wed, 18 Apr 2018 08:26:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7194F3164239; Wed, 18 Apr 2018 15:26:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11E979231D; Wed, 18 Apr 2018 15:25:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A1BAF1805972; Wed, 18 Apr 2018 15:25:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IFPUU9006924 for ; Wed, 18 Apr 2018 11:25:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4D5F37C26; Wed, 18 Apr 2018 15:25:30 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E44A61DB27 for ; Wed, 18 Apr 2018 15:25:29 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 17:25:19 +0200 Message-Id: <20180418152522.17923-3-abologna@redhat.com> In-Reply-To: <20180418152522.17923-1-abologna@redhat.com> References: <20180418152522.17923-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 2/5] guests: Figure out OS-dependent paths automatically X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 18 Apr 2018 15:26:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When configuring a guest, we need to know the absolute path for some commands and files; unfortunately, while most of them are the same regardless of the OS, some of them don't. Right now we hardcode such paths in the inventory, but it would be better if we didn't have to do that: this commit introduces a way to let Ansible figure out the paths for itself instead. We're going to use it for more paths later on. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- guests/group_vars/all/main.yml | 5 --- guests/host_vars/libvirt-freebsd-10/main.yml | 5 --- guests/host_vars/libvirt-freebsd-11/main.yml | 5 --- guests/host_vars/libvirt-freebsd-current/main.yml | 5 --- guests/site.yml | 1 + guests/tasks/paths.yml | 37 +++++++++++++++++++= ++++ 6 files changed, 38 insertions(+), 20 deletions(-) create mode 100644 guests/tasks/paths.yml diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index 4e05c66..b364acf 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -18,8 +18,3 @@ GI_TYPELIB_PATH: $VIRT_PREFIX/lib/girepository-1.0 OSINFO_SYSTEM_DIR: $VIRT_PREFIX/share/osinfo PERL5LIB: PYTHONPATH: - -bash: /bin/bash -java: /usr/bin/java -su: /bin/su -sudoers: /etc/sudoers diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml b/guests/host_var= s/libvirt-freebsd-10/main.yml index 487b3e8..ab5e367 100644 --- a/guests/host_vars/libvirt-freebsd-10/main.yml +++ b/guests/host_vars/libvirt-freebsd-10/main.yml @@ -4,11 +4,6 @@ ansible_python_interpreter: /usr/local/bin/python2 PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages =20 -bash: /usr/local/bin/bash -java: /usr/local/bin/java -su: /usr/bin/su -sudoers: /usr/local/etc/sudoers - projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_var= s/libvirt-freebsd-11/main.yml index 487b3e8..ab5e367 100644 --- a/guests/host_vars/libvirt-freebsd-11/main.yml +++ b/guests/host_vars/libvirt-freebsd-11/main.yml @@ -4,11 +4,6 @@ ansible_python_interpreter: /usr/local/bin/python2 PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages =20 -bash: /usr/local/bin/bash -java: /usr/local/bin/java -su: /usr/bin/su -sudoers: /usr/local/etc/sudoers - projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/hos= t_vars/libvirt-freebsd-current/main.yml index 487b3e8..ab5e367 100644 --- a/guests/host_vars/libvirt-freebsd-current/main.yml +++ b/guests/host_vars/libvirt-freebsd-current/main.yml @@ -4,11 +4,6 @@ ansible_python_interpreter: /usr/local/bin/python2 PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages =20 -bash: /usr/local/bin/bash -java: /usr/local/bin/java -su: /usr/bin/su -sudoers: /usr/local/etc/sudoers - projects: - libosinfo - libvirt diff --git a/guests/site.yml b/guests/site.yml index 46d2db6..063b0c6 100644 --- a/guests/site.yml +++ b/guests/site.yml @@ -48,6 +48,7 @@ - flavor =3D=3D "jenkins" =20 # Configure environment. Needs to happen after installing packages + - include: tasks/paths.yml - include: tasks/bootloader.yml - include: tasks/services.yml - include: tasks/kludges.yml diff --git a/guests/tasks/paths.yml b/guests/tasks/paths.yml new file mode 100644 index 0000000..36b699f --- /dev/null +++ b/guests/tasks/paths.yml @@ -0,0 +1,37 @@ +--- +- set_fact: + commands: {} + files: {} + +- name: 'Look for commands' + shell: 'which {{ item }} 2>/dev/null || true' + register: which + with_items: + - bash + - java + - su + +- name: 'Look for files' + shell: 'find /etc /usr/local/etc -name {{ item }} 2>/dev/null' + register: find + with_items: + - sudoers + +- set_fact: + commands: '{{ commands|combine({ item.item: item.stdout }) }}' + no_log: True + with_items: + '{{ which.results }}' + +- set_fact: + files: '{{ files|combine({ item.item: item.stdout }) }}' + no_log: True + with_items: + '{{ find.results }}' + +- name: 'Export paths' + set_fact: + bash: '{{ commands["bash"] }}' + java: '{{ commands["java"] }}' + su: '{{ commands["su"] }}' + sudoers: '{{ files["sudoers"] }}' --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 13:19:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524065147298122.37893185424093; Wed, 18 Apr 2018 08:25:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15BAD82DB; Wed, 18 Apr 2018 15:25:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A611475CF5; Wed, 18 Apr 2018 15:25:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 003E31805972; Wed, 18 Apr 2018 15:25:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IFPV3h006932 for ; Wed, 18 Apr 2018 11:25:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id E46BE7C26; Wed, 18 Apr 2018 15:25:30 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 887AF1C727 for ; Wed, 18 Apr 2018 15:25:30 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 17:25:20 +0200 Message-Id: <20180418152522.17923-4-abologna@redhat.com> In-Reply-To: <20180418152522.17923-1-abologna@redhat.com> References: <20180418152522.17923-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 3/5] guests: Figure out more OS-dependent paths ahead of time X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 18 Apr 2018 15:25:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We will need to know ccache's absolute path at the playbook level later on, so while we're at it we might as well treat all OS-dependent paths the same way and figure them out when configuring the guest rather than at login time. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- guests/tasks/paths.yml | 32 ++++++++++++++++++++++++++++++++ guests/templates/bashrc | 8 +++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/guests/tasks/paths.yml b/guests/tasks/paths.yml index 36b699f..00decc9 100644 --- a/guests/tasks/paths.yml +++ b/guests/tasks/paths.yml @@ -8,7 +8,12 @@ register: which with_items: - bash + - ccache + - gmake - java + - make + - python2 + - python3 - su =20 - name: 'Look for files' @@ -32,6 +37,33 @@ - name: 'Export paths' set_fact: bash: '{{ commands["bash"] }}' + ccache: '{{ commands["ccache"] }}' java: '{{ commands["java"] }}' su: '{{ commands["su"] }}' sudoers: '{{ files["sudoers"] }}' + +# Prefer gmake, fall back to make +- name: 'Export paths' + set_fact: + make: '{{ commands["gmake"] }}' + when: + - commands["gmake"] !=3D '' + +- name: 'Export paths' + set_fact: + make: '{{ commands["make"] }}' + when: + - make is undefined + +# Prefer python3, fall back to python2 +- name: 'Export paths' + set_fact: + python: '{{ commands["python3"] }}' + when: + - commands["python3"] !=3D '' + +- name: 'Export paths' + set_fact: + python: '{{ commands["python2"] }}' + when: + - python is undefined diff --git a/guests/templates/bashrc b/guests/templates/bashrc index e925cd9..65c82cd 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -11,9 +11,11 @@ export OSINFO_SYSTEM_DIR=3D"{{ OSINFO_SYSTEM_DIR }}" export PERL5LIB=3D"{{ PERL5LIB }}" export PYTHONPATH=3D"{{ PYTHONPATH }}" =20 -which python3 >/dev/null 2>&1 && export PYTHON=3D"python3" || export PYTHO= N=3D"python2" -which gmake >/dev/null 2>&1 && export MAKE=3D"gmake" || export MAKE=3D"mak= e" -which ccache >/dev/null 2>&1 && export CC=3D"ccache cc" +export CCACHE=3D"{{ ccache }}" +export MAKE=3D"{{ make }}" +export PYTHON=3D"{{ python }}" + +test "$CCACHE" && export CC=3D"$CCACHE cc" =20 # Enable bash completion. Only needed on FreeBSD, the system-wide # shell profile will take care of it for us everywhere else --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 13:19:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524065136035197.86665989056144; Wed, 18 Apr 2018 08:25:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C3F628203; Wed, 18 Apr 2018 15:25:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C66B805F6; Wed, 18 Apr 2018 15:25:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D54AC4CA99; Wed, 18 Apr 2018 15:25:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IFPVuM006939 for ; Wed, 18 Apr 2018 11:25:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 89E447C26; Wed, 18 Apr 2018 15:25:31 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C8DF1C727 for ; Wed, 18 Apr 2018 15:25:31 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 17:25:21 +0200 Message-Id: <20180418152522.17923-5-abologna@redhat.com> In-Reply-To: <20180418152522.17923-1-abologna@redhat.com> References: <20180418152522.17923-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 4/5] guests: Create ccache symlink farm X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 18 Apr 2018 15:25:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 place, setting $CC in the user's shell profile is no longer necessary. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- 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_ho= stname }}/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 @@ =20 - name: '{{ flavor }}: Configure ccache' file: - path: /home/{{ flavor }}/.ccache + path: /home/{{ flavor }}/.{{ item }} state: directory owner: '{{ flavor }}' group: '{{ flavor }}' + with_items: + - ccache + - ccache/bin =20 - name: '{{ flavor }}: Configure ccache' copy: @@ -65,6 +68,34 @@ owner: '{{ flavor }}' group: '{{ flavor }}' =20 +- name: '{{ flavor }}: Create ccache wrappers' + file: + src: '{{ ccache }}' + dest: /home/{{ flavor }}/.ccache/bin/{{ item }} + state: link + owner: '{{ flavor }}' + group: '{{ flavor }}' + with_items: + - cc + - clang + when: + - ccache !=3D '' + - os_name =3D=3D 'FreeBSD' + +- name: '{{ flavor }}: Create ccache wrappers' + file: + src: '{{ ccache }}' + dest: /home/{{ flavor }}/.ccache/bin/{{ item }} + state: link + owner: '{{ flavor }}' + group: '{{ flavor }}' + with_items: + - cc + - gcc + when: + - ccache !=3D '' + - os_name !=3D 'FreeBSD' + - name: '{{ flavor }}: Create shell profile' template: src: templates/{{ item }} diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 65c82cd..866087e 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -11,12 +11,9 @@ export OSINFO_SYSTEM_DIR=3D"{{ OSINFO_SYSTEM_DIR }}" export PERL5LIB=3D"{{ PERL5LIB }}" export PYTHONPATH=3D"{{ PYTHONPATH }}" =20 -export CCACHE=3D"{{ ccache }}" export MAKE=3D"{{ make }}" export PYTHON=3D"{{ python }}" =20 -test "$CCACHE" && export CC=3D"$CCACHE cc" - # Enable bash completion. Only needed on FreeBSD, the system-wide # shell profile will take care of it for us everywhere else bash_completion=3D/usr/local/share/bash-completion/bash_completion.sh --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 13:19:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524065147276121.02718376764585; Wed, 18 Apr 2018 08:25:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B97FD3130382; Wed, 18 Apr 2018 15:25:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40B9F7CA0B; Wed, 18 Apr 2018 15:25:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3DDA1180BAD5; Wed, 18 Apr 2018 15:25:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IFPW97006944 for ; Wed, 18 Apr 2018 11:25:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2CE401C727; Wed, 18 Apr 2018 15:25:32 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4A781C723 for ; Wed, 18 Apr 2018 15:25:31 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 17:25:22 +0200 Message-Id: <20180418152522.17923-6-abologna@redhat.com> In-Reply-To: <20180418152522.17923-1-abologna@redhat.com> References: <20180418152522.17923-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 5/5] jobs: Remove $CC override X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 18 Apr 2018 15:25:46 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Neither Go nor MinGW builds were able to deal with our previous way of enabling ccache correctly, which forced us to work around the issue at the job template level. Now that ccache is enabled in a completely transparent fashion through a symlink farm, we can drop the workaround. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- jobs/defaults.yaml | 6 ------ jobs/go.yaml | 8 -------- 2 files changed, 14 deletions(-) diff --git a/jobs/defaults.yaml b/jobs/defaults.yaml index 99e8b62..43686c5 100644 --- a/jobs/defaults.yaml +++ b/jobs/defaults.yaml @@ -23,17 +23,11 @@ global_env: | local_env: | mingw32_local_env: | - # The MinGW build needs to use the MinGW compiler toolchain, - # while $CC is pointing to the native toolchain, so we have - # to unset it here. - export CC=3D export VIRT_PREFIX=3D"$VIRT_PREFIX/i686-w64-mingw32/sys-root/mingw" export PKG_CONFIG_PATH=3D"$VIRT_PREFIX/lib/pkgconfig" export PKG_CONFIG_LIBDIR=3D"/usr/i686-w64-mingw32/sys-root/mingw/lib= /pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig" mingw32_autogen_args: --host=3Di686-w64-mingw32 mingw64_local_env: | - # See above - export CC=3D export VIRT_PREFIX=3D"$VIRT_PREFIX/x86_64-w64-mingw32/sys-root/mingw" export PKG_CONFIG_PATH=3D"$VIRT_PREFIX/lib/pkgconfig" export PKG_CONFIG_LIBDIR=3D"/usr/x86_64-w64-mingw32/sys-root/mingw/l= ib/pkgconfig:/usr/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig" diff --git a/jobs/go.yaml b/jobs/go.yaml index 9a349ca..bffe56e 100644 --- a/jobs/go.yaml +++ b/jobs/go.yaml @@ -42,11 +42,6 @@ - shell: | {global_env} {local_env} - # go doesn't handle the $CC variable containing whitespace - # correctly, so we have to make sure it's unset when building. - # See https://github.com/golang/go/issues/11685 - export CC=3D - go build -v publishers: - email: @@ -85,9 +80,6 @@ - shell: | {global_env} {local_env} - # See above - export CC=3D - go test $TEST_ARGS publishers: - email: --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list