toolbox/playbooks/setup-env.yaml
Debarshi Ray be2ba6d2e2 build: Call 'systemd-tmpfiles --create' when installing
It's only necessary to call 'systemd-tmpfiles --create' when building
and installing from source on the host operating system.

It's not needed when using a pre-built binary downstream package,
because:

  * When 'meson install' is called as part of building the package,
    that's not when the temporary files need to be created. They need
    to be created when the binary package is later downloaded and
    installed by the user.

  * Downstream tools can sometimes handle it automatically. eg., on
    Fedora, the systemd RPM installs a trigger that tells RPM to call
    'systemd-tmpfiles --create' automatically when a tmpfiles.d snippet
    is installed.

It's also not needed when installing inside a toolbox container because
the files that 'systemd-tmpfiles --create' is supposed to create are
meant to be on the host.

Downstream distributors set the DESTDIR environment variable when
building their packages. Therefore, it's used to detect when a
downstream package is being built.

Unfortunately, environment variables are messy and, generally, Meson
doesn't support accessing them inside its scripts [1]. Therefore, this
adds a spurious build-time dependency on systemd for downstream
distributors. However, that's probably not a big problem because all
supported downstream operating systems are already expected to use
systemd for the tmpfiles.d(5) snippets to work.

[1] https://github.com/mesonbuild/meson/issues/9

https://github.com/containers/toolbox/issues/955
2022-01-10 22:14:01 +01:00

54 lines
1.4 KiB
YAML

---
- hosts: all
tasks:
- name: Install requirements
become: yes
package:
use: dnf
name:
- ShellCheck
- bash-completion
- bats
- flatpak-session-helper
- golang
- golang-github-cpuguy83-md2man
- meson
- ninja-build
- podman
- skopeo
- systemd
- udisks2
- name: Setup submodules
shell: |
git submodule init
git submodule update
args:
chdir: '{{ zuul.project.src_dir }}'
- name: Check versions of crucial packages
command: rpm -qa *kernel* *glibc* golang podman conmon containernetworking-plugins containers-common container-selinux crun runc fuse-overlayfs flatpak-session-helper
- name: Show podman versions
command: podman version
- name: Show podman debug information
command: podman info --debug
- name: Set up build directory
command: meson builddir
args:
chdir: '{{ zuul.project.src_dir }}'
- name: Build Toolbox
command: ninja -C builddir
args:
chdir: '{{ zuul.project.src_dir }}'
creates: builddir/src/toolbox
- name: Install Toolbox
become: yes
command: ninja -C builddir install
args:
chdir: '{{ zuul.project.src_dir }}'
creates: /usr/local/bin/toolbox