[libvirt] [jenkins-ci PATCH 00/10] guests: Improve enviroment handling

The basic goal is to move all environment configuration that affects builds to a single place which is tracked along with all other changes to the CI environment. Patch 8/10 also happens to fix build of packages that depend on libvirt-perl on FreeBSD now that they've switched to Perl 5.26, though we haven't run into this specific problem yet due to other issues in the CI enviroment ;) Andrea Bolognani (10): guests: Rename compat -> kludges guests: Enable ~/.bashrc on FreeBSD guests: Add custom shell profile guests: Move ccache configuration to shell profile guests: Move make configuration to shell profile guests: Move $PATH configuration to shell profile guests: Add more enviroment variables to shell profile guests: Move Perl configuration to shell profile guests: Add Python configuration to shell profile guests: Remove per-host make variable guests/group_vars/all/main.yml | 15 ++++++++++--- guests/host_vars/libvirt-centos-6/main.yml | 3 +++ guests/host_vars/libvirt-centos-7/main.yml | 3 +++ guests/host_vars/libvirt-debian-8/main.yml | 3 +++ guests/host_vars/libvirt-debian-9/main.yml | 3 +++ guests/host_vars/libvirt-debian-sid/main.yml | 3 +++ guests/host_vars/libvirt-fedora-26/main.yml | 3 +++ guests/host_vars/libvirt-fedora-27/main.yml | 3 +++ guests/host_vars/libvirt-fedora-rawhide/main.yml | 3 +++ guests/host_vars/libvirt-freebsd-10/main.yml | 4 +++- guests/host_vars/libvirt-freebsd-11/main.yml | 4 +++- guests/host_vars/libvirt-freebsd-current/main.yml | 4 +++- guests/host_vars/libvirt-ubuntu-14/main.yml | 3 +++ guests/host_vars/libvirt-ubuntu-16/main.yml | 3 +++ guests/site.yml | 2 +- guests/tasks/{compat.yml => kludges.yml} | 18 +++++++++++++++ guests/tasks/users.yml | 27 +++++++++++------------ guests/templates/bash_profile | 1 + guests/templates/bashrc | 15 +++++++++++++ jobs/defaults.yaml | 6 ----- 20 files changed, 99 insertions(+), 27 deletions(-) rename guests/tasks/{compat.yml => kludges.yml} (59%) create mode 100644 guests/templates/bash_profile create mode 100644 guests/templates/bashrc -- 2.14.3

