Skip to content

Commit

Permalink
silkworm: disable on incompatible Linux versions
Browse files Browse the repository at this point in the history
  • Loading branch information
battlmonstr committed Dec 4, 2023
1 parent fcb9fce commit 227b135
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ CGO_CFLAGS += -Wno-unknown-warning-option -Wno-enum-int-mismatch -Wno-strict-pro

# about netgo see: https://github.com/golang/go/issues/30310#issuecomment-471669125 and https://github.com/golang/go/issues/57757
BUILD_TAGS = nosqlite,noboltdb

ifneq ($(shell "$(CURDIR)/turbo/silkworm/silkworm_compat_check.sh"),)
BUILD_TAGS := "$(BUILD_TAGS),nosilkworm"
endif

PACKAGE = github.com/ledgerwatch/erigon

GO_FLAGS += -trimpath -tags $(BUILD_TAGS) -buildvcs=false
Expand Down
33 changes: 33 additions & 0 deletions turbo/silkworm/silkworm_compat_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -e
set -u
set -o pipefail

OS_RELEASE_PATH=/etc/os-release

case $(uname -s) in
Linux)
if [[ ! -f "$OS_RELEASE_PATH" ]]
then
echo "not supported Linux without $OS_RELEASE_PATH"
exit 1
fi

source "$OS_RELEASE_PATH"

if [[ "$ID" == "debian" ]] && [[ "$VERSION_ID" == "12" ]]
then
exit 0
else
echo "not supported Linux version: $ID $VERSION_ID"
exit 1
fi

;;
Darwin)
exit 0;;
*)
echo "unsupported OS"
exit 1;;
esac

0 comments on commit 227b135

Please sign in to comment.