diff --git a/script/release.sh b/script/release.sh index 2156fca39..b04fe0091 100755 --- a/script/release.sh +++ b/script/release.sh @@ -30,25 +30,6 @@ function build_project() { # Due to libseccomp being LGPL we must include its sources, # so download, install and build against it. - # Sanity check: check that the build won't use distro-provided - # libseccomp.a. If this is the case, explain and abort. - # - # Note go is not used here as it caches the build heavily, - # including, apparently, the results of pkg-config. - # shellcheck disable=SC2046 - if read -ra flags < <(pkg-config --libs --cflags libseccomp 2>/dev/null) && - cat < -int main(void) { seccomp_version(); return 0; } -EOF - set +x - echo >&2 - echo "Distro-provided libseccomp static library is installed." >&2 - echo "Unable to build a static binary against own libsecomp." >&2 - echo "Please uninstall libseccomp-static to fix." >&2 - exit 1 - fi - local libseccomp_ver='2.5.1' local tarball="libseccomp-${libseccomp_ver}.tar.gz" local prefix @@ -62,7 +43,10 @@ EOF ) mv "$tarball"{,.asc} "$builddir" - make -C "$root" PKG_CONFIG_PATH="${prefix}/lib/pkgconfig" COMMIT_NO= static + # Add -a to go build flags to make sure it links against + # the provided libseccomp, not the system one (otherwise + # it can reuse cached pkg-config results). + make -C "$root" PKG_CONFIG_PATH="${prefix}/lib/pkgconfig" COMMIT_NO= EXTRA_FLAGS="-a" static rm -rf "$prefix" mv "$root/$project" "$1" }