Skip to content

Commit

Permalink
build: Call 'systemd-tmpfiles --create' when installing
Browse files Browse the repository at this point in the history
It's only necessary to call 'systemd-tmpfiles --create' when building
and installing from source, and not when using a 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 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.

containers#955
  • Loading branch information
debarshiray committed Dec 17, 2021
1 parent 73c53a3 commit 1cc8083
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ subdir('data')
subdir('doc')
subdir('profile.d')
subdir('src')

meson.add_install_script('meson_post_install.py')
10 changes: 10 additions & 0 deletions meson_post_install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

import os
import subprocess

destdir = os.environ.get('DESTDIR', '')

if not destdir:
print('Calling systemd-tmpfiles --create ...')
subprocess.call(['systemd-tmpfiles', '--create'])
7 changes: 0 additions & 7 deletions playbooks/setup-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,3 @@
args:
chdir: '{{ zuul.project.src_dir }}'
creates: /usr/local/bin/toolbox

- name: Setup environment
become: yes
command:
cmd: systemd-tmpfiles --create
creates: /run/media
creates: /run/host

0 comments on commit 1cc8083

Please sign in to comment.