From 0e9a66d35af6bcb846a7dcb79f26ebd189f13ef1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 20 Jul 2022 13:24:28 +0200 Subject: [PATCH] logger/journald: remove journald_compat (for systemd < 209) This was added in 6cdc4ba6cd5178037466c50ebe03a7eb111c43b1 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 --- daemon/logger/journald/read_native.go | 4 ++-- daemon/logger/journald/read_native_compat.go | 7 ------- hack/make.sh | 4 +--- hack/validate/golangci-lint | 4 +--- 4 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 daemon/logger/journald/read_native_compat.go diff --git a/daemon/logger/journald/read_native.go b/daemon/logger/journald/read_native.go index ce1de3fbde..862d064277 100644 --- a/daemon/logger/journald/read_native.go +++ b/daemon/logger/journald/read_native.go @@ -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" diff --git a/daemon/logger/journald/read_native_compat.go b/daemon/logger/journald/read_native_compat.go deleted file mode 100644 index 9876591131..0000000000 --- a/daemon/logger/journald/read_native_compat.go +++ /dev/null @@ -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" diff --git a/hack/make.sh b/hack/make.sh index 427def3aca..f0b2720439 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -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 diff --git a/hack/validate/golangci-lint b/hack/validate/golangci-lint index fd14690ae1..ab01dcb026 100755 --- a/hack/validate/golangci-lint +++ b/hack/validate/golangci-lint @@ -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"