borgbase / ansible-role-borgbackup

Ansible role to set up Borg and Borgmatic
MIT License
221 stars 98 forks source link

Install Failure Due to Missing lz4 Dependency on Debian 11 #151

Open RedlineTriad opened 4 weeks ago

RedlineTriad commented 4 weeks ago

Using this role on a fresh debian 11 server fails, see error logs here: https://github.com/RedlineTriad/private_server/actions/runs/10395280145/job/28786958496#step:6:102

It seems a commit addressing this is already being worked on but not released or fully working yet. Just writing this issue for traceability, updates, and googleability. Will see if I can work around it on my own for now.

Expand for full error ```yaml TASK [borgbase.ansible_role_borgbackup : Install main Python packages] ********* failed: [pascal.build] (item={'name': 'borgbackup', 'version': False}) => changed=false ansible_loop_var: item cmd: - /opt/borgmatic/bin/pip3 - install - borgbackup item: name: borgbackup version: false msg: |- stdout: Collecting borgbackup Using cached borgbackup-1.4.0.tar.gz (3.8 MB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'error' :stderr: error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [17 lines of output] Detected and preferring libcrypto [via pkg-config] Traceback (most recent call last): File "/opt/borgmatic/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/opt/borgmatic/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/opt/borgmatic/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "/tmp/pip-build-env-aiyqpg17/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) File "/tmp/pip-build-env-aiyqpg17/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-aiyqpg17/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 145, in File "", line 125, in lib_ext_kwargs Exception: Could not find lz4 lib/headers, please set BORG_LIBLZ4_PREFIX or ensure liblz4.pc is in PKG_CONFIG_PATH. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. ```
RedlineTriad commented 4 weeks ago

I also took 5 minutes to try and upgrade to debian 12 but it seems I get the same error there :(

RedlineTriad commented 4 weeks ago

I can confirm that using the latest commit at the time of writing fixes this issue for debian 12:

roles:
  - name: borgbase.ansible_role_borgbackup
    src: git+https://github.com/borgbase/ansible-role-borgbackup.git
    version: 0e5e8766264233788eeb0abb1d48e854cedcf7aa
m3nu commented 4 weeks ago

I'm using this on Debian 12, but set it to use the distro package and NOT build from source. Maybe using the distro package would be a better default?

kubedzero commented 2 weeks ago

I found https://github.com/borgbackup/borg/pull/8117 and the bundled software was removed, meaning you have to provide liblz4, libstd, and libxxhash outside of Borg 👍