Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dynamic dependency within evm #9391

Closed
namiloh opened this issue Feb 6, 2024 · 8 comments
Closed

New dynamic dependency within evm #9391

namiloh opened this issue Feb 6, 2024 · 8 comments

Comments

@namiloh
Copy link

namiloh commented Feb 6, 2024

Backtrace

I built the binary like this: https://github.com/holiman/goevmlab/blob/master/docker/Dockerfile#L46

RUN git clone https://github.com/ledgerwatch/erigon --depth 1
RUN cd erigon && make evm && cp ./build/bin/evm /erigon_vm

But the resulting binary has a new dynamic dependency which it didn't have previously:

root@683bec3f3dd9:/# ldd ./erigon_vm 
	linux-vdso.so.1 (0x00007ffc41bec000)
	libsilkworm_capi.so => not found
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd6a130a000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd6a12e6000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd6a1104000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd6a1565000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd6a1025000)
/erigon_vm: error while loading shared libraries: libsilkworm_capi.so: cannot open shared object file: No such file or directory

I guess I just need to dig it up and copy it over, or somehow enable static build mode. Just wanted to file this, in case you did not know that some recent change made a previously standalone binary into a dynamic dependency binary.

The location where it winds up is /go/pkg/mod/github.com/erigontech/silkworm-go@v0.12.0/lib/linux_x64/libsilkworm_capi.so

@AskAlexSharov
Copy link
Collaborator

@battlmonstr plz help

@holiman
Copy link
Contributor

holiman commented Feb 6, 2024

here's my local hack to get around it, btw: https://github.com/holiman/goevmlab/pull/122/files

@battlmonstr
Copy link
Contributor

battlmonstr commented Feb 6, 2024

@holiman @namiloh
On this line:

RUN cd erigon && make evm && cp ./build/bin/evm /erigon_vm

Instead of cp please use make install like this:

RUN cd erigon && make evm && make DIST=/erigon_vm install

This will copy both evm and libsilkworm_capi.so to /erigon_vm

@AskAlexSharov do we have a FAQ somewhere? I'd like to document this.

@AskAlexSharov
Copy link
Collaborator

@drjake007
Copy link

Using Erigon linux archive v2.58.1.tar.gz with go v1.22.0, running make erigon compiles with no errors, but get runtime error when starting up Erigon (systemctl start erigon):

Feb 24 23:23:39 xxxxxxxx systemd[1]: Started Erigon Execution Client (Mainnet).
Feb 24 23:23:39 xxxxxxxx erigon[2062451]: /usr/local/bin/erigon/build/bin/erigon: error while loading shared libraries: libsilkworm_capi.so: cannot open shared object file: No such file or directory
erigon.service: Main process exited, code=exited, status=127/n/a

How do I compile in the missing library?
Or where do I get the missing library and what directory do I need to place it in for Erigon to find it?

Thank you

@battlmonstr
Copy link
Contributor

@drjake007 please use make DIST=<path> install command to get the binary + library at the same path. The library can be placed either in the same directory as the erigon binary, or in ../lib (lib in the parent).

@drjake007
Copy link

Got it working - thanks for the help - appreciate the quick response.

@battlmonstr
Copy link
Contributor

There's an FAQ entry about this now:
https://github.com/ledgerwatch/erigon?tab=readme-ov-file#how-to-run-erigon-as-a-separate-user-eg-as-a-systemd-daemon

Please reopen if you still have this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants