eth-educators / ethstaker-deposit-cli

Secure key generation for deposits
https://eth-educators.github.io/ethstaker-deposit-cli/
Creative Commons Zero v1.0 Universal
3 stars 5 forks source link

On Ubuntu 24.04, clearing the scrollback with tput fails with the bundled/built binary from Github #163

Closed remyroy closed 2 weeks ago

remyroy commented 2 weeks ago

Here is what I see in my console when the call is made with the regular terminal:

tput: /tmp/_MEI3OZe8M/libtinfo.so.6: version `NCURSES6_TINFO_6.2.20211010' not found (required by tput)

Simply calling tput reset in the same terminal does work for some reason.

That's the result I get from using the binary from this run https://github.com/eth-educators/ethstaker-deposit-cli/actions/runs/10925219471 .

Have you tried this on Ubuntu 24.04 @yorickdowne ? Maybe it's the binary bundle that links to a static lib that isn't present on my system?

remyroy commented 2 weeks ago

The clearing part does work when I call it from my dev environment on the same machine with uv run ethstaker_deposit/deposit.py new-mnemonic for instance. So it seems to be related to building/bundling part of the binaries.

yorickdowne commented 2 weeks ago

Always something … only tried it directly, not as a binary.

yorickdowne commented 2 weeks ago

I’m pondering what’s going on - it should check for presence of tput and then just call the system tput directly. Unclear what it’s doing with the ncurses library, and how that relates to the binary.

remyroy commented 2 weeks ago

Do you get the same issue when you try to run the bundled binary? Maybe bundling adds a version of tput or ncurses that causes this issue. I'll try to explore this on my side too.

yorickdowne commented 2 weeks ago

Ubuntu 20 has libtinfo.so.5

Let’s see what’s in the bundled file. We may need to exclude libtinfo in particular when using pyinstaller, though the docs don’t say how. See https://pyinstaller.org/en/stable/spec-files.html#posix-specific-options on how to exclude everything and include some … we want the opposite, exclude some.

yorickdowne commented 2 weeks ago

-> We need to figure out how to exclude libtinfo from the binary package

yorickdowne commented 2 weeks ago

I have a PR with exclusion. That should work on all versions of Debian (11, 12; Ubuntu 20, 22, 24), but we need to check that now excluding libtinfo.so.6 doesn't hinder us in another way.

remyroy commented 2 weeks ago

What if we could call tput in a different way such as it doesn't depend or use any library bundle with pyinstaller?

Maybe we just need to use a different working directory or some environment variable for that call.

What do you think?