Bug 287403 - sysutils/bacula15-client: zstd compression not working/not getting applied
Summary: sysutils/bacula15-client: zstd compression not working/not getting applied
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Dan Langille
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-09 20:33 UTC by Lohrmann
Modified: 2025-06-13 12:21 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (dvl)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lohrmann 2025-06-09 20:33:17 UTC
Our Bacula server fileset asks the client to make backups with zstd compression. 

This does not seem to work/get honored when backing up FreeBSD clients. 

The completed job summary report always states "Software Compression: None", even though the fileset definition for the client asks for zstd compression.

Looking at the files and dependencies of bacula-client, zstd support for the bacula_fd client might not even be compiled in?

If we ask for GZIP compression instead, that one works.

Bacula FD: 15.0.2_6 (same issue observed with 15.0.2_3)
Bacula Server: bacula15-server-15.0.2_3
Comment 1 Dan Langille freebsd_committer freebsd_triage 2025-06-10 20:55:58 UTC
I wonder if this is a missing build-time configuration item.
Comment 2 Dan Langille freebsd_committer freebsd_triage 2025-06-10 21:31:36 UTC
Side question: are you building your own packages/ports?
Comment 3 Lohrmann 2025-06-10 21:49:06 UTC
(In reply to Dan Langille from comment #2)

No. Installed from packages (pkg install bacula15-client).
Comment 4 Dan Langille freebsd_committer freebsd_triage 2025-06-11 00:36:19 UTC
I tried some build options: failed.

I tried reading the docs: 503 errors right now.

I grep'd the source code. No hints.

I posted to the mailing list. https://sourceforge.net/p/bacula/mailman/bacula-users/?viewmonth=202506
Comment 5 Dan Langille freebsd_committer freebsd_triage 2025-06-11 16:53:08 UTC
The mailing list suggested using --with-curl=/usr/local - did not fix the issue.

I have been able to reproduce the original problem: GZIP and LTO work. ZSTD does not.
Comment 6 Dan Langille freebsd_committer freebsd_triage 2025-06-12 16:46:04 UTC
It is a missing patch and a missing depends.

LIB_DEPENDS+=   libzstd.so:archivers/zstd

With that:

[16:42 gw01 dvl ~] % ldd /usr/local/sbin/bacula-fd | grep std   
	libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x37b1178e1000)

and:

  Software Compression:   71.6% 3.5:1

I'll update the port soon.
Comment 7 commit-hook freebsd_committer freebsd_triage 2025-06-12 19:21:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=51b906b083febd50a4cfbb5e4278a59d95b50216

commit 51b906b083febd50a4cfbb5e4278a59d95b50216
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2025-06-12 17:38:36 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2025-06-12 19:20:23 +0000

    sysutils/bacula15-server: Add support for zstd compression

    You'll know you have zstd enabled if you find something like this:

    $ ldd /usr/local/sbin/bextract | grep zstd
            libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0xbab736bf000)

    $ ldd /usr/local/sbin/bacula-fd | grep std
            libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x3e701988b000)

    * add libzstd.so:archivers/zstd to LIB_DEPENDS
    * apply upstream patches to configure and autoconf/configure

    Those patches are:

    * files/patch-configure
      https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/commit/358e838a
      bring in some unset fixes, locally adjusted back to 15.0.2

    * files/patch-autoconf_configure.in
      https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/commit/8d9669fb
      fix detection of zstd

    Upstream discussion: https://sourceforge.net/p/bacula/mailman/bacula-users/?viewmonth=202506

    While here, comply with portlint for S3_LIB_DEPENDS

    PR:             287403

    Sponsored by:   BSDCan 2025 FreeBSD Dev Summit

 sysutils/bacula15-server/Makefile                  |  7 +-
 .../files/patch-autoconf_configure.in (new)        | 23 ++++++
 .../bacula15-server/files/patch-configure (new)    | 93 ++++++++++++++++++++++
 3 files changed, 120 insertions(+), 3 deletions(-)
Comment 8 Dan Langille freebsd_committer freebsd_triage 2025-06-12 19:29:58 UTC
(In reply to Lohrmann from comment #0)

This was a great thing to report. Thank you.

Please upgrade (when the packages become available) and report back, cheers.
Comment 9 Dan Langille freebsd_committer freebsd_triage 2025-06-13 12:08:36 UTC
I'm testing on 2025Q2 - I consider this a but worth backporting.
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-06-13 12:19:59 UTC
A commit in branch 2025Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a2c99c21ed5252d0da09ca9b16ed80d5b428a21f

commit a2c99c21ed5252d0da09ca9b16ed80d5b428a21f
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2025-06-12 17:38:36 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2025-06-13 12:19:22 +0000

    sysutils/bacula15-server: Add support for zstd compression

    You'll know you have zstd enabled if you find something like this:

    $ ldd /usr/local/sbin/bextract | grep zstd
            libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0xbab736bf000)

    $ ldd /usr/local/sbin/bacula-fd | grep std
            libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x3e701988b000)

    * add libzstd.so:archivers/zstd to LIB_DEPENDS
    * apply upstream patches to configure and autoconf/configure

    Those patches are:

    * files/patch-configure
      https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/commit/358e838a
      bring in some unset fixes, locally adjusted back to 15.0.2

    * files/patch-autoconf_configure.in
      https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/commit/8d9669fb
      fix detection of zstd

    Upstream discussion: https://sourceforge.net/p/bacula/mailman/bacula-users/?viewmonth=202506

    While here, comply with portlint for S3_LIB_DEPENDS

    PR:             287403

    Sponsored by:   BSDCan 2025 FreeBSD Dev Summit

    (cherry picked from commit 51b906b083febd50a4cfbb5e4278a59d95b50216)

 sysutils/bacula15-server/Makefile                  |  7 +-
 .../files/patch-autoconf_configure.in (new)        | 23 ++++++
 .../bacula15-server/files/patch-configure (new)    | 93 ++++++++++++++++++++++
 3 files changed, 120 insertions(+), 3 deletions(-)
Comment 11 Dan Langille freebsd_committer freebsd_triage 2025-06-13 12:21:28 UTC
Test builds on 2025Q2 were successful. Backport completed.