logger/journald: remove journald_compat (for systemd < 209)

This was added in 6cdc4ba6cd in 2016, likely
because at the time we were still building for CentOS 6 and Ubuntu 14.04.

All currently supported distros appear to be on _at least_ 219 now, so it looks
safe to remove this;

```bash
docker run -it --rm centos:7

yum install -y systemd-devel

pkg-config 'libsystemd >= 209' && echo "OK" || echo "KO"
OK

pkg-config --print-provides 'libsystemd'
libsystemd = 219

pkg-config --print-provides 'libsystemd-journal'
libsystemd-journal = 219
```

And on a `debian:buster` (old stable)

```bash
docker run -it --rm debian:buster

apt-get update && apt-get install -y libsystemd-dev pkg-config

pkg-config 'libsystemd >= 209' && echo "OK" || echo "KO"
OK

pkg-config --print-provides 'libsystemd'
libsystemd = 241

pkg-config --print-provides 'libsystemd-journal'
Package libsystemd-journal was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd-journal.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd-journal' found
```

OpenSUSE leap (I think that's built for s390x)

```bash
docker run -it --rm docker.io/opensuse/leap:15

zypper install -y systemd-devel

pkg-config 'libsystemd >= 209' && echo "OK" || echo "KO"
OK

pkg-config --print-provides 'libsystemd'
libsystemd = 246

pkg-config --print-provides 'libsystemd-journal'
Package libsystemd-journal was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd-journal.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd-journal' found
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-07-20 13:24:28 +02:00
parent 7624f8aeb1
commit 0e9a66d35a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
4 changed files with 4 additions and 15 deletions

View File

@ -1,5 +1,5 @@
//go:build linux && cgo && !static_build && journald && !journald_compat
// +build linux,cgo,!static_build,journald,!journald_compat
//go:build linux && cgo && !static_build && journald
// +build linux,cgo,!static_build,journald
package journald // import "github.com/docker/docker/daemon/logger/journald"

View File

@ -1,7 +0,0 @@
//go:build linux && cgo && !static_build && journald && journald_compat
// +build linux,cgo,!static_build,journald,journald_compat
package journald // import "github.com/docker/docker/daemon/logger/journald"
// #cgo pkg-config: libsystemd-journal
import "C"

View File

@ -83,10 +83,8 @@ add_buildtag() {
[[ " $DOCKER_BUILDTAGS" == *" $1_"* ]] || DOCKER_BUILDTAGS+=" $1_$2"
}
if ${PKG_CONFIG} 'libsystemd >= 209' 2> /dev/null; then
if ${PKG_CONFIG} 'libsystemd' 2> /dev/null; then
DOCKER_BUILDTAGS+=" journald"
elif ${PKG_CONFIG} 'libsystemd-journal' 2> /dev/null; then
DOCKER_BUILDTAGS+=" journald journald_compat"
fi
# test whether "libdevmapper.h" is new enough to support deferred remove

View File

@ -11,10 +11,8 @@ SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
[ -n "${TESTDEBUG}" ] && set -x
# TODO find a way to share this code with hack/make.sh
if ${PKG_CONFIG} 'libsystemd >= 209' 2> /dev/null; then
if pkg-config 'libsystemd' 2> /dev/null; then
DOCKER_BUILDTAGS+=" journald"
elif ${PKG_CONFIG} 'libsystemd-journal' 2> /dev/null; then
DOCKER_BUILDTAGS+=" journald journald_compat"
fi
echo -e "\n\033[0;36mINFO\033[0m Start validation with golang-ci-lint"