Are Linux compiled programs "cross-distribution"? #6013
Replies: 2 comments
-
There's no guarantee for "cross-distribution" compatibility. Actually, there's no guarantee for compatibility between different versions of the same distribution, either. That's mainly because shared libraries are collected from the build system, and all ABI-related limitations apply when trying to use those on another system. One problem is that if you freeze your application on a distribution with a newer version of glibc than the version on your target distribution. Then shared libraries that use newer glibc symbols (e.g., collected libpython3.x.so) will fail to load on the target distribution. So you generally need to freeze on distribution with the oldest version of glibc that you want to support. Even then, the compatibility very much depends on what python packages you use. If you use only pure-python packages, there shouldn't be much problems, but anything making use of python extensions will depend on behavior of linked shared libraries. And in such cases, PyInstaller might collect one library too many, one library too few, or the collected shared libraries might exhibit distribution-specific behavior (i.e., config file paths, library search paths, etc.). For example, see #4985. In short, PyInstaller-frozen programs face the same problems and limitations as other binary-only software in linux world... |
Beta Was this translation helpful? Give feedback.
-
The answer is almost certainly not if you're building on your home environment. PyInstaller itself doesn't much affect distribution compatibility but what goes into your does.
The best way to maximise compatibilty is to run PyInstaller in a docker image with a very low glibc version. For that you can use crdx/docker-pyinstaller. |
Beta Was this translation helpful? Give feedback.
-
I read the FAQ but I couldn't find anything about that.
If I compile a Python program using PyInstaller on a Linux Machine, say Fedora 34, would that program be compatible with other Linux distributions, say Ubuntu 20.04?
Beta Was this translation helpful? Give feedback.
All reactions