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

Issue with running python binaries built with pyinstaller and nuitka on lambda #48

Open
drunksaint opened this issue Jul 31, 2020 · 2 comments

Comments

@drunksaint
Copy link

Looks like binaries built with pyinstaller also have an issue running on lambda because of missing libs.
The error I'm getting:

$ gg infer pifiletest input.txt output.txt
VVT6QIgWxow5uZy7AC9yROP30219jnslAkVB82NWD3qU00000012
Vdp0Lbxv2ptpS4llaXGFsGNlp46eo_de7DN1Ezd.Fd0A0058e210
TQdYV6nH0NF1PBNecJur6pVhDsn8ZObn4zqk6Yoq82jY00000153

$ gg force --engine lambda output.txt 
→ Loading the thunks...  done (0 ms).
↗ Uploading 2 files (5.6 MiB)... done (4296 ms).
[7] Error loading Python lib '/tmp/_MEIovTa5m/libpython3.7m.so.1.0': dlopen: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /tmp/_MEIovTa5m/libpython3.7m.so.1.0)
rmdir /tmp/thunk-execute.3QkvHd: Directory not empty
std::exception
 `TQdYV6nH0NF1PBNecJur6pVhDsn8ZObn4zqk6Yoq82jY00000153': process exited with failure status 255

gg-force: execution failed: TQdYV6nH0NF1PBNecJur6pVhDsn8ZObn4zqk6Yoq82jY00000153

$ gg force output.txt 
→ Loading the thunks...  done (0 ms).

$

My wrapper file:

#!/bin/bash
gg collect $1
gg collect pifiletest
gg create-thunk \
    --value $(gg hash $1) \
    --output $2 \
    --executable $(gg hash pifiletest) \
    --placeholder $2 \
    --link $1=$(gg hash $1) \
    --link pifiletest=$(gg hash pifiletest) \
    -- $(gg hash pifiletest) pifiletest $1 $2

I built the pyinstaller binary with pyinstaller --onefile pifiletest.py --distpath .

@sadjad
Copy link
Member

sadjad commented Jul 31, 2020

Hi @drunksaint,

The problem is that there's a mismatch between the glibc version on your computer and on Lambda.

This is slightly different from the issue we were having with Nuitka. Although PyInstaller has packed all the necessary libraries into the executable, it still relies on the host's glibc. The package was created on a system with glibc v2.25, but Lambda comes with v2.17.

The easiest solution, I think, is to run PyInstaller in the same runtime environment as Lambda, which typically requires starting a new EC2 instance with the proper image.

Also, take a look at the first question here. There's a second solution based on StaticX which allows you to also packet your own gblic in the binary.

--Sadjad

@drunksaint
Copy link
Author

Ah I see, building it on ec2 with the aws linux 1 ami fixed the pyinstaller issue!

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

No branches or pull requests

2 participants