hack: remove devicemapper leftovers and build-tags

This check was added in 98fe4bd8f1, 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 dc11d2a2d8, 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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-08-25 16:39:33 +02:00
parent 3e5b2a6ef6
commit 12d1f4f385
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 1 additions and 15 deletions

View file

@ -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 <libdevmapper.h>\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

View file

@ -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'