This task only contains workarounds that we shouldn't have to worry about to begin with, and that hopefully in due time we'll be able to drop entirely. Rename it to make this more apparent. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/site.yml | 2 +- guests/tasks/{compat.yml => kludges.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename guests/tasks/{compat.yml => kludges.yml} (100%) diff --git a/guests/site.yml b/guests/site.yml index 869291d..26127be 100644 --- a/guests/site.yml +++ b/guests/site.yml @@ -32,7 +32,7 @@ # Configure environment. Needs to happen after installing base packages - include: tasks/bootloader.yml - include: tasks/services.yml - - include: tasks/compat.yml + - include: tasks/kludges.yml - include: tasks/users.yml # Install build dependencies for each project diff --git a/guests/tasks/compat.yml b/guests/tasks/kludges.yml similarity index 100% rename from guests/tasks/compat.yml rename to guests/tasks/kludges.yml -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:11PM +0200, Andrea Bolognani wrote:
This task only contains workarounds that we shouldn't have to worry about to begin with, and that hopefully in due time we'll be able to drop entirely. Rename it to make this more apparent.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/site.yml | 2 +- guests/tasks/{compat.yml => kludges.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename guests/tasks/{compat.yml => kludges.yml} (100%)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

Due to the way bash is compiled on FreeBSD, we need to flip an extra switch in order to convince it to process the shell profile even when we're running commands non-interactively through ssh. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/kludges.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/guests/tasks/kludges.yml b/guests/tasks/kludges.yml index 001b5c6..0196559 100644 --- a/guests/tasks/kludges.yml +++ b/guests/tasks/kludges.yml @@ -29,3 +29,21 @@ when: - os_name == 'FreeBSD' - os_version == '11' + +# FreeBSD compiles bash without defining SSH_SOURCE_BASHRC, which means +# it won't try to detect when it's spawned by ssh and source ~/.bashrc +# when that's the case. Our workaround is setting $BASH_ENV globally +- name: Enable ~/.bashrc + replace: + path: /etc/login.conf + regexp: '^(.*):setenv=(BASH_ENV=[^,]*,)?(.*):\\$' + replace: '\1:setenv=BASH_ENV=~/.bashrc,\3:\\' + validate: 'cap_mkdb %s' + register: loginconf + when: + - os_name == 'FreeBSD' + +- name: Enable ~/.bashrc + command: cap_mkdb /etc/login.conf + when: + - loginconf.changed -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:12PM +0200, Andrea Bolognani wrote:
Due to the way bash is compiled on FreeBSD, we need to flip an extra switch in order to convince it to process the shell profile even when we're running commands non-interactively through ssh.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/kludges.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/guests/tasks/kludges.yml b/guests/tasks/kludges.yml index 001b5c6..0196559 100644 --- a/guests/tasks/kludges.yml +++ b/guests/tasks/kludges.yml @@ -29,3 +29,21 @@ when: - os_name == 'FreeBSD' - os_version == '11' + +# FreeBSD compiles bash without defining SSH_SOURCE_BASHRC, which means +# it won't try to detect when it's spawned by ssh and source ~/.bashrc +# when that's the case. Our workaround is setting $BASH_ENV globally
s/globally/globally./ Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

We want to take control of the user's environment. For now the custom shell profile only sets the prompt, but it will later be used to influence the build environment. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/users.yml | 17 +++++++++++++++++ guests/templates/bash_profile | 1 + guests/templates/bashrc | 1 + 3 files changed, 19 insertions(+) create mode 100644 guests/templates/bash_profile create mode 100644 guests/templates/bashrc diff --git a/guests/tasks/users.yml b/guests/tasks/users.yml index 1ecacee..8e59fa9 100644 --- a/guests/tasks/users.yml +++ b/guests/tasks/users.yml @@ -82,3 +82,20 @@ owner: '{{ flavor }}' group: '{{ flavor }}' create: yes + +- name: '{{ flavor }}: Create shell profile' + template: + src: templates/{{ item }} + dest: /home/{{ flavor }}/.{{ item }} + owner: '{{ flavor }}' + group: '{{ flavor }}' + with_items: + - bash_profile + - bashrc + +- name: '{{ flavor }}: Remove existing shell profile' + file: + path: /home/{{ flavor }}/.{{ item }} + state: absent + with_items: + - profile diff --git a/guests/templates/bash_profile b/guests/templates/bash_profile new file mode 100644 index 0000000..a82a60e --- /dev/null +++ b/guests/templates/bash_profile @@ -0,0 +1 @@ +test -f ~/.bashrc && . ~/.bashrc diff --git a/guests/templates/bashrc b/guests/templates/bashrc new file mode 100644 index 0000000..6640da6 --- /dev/null +++ b/guests/templates/bashrc @@ -0,0 +1 @@ +export PS1="[\u@\h \w]\$ " -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:13PM +0200, Andrea Bolognani wrote:
We want to take control of the user's environment. For now the custom shell profile only sets the prompt, but it will later be used to influence the build environment.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/users.yml | 17 +++++++++++++++++ guests/templates/bash_profile | 1 + guests/templates/bashrc | 1 + 3 files changed, 19 insertions(+) create mode 100644 guests/templates/bash_profile create mode 100644 guests/templates/bashrc
diff --git a/guests/tasks/users.yml b/guests/tasks/users.yml index 1ecacee..8e59fa9 100644 --- a/guests/tasks/users.yml +++ b/guests/tasks/users.yml @@ -82,3 +82,20 @@ owner: '{{ flavor }}' group: '{{ flavor }}' create: yes + +- name: '{{ flavor }}: Create shell profile' + template: + src: templates/{{ item }} + dest: /home/{{ flavor }}/.{{ item }} + owner: '{{ flavor }}' + group: '{{ flavor }}' + with_items: + - bash_profile + - bashrc + +- name: '{{ flavor }}: Remove existing shell profile' + file: + path: /home/{{ flavor }}/.{{ item }} + state: absent + with_items: + - profile diff --git a/guests/templates/bash_profile b/guests/templates/bash_profile new file mode 100644 index 0000000..a82a60e --- /dev/null +++ b/guests/templates/bash_profile @@ -0,0 +1 @@ +test -f ~/.bashrc && . ~/.bashrc diff --git a/guests/templates/bashrc b/guests/templates/bashrc new file mode 100644 index 0000000..6640da6 --- /dev/null +++ b/guests/templates/bashrc @@ -0,0 +1 @@ +export PS1="[\u@\h \w]\$ "
I think that we should also load the system profile /etc/profile .. in case of 'jenkins' flavor we don't actually need it since that is used in automated tests but in case of 'test' flavor when developer will manually login into the guests might miss some features configured by thy system profile. Pavel

On Fri, 2018-04-06 at 14:58 +0200, Pavel Hrdina wrote:
diff --git a/guests/templates/bash_profile b/guests/templates/bash_profile new file mode 100644 index 0000000..a82a60e --- /dev/null +++ b/guests/templates/bash_profile @@ -0,0 +1 @@ +test -f ~/.bashrc && . ~/.bashrc diff --git a/guests/templates/bashrc b/guests/templates/bashrc new file mode 100644 index 0000000..6640da6 --- /dev/null +++ b/guests/templates/bashrc @@ -0,0 +1 @@ +export PS1="[\u@\h \w]\$ "
I think that we should also load the system profile /etc/profile .. in case of 'jenkins' flavor we don't actually need it since that is used in automated tests but in case of 'test' flavor when developer will manually login into the guests might miss some features configured by thy system profile.
What kind of features are you thinking about, exactly? /etc/profile can vary significantly between Linux versions, and on FreeBSD it's not even loaded when using bash as the login shell IIUC; however, in all cases the resulting environment is generally pretty sane, so adding our own custom settings on top through the user's profile works nicely. Moreover, overriding setting in the user's profile instead of tweaking them globally is a better approach in general IMHO, so if there are specific features you'd like to address I would still rather deal with them in the user's profile if at all possible. -- Andrea Bolognani / Red Hat / Virtualization

On Fri, 2018-04-06 at 15:10 +0200, Andrea Bolognani wrote:
I think that we should also load the system profile /etc/profile .. in case of 'jenkins' flavor we don't actually need it since that is used in automated tests but in case of 'test' flavor when developer will manually login into the guests might miss some features configured by thy system profile.
What kind of features are you thinking about, exactly?
/etc/profile can vary significantly between Linux versions, and on FreeBSD it's not even loaded when using bash as the login shell IIUC; however, in all cases the resulting environment is generally pretty sane, so adding our own custom settings on top through the user's profile works nicely.
Moreover, overriding setting in the user's profile instead of tweaking them globally is a better approach in general IMHO, so if there are specific features you'd like to address I would still rather deal with them in the user's profile if at all possible.
Okay, so it looks like I misunderstood your comment: you were advocating for sourcing /etc/profile in the user's shell profile. bash will actually load that file regardless, and on all Linux distributions the result is that features such as bash completion will be available to the user right after login, even with our custom shell profile in place. FreeBSD, of course, behaves a little differently ;) You have to source the bash_completion script manually if you want that feature, as /etc/profile is tailored to the classic Bourne shell so it won't do that for you, and there is no such thing as a global bashrc that you can use. All in all, it's pretty simple to add, but I think it's okay for it to be a follow-up patch. Are there more features you had in mind? -- Andrea Bolognani / Red Hat / Virtualization

On Fri, Apr 06, 2018 at 04:39:44PM +0200, Andrea Bolognani wrote:
On Fri, 2018-04-06 at 15:10 +0200, Andrea Bolognani wrote:
I think that we should also load the system profile /etc/profile .. in case of 'jenkins' flavor we don't actually need it since that is used in automated tests but in case of 'test' flavor when developer will manually login into the guests might miss some features configured by thy system profile.
What kind of features are you thinking about, exactly?
/etc/profile can vary significantly between Linux versions, and on FreeBSD it's not even loaded when using bash as the login shell IIUC; however, in all cases the resulting environment is generally pretty sane, so adding our own custom settings on top through the user's profile works nicely.
Moreover, overriding setting in the user's profile instead of tweaking them globally is a better approach in general IMHO, so if there are specific features you'd like to address I would still rather deal with them in the user's profile if at all possible.
Okay, so it looks like I misunderstood your comment: you were advocating for sourcing /etc/profile in the user's shell profile.
bash will actually load that file regardless, and on all Linux distributions the result is that features such as bash completion will be available to the user right after login, even with our custom shell profile in place.
FreeBSD, of course, behaves a little differently ;) You have to source the bash_completion script manually if you want that feature, as /etc/profile is tailored to the classic Bourne shell so it won't do that for you, and there is no such thing as a global bashrc that you can use.
All in all, it's pretty simple to add, but I think it's okay for it to be a follow-up patch. Are there more features you had in mind?
In that case and for FreeBSD there is no need to handle it. I was mostly concerned about Linux distributions. Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

Now that we have our custom shell profile, making sure ccache is used is way simpler. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/users.yml | 18 ------------------ guests/templates/bashrc | 2 ++ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/guests/tasks/users.yml b/guests/tasks/users.yml index 8e59fa9..e691b32 100644 --- a/guests/tasks/users.yml +++ b/guests/tasks/users.yml @@ -65,24 +65,6 @@ owner: '{{ flavor }}' group: '{{ flavor }}' -- name: '{{ flavor }}: Enable ccache' - lineinfile: - path: /home/{{ flavor }}/.profile - line: 'which ccache >/dev/null 2>&1 && export CC="ccache cc"' - state: present - owner: '{{ flavor }}' - group: '{{ flavor }}' - create: yes - -- name: '{{ flavor }}: Enable ccache' - lineinfile: - path: /home/{{ flavor }}/.bashrc - line: 'which ccache >/dev/null 2>&1 && export CC="ccache cc"' - state: present - owner: '{{ flavor }}' - group: '{{ flavor }}' - create: yes - - name: '{{ flavor }}: Create shell profile' template: src: templates/{{ item }} diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 6640da6..51d0e64 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -1 +1,3 @@ export PS1="[\u@\h \w]\$ " + +which ccache >/dev/null 2>&1 && export CC="ccache cc" -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:14PM +0200, Andrea Bolognani wrote:
Now that we have our custom shell profile, making sure ccache is used is way simpler.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/users.yml | 18 ------------------ guests/templates/bashrc | 2 ++ 2 files changed, 2 insertions(+), 18 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

On Thu, Apr 05, 2018 at 02:22:14PM +0200, Andrea Bolognani wrote:
Now that we have our custom shell profile, making sure ccache is used is way simpler.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/users.yml | 18 ------------------ guests/templates/bashrc | 2 ++ 2 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/guests/tasks/users.yml b/guests/tasks/users.yml index 8e59fa9..e691b32 100644 --- a/guests/tasks/users.yml +++ b/guests/tasks/users.yml @@ -65,24 +65,6 @@ owner: '{{ flavor }}' group: '{{ flavor }}'
-- name: '{{ flavor }}: Enable ccache' - lineinfile: - path: /home/{{ flavor }}/.profile - line: 'which ccache >/dev/null 2>&1 && export CC="ccache cc"' - state: present - owner: '{{ flavor }}' - group: '{{ flavor }}' - create: yes - -- name: '{{ flavor }}: Enable ccache' - lineinfile: - path: /home/{{ flavor }}/.bashrc - line: 'which ccache >/dev/null 2>&1 && export CC="ccache cc"' - state: present - owner: '{{ flavor }}' - group: '{{ flavor }}' - create: yes - - name: '{{ flavor }}: Create shell profile' template: src: templates/{{ item }} diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 6640da6..51d0e64 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -1 +1,3 @@ export PS1="[\u@\h \w]\$ " + +which ccache >/dev/null 2>&1 && export CC="ccache cc"
IIUC, this appears to have broken the Go compiler. Unsetting 'CC' makes it work again. IIUC this wasn't a problem with normal Fedora setup for ccache, because that doesn't set 'CC', it just puts the ccache 'gcc' binary into $PATH. It looks like its a limitation of "Go" - it doesn't like it when "CC" contains multiple words - it drops everything except the first word. So when we set CC="ccache cc", go just runs "ccache $args" instead of "ccache cc $args" Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Thu, 2018-04-12 at 13:09 +0100, Daniel P. Berrangé wrote:
IIUC, this appears to have broken the Go compiler. Unsetting 'CC' makes it work again. IIUC this wasn't a problem with normal Fedora setup for ccache, because that doesn't set 'CC', it just puts the ccache 'gcc' binary into $PATH.
It looks like its a limitation of "Go" - it doesn't like it when "CC" contains multiple words - it drops everything except the first word. So when we set CC="ccache cc", go just runs "ccache $args" instead of "ccache cc $args"
MinGW (or at least the way we do MinGW builds) has a similar issue. I've posted a workaround: https://www.redhat.com/archives/libvir-list/2018-April/msg01000.html -- Andrea Bolognani / Red Hat / Virtualization

Now that we have our custom shell profile, we can pick the correct make variant dynamically there instead of doing it in the Jenkins job definition, so that the $MAKE variable will also be available when using the guests outside of the CI environment. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/templates/bashrc | 1 + jobs/defaults.yaml | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 51d0e64..6bc0a56 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -1,3 +1,4 @@ export PS1="[\u@\h \w]\$ " +which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="ccache cc" diff --git a/jobs/defaults.yaml b/jobs/defaults.yaml index cc58314..1eb77d9 100644 --- a/jobs/defaults.yaml +++ b/jobs/defaults.yaml @@ -4,11 +4,6 @@ branch: master node: libvirt global_env: | - MAKE='make' - unamestr=`uname` - if [ "$unamestr" = 'FreeBSD' ]; then - MAKE='gmake' - fi export PATH=$VIRT_PREFIX/bin:$PATH local_env: | smp: 3 -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:15PM +0200, Andrea Bolognani wrote:
Now that we have our custom shell profile, we can pick the correct make variant dynamically there instead of doing it in the Jenkins job definition, so that the $MAKE variable will also be available when using the guests outside of the CI environment.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/templates/bashrc | 1 + jobs/defaults.yaml | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

Same as for $MAKE, moving the configuration here makes it easier to reproduce issues outside of the CI environment. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 6 ++++-- guests/templates/bashrc | 2 ++ jobs/defaults.yaml | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index dbe9517..ee53eec 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -8,8 +8,10 @@ ansible_ssh_pass: root jenkins_url: https://ci.centos.org/computer/{{ inventory_hostname }}/slave-agent.jnlp -# Paths to various commands and files that might be OS-dependent. Can -# be overridden on a per-host basis +# Environment variables and paths to commands/files that might be +# OS-dependent. Can be overridden on a per-host basis +PATH: $VIRT_PREFIX/bin:$PATH + bash: /bin/bash java: /usr/bin/java make: /usr/bin/make diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 6bc0a56..affdf4c 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -1,4 +1,6 @@ export PS1="[\u@\h \w]\$ " +export PATH="{{ PATH }}" + which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="ccache cc" diff --git a/jobs/defaults.yaml b/jobs/defaults.yaml index 1eb77d9..23f8555 100644 --- a/jobs/defaults.yaml +++ b/jobs/defaults.yaml @@ -4,7 +4,6 @@ branch: master node: libvirt global_env: | - export PATH=$VIRT_PREFIX/bin:$PATH local_env: | smp: 3 spam: ymankad@redhat.com libvirt-ci@redhat.com -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:16PM +0200, Andrea Bolognani wrote:
Same as for $MAKE, moving the configuration here makes it easier to reproduce issues outside of the CI environment.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 6 ++++-- guests/templates/bashrc | 2 ++ jobs/defaults.yaml | 1 - 3 files changed, 6 insertions(+), 3 deletions(-)
This should be probably moved after the following patch since it uses VIRT_PREFIX. Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

On Fri, 2018-04-06 at 17:03 +0200, Pavel Hrdina wrote:
On Thu, Apr 05, 2018 at 02:22:16PM +0200, Andrea Bolognani wrote:
Same as for $MAKE, moving the configuration here makes it easier to reproduce issues outside of the CI environment.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 6 ++++-- guests/templates/bashrc | 2 ++ jobs/defaults.yaml | 1 - 3 files changed, 6 insertions(+), 3 deletions(-)
This should be probably moved after the following patch since it uses VIRT_PREFIX.
Good point. I'll swap them. -- Andrea Bolognani / Red Hat / Virtualization

All these are currently defined per-worker at the Jenkins level, which has several disadvantages: first of all, they are completely invisible to anyone except people with admin access to the Jenkins instance; moreover, updating them requires a lot of clicking in the web interface, and change history is not tracked. Moving their configuration to the shell profile solves all those issues. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 6 ++++++ guests/templates/bashrc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index ee53eec..c5166bc 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -10,7 +10,13 @@ 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 +C_INCLUDE_PATH: $VIRT_PREFIX/include +LD_LIBRARY_PATH: $VIRT_PREFIX/lib +PKG_CONFIG_PATH: $VIRT_PREFIX/lib/pkgconfig +XDG_DATA_DIRS: $VIRT_PREFIX/share:/usr/share:/usr/local/share +GI_TYPELIB_PATH: $VIRT_PREFIX/lib/girepository-1.0 bash: /bin/bash java: /usr/bin/java diff --git a/guests/templates/bashrc b/guests/templates/bashrc index affdf4c..721272a 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -1,6 +1,12 @@ export PS1="[\u@\h \w]\$ " +export VIRT_PREFIX="{{ VIRT_PREFIX }}" export PATH="{{ PATH }}" +export C_INCLUDE_PATH="{{ C_INCLUDE_PATH }}" +export LD_LIBRARY_PATH="{{ LD_LIBRARY_PATH }}" +export PKG_CONFIG_PATH="{{ PKG_CONFIG_PATH }}" +export XDG_DATA_DIRS="{{ XDG_DATA_DIRS }}" +export GI_TYPELIB_PATH="{{ GI_TYPELIB_PATH }}" which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="ccache cc" -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:17PM +0200, Andrea Bolognani wrote:
All these are currently defined per-worker at the Jenkins level, which has several disadvantages: first of all, they are completely invisible to anyone except people with admin access to the Jenkins instance; moreover, updating them requires a lot of clicking in the web interface, and change history is not tracked. Moving their configuration to the shell profile solves all those issues.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 6 ++++++ guests/templates/bashrc | 6 ++++++ 2 files changed, 12 insertions(+)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

Same as for $VIRT_PREFIX and friends, we want these to be tracked along with the rest of the CI setup instead of being a completely opaque, side-loaded blob. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 + guests/host_vars/libvirt-centos-6/main.yml | 2 ++ guests/host_vars/libvirt-centos-7/main.yml | 2 ++ guests/host_vars/libvirt-debian-8/main.yml | 2 ++ guests/host_vars/libvirt-debian-9/main.yml | 2 ++ guests/host_vars/libvirt-debian-sid/main.yml | 2 ++ guests/host_vars/libvirt-fedora-26/main.yml | 2 ++ guests/host_vars/libvirt-fedora-27/main.yml | 2 ++ guests/host_vars/libvirt-fedora-rawhide/main.yml | 2 ++ guests/host_vars/libvirt-freebsd-10/main.yml | 2 ++ guests/host_vars/libvirt-freebsd-11/main.yml | 2 ++ guests/host_vars/libvirt-freebsd-current/main.yml | 2 ++ guests/host_vars/libvirt-ubuntu-14/main.yml | 2 ++ guests/host_vars/libvirt-ubuntu-16/main.yml | 2 ++ guests/templates/bashrc | 1 + 15 files changed, 28 insertions(+) diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index c5166bc..6456bd5 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -17,6 +17,7 @@ LD_LIBRARY_PATH: $VIRT_PREFIX/lib PKG_CONFIG_PATH: $VIRT_PREFIX/lib/pkgconfig XDG_DATA_DIRS: $VIRT_PREFIX/share:/usr/share:/usr/local/share GI_TYPELIB_PATH: $VIRT_PREFIX/lib/girepository-1.0 +PERL5LIB: bash: /bin/bash java: /usr/bin/java diff --git a/guests/host_vars/libvirt-centos-6/main.yml b/guests/host_vars/libvirt-centos-6/main.yml index f7e383d..2265615 100644 --- a/guests/host_vars/libvirt-centos-6/main.yml +++ b/guests/host_vars/libvirt-centos-6/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib64/perl5 + projects: - libvirt - libvirt-cim diff --git a/guests/host_vars/libvirt-centos-7/main.yml b/guests/host_vars/libvirt-centos-7/main.yml index 155da25..3068bb1 100644 --- a/guests/host_vars/libvirt-centos-7/main.yml +++ b/guests/host_vars/libvirt-centos-7/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib64/perl5 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-debian-8/main.yml b/guests/host_vars/libvirt-debian-8/main.yml index 43503ce..76c0076 100644 --- a/guests/host_vars/libvirt-debian-8/main.yml +++ b/guests/host_vars/libvirt-debian-8/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.20.2 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-debian-9/main.yml b/guests/host_vars/libvirt-debian-9/main.yml index cde85bd..45bc9de 100644 --- a/guests/host_vars/libvirt-debian-9/main.yml +++ b/guests/host_vars/libvirt-debian-9/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.24.1 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-debian-sid/main.yml b/guests/host_vars/libvirt-debian-sid/main.yml index cde85bd..96b49d2 100644 --- a/guests/host_vars/libvirt-debian-sid/main.yml +++ b/guests/host_vars/libvirt-debian-sid/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.26.1 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-fedora-26/main.yml b/guests/host_vars/libvirt-fedora-26/main.yml index 1098d8a..b21e829 100644 --- a/guests/host_vars/libvirt-fedora-26/main.yml +++ b/guests/host_vars/libvirt-fedora-26/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib64/perl5 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-fedora-27/main.yml b/guests/host_vars/libvirt-fedora-27/main.yml index 1098d8a..b21e829 100644 --- a/guests/host_vars/libvirt-fedora-27/main.yml +++ b/guests/host_vars/libvirt-fedora-27/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib64/perl5 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host_vars/libvirt-fedora-rawhide/main.yml index 1098d8a..b21e829 100644 --- a/guests/host_vars/libvirt-fedora-rawhide/main.yml +++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib64/perl5 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml b/guests/host_vars/libvirt-freebsd-10/main.yml index 2f7bced..dc1a018 100644 --- a/guests/host_vars/libvirt-freebsd-10/main.yml +++ b/guests/host_vars/libvirt-freebsd-10/main.yml @@ -1,6 +1,8 @@ --- ansible_python_interpreter: /usr/local/bin/python2 +PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 + bash: /usr/local/bin/bash java: /usr/local/bin/java make: /usr/local/bin/gmake diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_vars/libvirt-freebsd-11/main.yml index 2f7bced..dc1a018 100644 --- a/guests/host_vars/libvirt-freebsd-11/main.yml +++ b/guests/host_vars/libvirt-freebsd-11/main.yml @@ -1,6 +1,8 @@ --- ansible_python_interpreter: /usr/local/bin/python2 +PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 + bash: /usr/local/bin/bash java: /usr/local/bin/java make: /usr/local/bin/gmake diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/host_vars/libvirt-freebsd-current/main.yml index 2f7bced..dc1a018 100644 --- a/guests/host_vars/libvirt-freebsd-current/main.yml +++ b/guests/host_vars/libvirt-freebsd-current/main.yml @@ -1,6 +1,8 @@ --- ansible_python_interpreter: /usr/local/bin/python2 +PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 + bash: /usr/local/bin/bash java: /usr/local/bin/java make: /usr/local/bin/gmake diff --git a/guests/host_vars/libvirt-ubuntu-14/main.yml b/guests/host_vars/libvirt-ubuntu-14/main.yml index 4a58ee7..a4e8849 100644 --- a/guests/host_vars/libvirt-ubuntu-14/main.yml +++ b/guests/host_vars/libvirt-ubuntu-14/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib/perl/5.18.2 + projects: - libosinfo - libvirt diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml b/guests/host_vars/libvirt-ubuntu-16/main.yml index 9794467..34c5a87 100644 --- a/guests/host_vars/libvirt-ubuntu-16/main.yml +++ b/guests/host_vars/libvirt-ubuntu-16/main.yml @@ -1,4 +1,6 @@ --- +PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.22.1 + projects: - libosinfo - libvirt diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 721272a..a508910 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -7,6 +7,7 @@ export LD_LIBRARY_PATH="{{ LD_LIBRARY_PATH }}" export PKG_CONFIG_PATH="{{ PKG_CONFIG_PATH }}" export XDG_DATA_DIRS="{{ XDG_DATA_DIRS }}" export GI_TYPELIB_PATH="{{ GI_TYPELIB_PATH }}" +export PERL5LIB="{{ PERL5LIB }}" which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="ccache cc" -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:18PM +0200, Andrea Bolognani wrote:
Same as for $VIRT_PREFIX and friends, we want these to be tracked along with the rest of the CI setup instead of being a completely opaque, side-loaded blob.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 + guests/host_vars/libvirt-centos-6/main.yml | 2 ++ guests/host_vars/libvirt-centos-7/main.yml | 2 ++ guests/host_vars/libvirt-debian-8/main.yml | 2 ++ guests/host_vars/libvirt-debian-9/main.yml | 2 ++ guests/host_vars/libvirt-debian-sid/main.yml | 2 ++ guests/host_vars/libvirt-fedora-26/main.yml | 2 ++ guests/host_vars/libvirt-fedora-27/main.yml | 2 ++ guests/host_vars/libvirt-fedora-rawhide/main.yml | 2 ++ guests/host_vars/libvirt-freebsd-10/main.yml | 2 ++ guests/host_vars/libvirt-freebsd-11/main.yml | 2 ++ guests/host_vars/libvirt-freebsd-current/main.yml | 2 ++ guests/host_vars/libvirt-ubuntu-14/main.yml | 2 ++ guests/host_vars/libvirt-ubuntu-16/main.yml | 2 ++ guests/templates/bashrc | 1 + 15 files changed, 28 insertions(+)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

This is conceptually identical to how Perl is handled, except that we still need to override $PYTHONPATH in Jenkins jobs in order to be able to build projects using both Python 3 and Python 2 on the same guest. We might want to reconsider that decision, but for the time being this change is still helpful to people running guests outside of the CI environment. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 + guests/host_vars/libvirt-centos-6/main.yml | 1 + guests/host_vars/libvirt-centos-7/main.yml | 1 + guests/host_vars/libvirt-debian-8/main.yml | 1 + guests/host_vars/libvirt-debian-9/main.yml | 1 + guests/host_vars/libvirt-debian-sid/main.yml | 1 + guests/host_vars/libvirt-fedora-26/main.yml | 1 + guests/host_vars/libvirt-fedora-27/main.yml | 1 + guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 + guests/host_vars/libvirt-freebsd-10/main.yml | 1 + guests/host_vars/libvirt-freebsd-11/main.yml | 1 + guests/host_vars/libvirt-freebsd-current/main.yml | 1 + guests/host_vars/libvirt-ubuntu-14/main.yml | 1 + guests/host_vars/libvirt-ubuntu-16/main.yml | 1 + guests/templates/bashrc | 2 ++ 15 files changed, 16 insertions(+) diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index 6456bd5..fb83a56 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -18,6 +18,7 @@ PKG_CONFIG_PATH: $VIRT_PREFIX/lib/pkgconfig XDG_DATA_DIRS: $VIRT_PREFIX/share:/usr/share:/usr/local/share GI_TYPELIB_PATH: $VIRT_PREFIX/lib/girepository-1.0 PERL5LIB: +PYTHONPATH: bash: /bin/bash java: /usr/bin/java diff --git a/guests/host_vars/libvirt-centos-6/main.yml b/guests/host_vars/libvirt-centos-6/main.yml index 2265615..422d033 100644 --- a/guests/host_vars/libvirt-centos-6/main.yml +++ b/guests/host_vars/libvirt-centos-6/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python2.6/site-packages projects: - libvirt diff --git a/guests/host_vars/libvirt-centos-7/main.yml b/guests/host_vars/libvirt-centos-7/main.yml index 3068bb1..935ab15 100644 --- a/guests/host_vars/libvirt-centos-7/main.yml +++ b/guests/host_vars/libvirt-centos-7/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python2.7/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-debian-8/main.yml b/guests/host_vars/libvirt-debian-8/main.yml index 76c0076..bfd074d 100644 --- a/guests/host_vars/libvirt-debian-8/main.yml +++ b/guests/host_vars/libvirt-debian-8/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.20.2 +PYTHONPATH: $VIRT_PREFIX/lib/python3.4/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-debian-9/main.yml b/guests/host_vars/libvirt-debian-9/main.yml index 45bc9de..bdaa00d 100644 --- a/guests/host_vars/libvirt-debian-9/main.yml +++ b/guests/host_vars/libvirt-debian-9/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.24.1 +PYTHONPATH: $VIRT_PREFIX/lib/python3.5/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-debian-sid/main.yml b/guests/host_vars/libvirt-debian-sid/main.yml index 96b49d2..cb61b6e 100644 --- a/guests/host_vars/libvirt-debian-sid/main.yml +++ b/guests/host_vars/libvirt-debian-sid/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.26.1 +PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-fedora-26/main.yml b/guests/host_vars/libvirt-fedora-26/main.yml index b21e829..732df24 100644 --- a/guests/host_vars/libvirt-fedora-26/main.yml +++ b/guests/host_vars/libvirt-fedora-26/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-fedora-27/main.yml b/guests/host_vars/libvirt-fedora-27/main.yml index b21e829..732df24 100644 --- a/guests/host_vars/libvirt-fedora-27/main.yml +++ b/guests/host_vars/libvirt-fedora-27/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host_vars/libvirt-fedora-rawhide/main.yml index b21e829..732df24 100644 --- a/guests/host_vars/libvirt-fedora-rawhide/main.yml +++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml b/guests/host_vars/libvirt-freebsd-10/main.yml index dc1a018..4d57042 100644 --- a/guests/host_vars/libvirt-freebsd-10/main.yml +++ b/guests/host_vars/libvirt-freebsd-10/main.yml @@ -2,6 +2,7 @@ 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 bash: /usr/local/bin/bash java: /usr/local/bin/java diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_vars/libvirt-freebsd-11/main.yml index dc1a018..4d57042 100644 --- a/guests/host_vars/libvirt-freebsd-11/main.yml +++ b/guests/host_vars/libvirt-freebsd-11/main.yml @@ -2,6 +2,7 @@ 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 bash: /usr/local/bin/bash java: /usr/local/bin/java diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/host_vars/libvirt-freebsd-current/main.yml index dc1a018..4d57042 100644 --- a/guests/host_vars/libvirt-freebsd-current/main.yml +++ b/guests/host_vars/libvirt-freebsd-current/main.yml @@ -2,6 +2,7 @@ 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 bash: /usr/local/bin/bash java: /usr/local/bin/java diff --git a/guests/host_vars/libvirt-ubuntu-14/main.yml b/guests/host_vars/libvirt-ubuntu-14/main.yml index a4e8849..b404a5a 100644 --- a/guests/host_vars/libvirt-ubuntu-14/main.yml +++ b/guests/host_vars/libvirt-ubuntu-14/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/perl/5.18.2 +PYTHONPATH: $VIRT_PREFIX/lib/python3.4/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml b/guests/host_vars/libvirt-ubuntu-16/main.yml index 34c5a87..7991608 100644 --- a/guests/host_vars/libvirt-ubuntu-16/main.yml +++ b/guests/host_vars/libvirt-ubuntu-16/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.22.1 +PYTHONPATH: $VIRT_PREFIX/lib/python3.5/site-packages projects: - libosinfo diff --git a/guests/templates/bashrc b/guests/templates/bashrc index a508910..95bb172 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -8,6 +8,8 @@ export PKG_CONFIG_PATH="{{ PKG_CONFIG_PATH }}" export XDG_DATA_DIRS="{{ XDG_DATA_DIRS }}" export GI_TYPELIB_PATH="{{ GI_TYPELIB_PATH }}" export PERL5LIB="{{ PERL5LIB }}" +export PYTHONPATH="{{ PYTHONPATH }}" +which python3 >/dev/null 2>&1 && export PYTHON="python3" || export PYTHON="python2" which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="ccache cc" -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:19PM +0200, Andrea Bolognani wrote:
This is conceptually identical to how Perl is handled, except that we still need to override $PYTHONPATH in Jenkins jobs in order to be able to build projects using both Python 3 and Python 2 on the same guest. We might want to reconsider that decision, but for the time being this change is still helpful to people running guests outside of the CI environment.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 + guests/host_vars/libvirt-centos-6/main.yml | 1 + guests/host_vars/libvirt-centos-7/main.yml | 1 + guests/host_vars/libvirt-debian-8/main.yml | 1 + guests/host_vars/libvirt-debian-9/main.yml | 1 + guests/host_vars/libvirt-debian-sid/main.yml | 1 + guests/host_vars/libvirt-fedora-26/main.yml | 1 + guests/host_vars/libvirt-fedora-27/main.yml | 1 + guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 + guests/host_vars/libvirt-freebsd-10/main.yml | 1 + guests/host_vars/libvirt-freebsd-11/main.yml | 1 + guests/host_vars/libvirt-freebsd-current/main.yml | 1 + guests/host_vars/libvirt-ubuntu-14/main.yml | 1 + guests/host_vars/libvirt-ubuntu-16/main.yml | 1 + guests/templates/bashrc | 2 ++ 15 files changed, 16 insertions(+)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

We are figuring out which make binary we should use dynamically in the shell profile now, so this variable is redundant; plus, we were not actually using it anywhere. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 - guests/host_vars/libvirt-freebsd-10/main.yml | 1 - guests/host_vars/libvirt-freebsd-11/main.yml | 1 - guests/host_vars/libvirt-freebsd-current/main.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index fb83a56..4229e73 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -22,6 +22,5 @@ PYTHONPATH: bash: /bin/bash java: /usr/bin/java -make: /usr/bin/make su: /bin/su sudoers: /etc/sudoers diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml b/guests/host_vars/libvirt-freebsd-10/main.yml index 4d57042..05e1955 100644 --- a/guests/host_vars/libvirt-freebsd-10/main.yml +++ b/guests/host_vars/libvirt-freebsd-10/main.yml @@ -6,7 +6,6 @@ PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages bash: /usr/local/bin/bash java: /usr/local/bin/java -make: /usr/local/bin/gmake su: /usr/bin/su sudoers: /usr/local/etc/sudoers diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_vars/libvirt-freebsd-11/main.yml index 4d57042..05e1955 100644 --- a/guests/host_vars/libvirt-freebsd-11/main.yml +++ b/guests/host_vars/libvirt-freebsd-11/main.yml @@ -6,7 +6,6 @@ PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages bash: /usr/local/bin/bash java: /usr/local/bin/java -make: /usr/local/bin/gmake su: /usr/bin/su sudoers: /usr/local/etc/sudoers diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/host_vars/libvirt-freebsd-current/main.yml index 4d57042..05e1955 100644 --- a/guests/host_vars/libvirt-freebsd-current/main.yml +++ b/guests/host_vars/libvirt-freebsd-current/main.yml @@ -6,7 +6,6 @@ PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages bash: /usr/local/bin/bash java: /usr/local/bin/java -make: /usr/local/bin/gmake su: /usr/bin/su sudoers: /usr/local/etc/sudoers -- 2.14.3

On Thu, Apr 05, 2018 at 02:22:20PM +0200, Andrea Bolognani wrote:
We are figuring out which make binary we should use dynamically in the shell profile now, so this variable is redundant; plus, we were not actually using it anywhere.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 - guests/host_vars/libvirt-freebsd-10/main.yml | 1 - guests/host_vars/libvirt-freebsd-11/main.yml | 1 - guests/host_vars/libvirt-freebsd-current/main.yml | 1 - 4 files changed, 4 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

This belongs with all the other enviroment settings, but it was somehow missed the first time around. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 + guests/templates/bashrc | 1 + projects/libosinfo.yaml | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index 4229e73..2bdb7b3 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -17,6 +17,7 @@ LD_LIBRARY_PATH: $VIRT_PREFIX/lib PKG_CONFIG_PATH: $VIRT_PREFIX/lib/pkgconfig XDG_DATA_DIRS: $VIRT_PREFIX/share:/usr/share:/usr/local/share GI_TYPELIB_PATH: $VIRT_PREFIX/lib/girepository-1.0 +OSINFO_SYSTEM_DIR: $VIRT_PREFIX/share/osinfo PERL5LIB: PYTHONPATH: diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 95bb172..639a961 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -7,6 +7,7 @@ export LD_LIBRARY_PATH="{{ LD_LIBRARY_PATH }}" export PKG_CONFIG_PATH="{{ PKG_CONFIG_PATH }}" export XDG_DATA_DIRS="{{ XDG_DATA_DIRS }}" export GI_TYPELIB_PATH="{{ GI_TYPELIB_PATH }}" +export OSINFO_SYSTEM_DIR="{{ OSINFO_SYSTEM_DIR }}" export PERL5LIB="{{ PERL5LIB }}" export PYTHONPATH="{{ PYTHONPATH }}" diff --git a/projects/libosinfo.yaml b/projects/libosinfo.yaml index efe66c9..ac04027 100644 --- a/projects/libosinfo.yaml +++ b/projects/libosinfo.yaml @@ -11,8 +11,6 @@ - libvirt-freebsd-10 - libvirt-freebsd-11 title: libosinfo - local_env: | - export OSINFO_SYSTEM_DIR=$VIRT_PREFIX/share/osinfo jobs: - autotools-build-job: parent_jobs: 'osinfo-db-master-build' -- 2.14.3

On Fri, Apr 06, 2018 at 01:40:18PM +0200, Andrea Bolognani wrote:
This belongs with all the other enviroment settings, but it was somehow missed the first time around.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/group_vars/all/main.yml | 1 + guests/templates/bashrc | 1 + projects/libosinfo.yaml | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

In order for bash completion to be available right after login we need to make sure the corresponding package is installed and, for FreeBSD only, the enviroment script gets sourced. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/templates/bashrc | 5 +++++ guests/vars/projects/base.yml | 1 + guests/vars/projects/libvirt.yml | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 639a961..e925cd9 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -14,3 +14,8 @@ export PYTHONPATH="{{ PYTHONPATH }}" which python3 >/dev/null 2>&1 && export PYTHON="python3" || export PYTHON="python2" which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="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=/usr/local/share/bash-completion/bash_completion.sh +test -f "$bash_completion" && . "$bash_completion" diff --git a/guests/vars/projects/base.yml b/guests/vars/projects/base.yml index a0483d8..49d4d2e 100644 --- a/guests/vars/projects/base.yml +++ b/guests/vars/projects/base.yml @@ -4,6 +4,7 @@ packages: - automake - autopoint - bash + - bash-completion - ccache - chrony - cppi diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml index 9f027f8..598dfc4 100644 --- a/guests/vars/projects/libvirt.yml +++ b/guests/vars/projects/libvirt.yml @@ -3,7 +3,6 @@ packages: - apparmor - augeas - avahi - - bash-completion - cyrus-sasl - device-mapper - dnsmasq -- 2.14.3

On Fri, Apr 06, 2018 at 05:22:37PM +0200, Andrea Bolognani wrote:
In order for bash completion to be available right after login we need to make sure the corresponding package is installed and, for FreeBSD only, the enviroment script gets sourced.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/templates/bashrc | 5 +++++ guests/vars/projects/base.yml | 1 + guests/vars/projects/libvirt.yml | 1 - 3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/guests/templates/bashrc b/guests/templates/bashrc index 639a961..e925cd9 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -14,3 +14,8 @@ export PYTHONPATH="{{ PYTHONPATH }}" which python3 >/dev/null 2>&1 && export PYTHON="python3" || export PYTHON="python2" which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="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=/usr/local/share/bash-completion/bash_completion.sh +test -f "$bash_completion" && . "$bash_completion" diff --git a/guests/vars/projects/base.yml b/guests/vars/projects/base.yml index a0483d8..49d4d2e 100644 --- a/guests/vars/projects/base.yml +++ b/guests/vars/projects/base.yml @@ -4,6 +4,7 @@ packages: - automake - autopoint - bash + - bash-completion - ccache - chrony - cppi diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml index 9f027f8..598dfc4 100644 --- a/guests/vars/projects/libvirt.yml +++ b/guests/vars/projects/libvirt.yml @@ -3,7 +3,6 @@ packages: - apparmor - augeas - avahi - - bash-completion
I'm not sure about removing it from libvirt dependencies. I think we should keep it in both places since it's an extension that improves testing environment and also it's a dependency of libvirt. Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

On Mon, 2018-04-09 at 09:22 +0200, Pavel Hrdina wrote: [...]
diff --git a/guests/vars/projects/base.yml b/guests/vars/projects/base.yml index a0483d8..49d4d2e 100644 --- a/guests/vars/projects/base.yml +++ b/guests/vars/projects/base.yml @@ -4,6 +4,7 @@ packages: - automake - autopoint - bash + - bash-completion - ccache - chrony - cppi diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml index 9f027f8..598dfc4 100644 --- a/guests/vars/projects/libvirt.yml +++ b/guests/vars/projects/libvirt.yml @@ -3,7 +3,6 @@ packages: - apparmor - augeas - avahi - - bash-completion
I'm not sure about removing it from libvirt dependencies. I think we should keep it in both places since it's an extension that improves testing environment and also it's a dependency of libvirt.
The whole point of 'base' is not having to list packages more than once: if someone wants to get the full list of dependencies for building a project, they're going to have to take both those specific to the project itself and those in base anyway, which is exactly what I do every time I sync the Travis CI configuration with the CentOS CI configuration. I don't see any reason to treat bash-completion differently. -- Andrea Bolognani / Red Hat / Virtualization

On Mon, Apr 09, 2018 at 10:11:23AM +0200, Andrea Bolognani wrote:
On Mon, 2018-04-09 at 09:22 +0200, Pavel Hrdina wrote: [...]
diff --git a/guests/vars/projects/base.yml b/guests/vars/projects/base.yml index a0483d8..49d4d2e 100644 --- a/guests/vars/projects/base.yml +++ b/guests/vars/projects/base.yml @@ -4,6 +4,7 @@ packages: - automake - autopoint - bash + - bash-completion - ccache - chrony - cppi diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml index 9f027f8..598dfc4 100644 --- a/guests/vars/projects/libvirt.yml +++ b/guests/vars/projects/libvirt.yml @@ -3,7 +3,6 @@ packages: - apparmor - augeas - avahi - - bash-completion
I'm not sure about removing it from libvirt dependencies. I think we should keep it in both places since it's an extension that improves testing environment and also it's a dependency of libvirt.
The whole point of 'base' is not having to list packages more than once: if someone wants to get the full list of dependencies for building a project, they're going to have to take both those specific to the project itself and those in base anyway, which is exactly what I do every time I sync the Travis CI configuration with the CentOS CI configuration. I don't see any reason to treat bash-completion differently.
OK, good enough :) Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (3)
-
Andrea Bolognani
-
Daniel P. Berrangé
-
Pavel Hrdina