cx_freeze v5.1.1 is not compatible with python3.7, so the py3-cx_freeze package won’t work in alpine 3.10.
Here a test with alpine 3.10rc1, that works fine with alpine 3.9 (and it’s python 3.6):
~ # echo 'print("Hallo world!")' > hello.py
~ # python3 hello.py
Hallo world!
~ # cp -p /usr/bin/ldd .
~ # cxfreeze hello.py
… lots of output ...
~ # dist/hello
Fatal Python error: initfsencoding: Unable to get the locale encoding
ImportError: invalid flags 1556882925 in 'encodings'
Current thread 0x00007f8e2c36fd48 (most recent call first):
Aborted
~ #
Three alternatives come into my mind:
- drop cx_freeze
- patch cx_freeze v5.1.1, https://github.com/msys2/MINGW-packages/commit/4c18633ba2331d980f00aff075f17135399c43c5 might help, but I haven’t tested it.
- use the cx_freeze beta version 6.0b1, but I have no idea what issue that version has
BTW: The ldd program (in all alpine versions) creates invalid output in case you use it on a library, here an example:
~ # ldd /lib/libssl.so.1.1
ldd (0x7ffb49916000)
libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7ffb49618000)
libc.musl-x86_64.so.1 => ldd (0x7ffb49916000)
The loader ld-musl-x86_64.so.1 and libc.musl-x86_64.so.1 point to "ldd", what's totally wrong. That's why you have to copy the ldd binary to your current directory before using cx_freeze.
Here my alternative ldd, it works much better with cx_freeze (and pyinstaller):
#!!/bin/sh
exec /lib/ld-musl-* --list -- "$@"
Here an example, with more reasonable results:
~ # ldd.new /lib/libssl.so.1.1
/lib/ld-musl-x86_64.so.1 (0x7fa671495000)
libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7fa671197000)
libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fa671495000)
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---
On Tue, 4 Jun 2019 21:22:13 +0200
Bernhard Ehlers <list@bernhard-ehlers.de> wrote:
> cx_freeze v5.1.1 is not compatible with python3.7, so the py3-cx_freeze package won*t work in alpine 3.10.
>
> Here a test with alpine 3.10rc1, that works fine with alpine 3.9 (and it*s python 3.6):
>
> ~ # echo 'print("Hallo world!")' > hello.py
> ~ # python3 hello.py
> Hallo world!
> ~ # cp -p /usr/bin/ldd .
> ~ # cxfreeze hello.py
> * lots of output ...
> ~ # dist/hello
> Fatal Python error: initfsencoding: Unable to get the locale encoding
> ImportError: invalid flags 1556882925 in 'encodings'
>
> Current thread 0x00007f8e2c36fd48 (most recent call first):
> Aborted
> ~ #
>
> Three alternatives come into my mind:
> - drop cx_freeze
> - patch cx_freeze v5.1.1, https://github.com/msys2/MINGW-packages/commit/4c18633ba2331d980f00aff075f17135399c43c5 might help, but I haven*t tested it.
> - use the cx_freeze beta version 6.0b1, but I have no idea what issue that version has
I suppose we need to apply that patch.
> BTW: The ldd program (in all alpine versions) creates invalid output in case you use it on a library, here an example:
>
> ~ # ldd /lib/libssl.so.1.1
> ldd (0x7ffb49916000)
> libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7ffb49618000)
> libc.musl-x86_64.so.1 => ldd (0x7ffb49916000)
>
> The loader ld-musl-x86_64.so.1 and libc.musl-x86_64.so.1 point to "ldd", what's totally wrong. That's why you have to copy the ldd binary to your current directory before using cx_freeze.
>
> Here my alternative ldd, it works much better with cx_freeze (and pyinstaller):
> #!!/bin/sh
> exec /lib/ld-musl-* --list -- "$@"
>
> Here an example, with more reasonable results:
> ~ # ldd.new /lib/libssl.so.1.1
> /lib/ld-musl-x86_64.so.1 (0x7fa671495000)
> libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7fa671197000)
> libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fa671495000)
Good catch. Will fix this.
Thanks!
-nc
PS. those issues could have been reported on the bugtracker on bugs.alpinelinux.org.
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---