You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have two ways to build the panacead. One is make build. The other is docker build .... Actually, the Dockerfile executes make build in the end.
Whether we run make build or docker build ..., the output binary (panacead) requires the libwasmvm.so (a shared library built by wasmvm).
If the libwasmvm.so is not installed in the LD_LIBRARY_PATH, the panacead cannot be executed:
$ ./panacead version
./panacead: error while loading shared libraries: libwasmvm.so: cannot open shared object file: No such file or directory
That's why all node operators must clone the github repo and run make build to get the panacead binary, instead of just downloading the binary from somewhere like Github release pages.
Instead of the dynamic linking, let's use the static linking. Fortunately, the wasmvm provides the libwasmvm_muslc.a.
But, note that it was built with muslc, not glibc.
What needs to be done
For make build, we don't need to anything. That is, it's okay for make build to generate a binary which requires libwasmvm.so.
In other words, we don't need to change the Makefile.
Instead, let's change the Dockerfile to generate a binary which links libwasmvm_muslc.a statically.
It means that we are going to upload the output binary to the release page on Github as an attachment, whenever we release a new version of panacead. It can make us use the Cosmovisor Auto-download.
As a reference, you can see the Dockerfile of the wasmd which is an example blockchain made by the CosmWasm team.
Also, it's okay to clean up the Dockerfile. Now, it's a bit complicated, but it can be simplified as the reference file that I mentioned above.
All history of this static linking topic can be found from: CosmWasm/wasmvm#45
Acceptance Criteria
The panacead built from Dockerfile can be executed on Linux where the libwasmvm.so isn't installed (not only Alpine, but also Ubuntu).
Test it on ASW EC2 Ubuntu instance.
The text was updated successfully, but these errors were encountered:
Background
We have two ways to build the
panacead
. One ismake build
. The other isdocker build ...
. Actually, theDockerfile
executesmake build
in the end.Whether we run
make build
ordocker build ...
, the output binary (panacead
) requires thelibwasmvm.so
(a shared library built by wasmvm).If the
libwasmvm.so
is not installed in theLD_LIBRARY_PATH
, thepanacead
cannot be executed:That's why all node operators must clone the github repo and run
make build
to get thepanacead
binary, instead of just downloading the binary from somewhere like Github release pages.Instead of the dynamic linking, let's use the static linking. Fortunately, the
wasmvm
provides the libwasmvm_muslc.a.But, note that it was built with muslc, not glibc.
What needs to be done
For
make build
, we don't need to anything. That is, it's okay formake build
to generate a binary which requireslibwasmvm.so
.In other words, we don't need to change the
Makefile
.Instead, let's change the
Dockerfile
to generate a binary which linkslibwasmvm_muslc.a
statically.It means that we are going to upload the output binary to the release page on Github as an attachment, whenever we release a new version of
panacead
. It can make us use the Cosmovisor Auto-download.As a reference, you can see the Dockerfile of the
wasmd
which is an example blockchain made by the CosmWasm team.Also, it's okay to clean up the
Dockerfile
. Now, it's a bit complicated, but it can be simplified as the reference file that I mentioned above.All history of this static linking topic can be found from: CosmWasm/wasmvm#45
Acceptance Criteria
panacead
built fromDockerfile
can be executed on Linux where thelibwasmvm.so
isn't installed (not only Alpine, but also Ubuntu).The text was updated successfully, but these errors were encountered: