forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
silkworm: make install (erigontech#8985)
We've got a report from a user that erigon fails to run with this error: ``` /opt/erigon/releases/latest/bin/erigon: error while loading shared libraries: libsilkworm_capi.so: cannot open shared object file: No such file or directory ``` On this system erigon is executed using a service-account user which has no permission to access the build user's $HOME where the libsilkworm_capi.so resides (inside $GOPATH/pkg/mod). This adds a support to silkworm-go to look for the library relative to the executable path on Linux: erigontech/silkworm-go@d4ec8a8 and a new `make DIST=<path> install` command which copies both the library and erigon binary to any destination.
- Loading branch information
1 parent
b26d0f2
commit ce57b8f
Showing
4 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
script_dir=$(dirname "${BASH_SOURCE[0]}") | ||
project_dir=$(realpath "$script_dir/../..") | ||
go_cmd=go | ||
|
||
function os_name { | ||
value=$(uname -s) | ||
case $value in | ||
Linux) | ||
echo linux;; | ||
Darwin) | ||
echo macos;; | ||
*) | ||
echo "unsupported OS: $value" | ||
exit 1;; | ||
esac | ||
} | ||
|
||
function arch_name { | ||
value=$(uname -m) | ||
case $value in | ||
arm64) | ||
echo arm64;; | ||
aarch64) | ||
echo arm64;; | ||
x86_64) | ||
echo x64;; | ||
*) | ||
echo "unsupported CPU architecture: $value" | ||
exit 1;; | ||
esac | ||
} | ||
|
||
function lib_file_ext { | ||
value=$(os_name) | ||
case $value in | ||
linux) | ||
echo so;; | ||
macos) | ||
echo dylib;; | ||
*) | ||
echo "unsupported OS: $value" | ||
exit 1;; | ||
esac | ||
} | ||
|
||
function silkworm_go_version { | ||
grep "silkworm-go" "$project_dir/go.mod" | awk '{ print $2 }' | ||
} | ||
|
||
function libsilkworm_path { | ||
echo "$($go_cmd env GOMODCACHE)/github.com/erigontech/silkworm-go@$(silkworm_go_version)/lib/$(os_name)_$(arch_name)/libsilkworm_capi.$(lib_file_ext)" | ||
} | ||
|
||
libsilkworm_path |