From 12d1f4f38545fbb967e5d265d0a74df8e40fc8be Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 25 Aug 2023 16:39:33 +0200 Subject: [PATCH] hack: remove devicemapper leftovers and build-tags This check was added in 98fe4bd8f1e35f8e498e268f653a43cbfa31e751, to check whether dm_task_deferred_remove could be removed, and to conditionally set the corresponding build-tags. Now that the devicemapper graphdriver has been removed in dc11d2a2d8e1df0a90ce289f5dd06cad38193073, we no longer need this. This patch: - removes uses of the (no longer used) `libdm`, `dlsym_deferred_remove`, and `libdm_no_deferred_remove` build-tags. - removes the `add_buildtag` utility, which is now unused. Signed-off-by: Sebastiaan van Stijn --- hack/make.sh | 14 -------------- hack/test/unit | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/hack/make.sh b/hack/make.sh index ec01bc1068..fd24bf30c7 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -84,24 +84,10 @@ if [ ! "$GOPATH" ]; then exit 1 fi -# Adds $1_$2 to DOCKER_BUILDTAGS unless it already -# contains a word starting from $1_ -add_buildtag() { - [[ " $DOCKER_BUILDTAGS" == *" $1_"* ]] || DOCKER_BUILDTAGS+=" $1_$2" -} - if ${PKG_CONFIG} 'libsystemd' 2> /dev/null; then DOCKER_BUILDTAGS+=" journald" fi -# test whether "libdevmapper.h" is new enough to support deferred remove -# functionality. We favour libdm_dlsym_deferred_remove over -# libdm_no_deferred_remove in dynamic cases because the binary could be shipped -# with a newer libdevmapper than the one it was built with. -if command -v gcc &> /dev/null && ! (echo -e '#include \nint main() { dm_task_deferred_remove(NULL); }' | gcc -xc - -o /dev/null $(${PKG_CONFIG} --libs devmapper 2> /dev/null) &> /dev/null); then - add_buildtag libdm dlsym_deferred_remove -fi - # Use these flags when compiling the tests and final binary if [ -z "$DOCKER_DEBUG" ]; then diff --git a/hack/test/unit b/hack/test/unit index fefe065e38..fcac338048 100755 --- a/hack/test/unit +++ b/hack/test/unit @@ -12,7 +12,7 @@ # set -eux -o pipefail -BUILDFLAGS=(-tags 'netgo libdm_no_deferred_remove journald') +BUILDFLAGS=(-tags 'netgo journald') TESTFLAGS+=" -test.timeout=${TIMEOUT:-5m}" TESTDIRS="${TESTDIRS:-./...}" exclude_paths='/vendor/|/integration'