Replies: 6 comments 15 replies
-
It doesn't assume that. It assumes that python's This does not work when you use a custom executable entrypoint which isn't a python interpreter, but rather loads the python interpreter via libpython, which you said you are doing. Meson does have a fallback based on the notion that meson officially supports two forms of distribution:
In this case, meson attempts to use Supporting additional forms of freezing would require a code change to meson (or for your custom freeze program to imitate the implementation details of PyInstaller). |
Beta Was this translation helpful? Give feedback.
-
I enabled debug messages on my standalone meson binary, and patched
The glib meson setup command is:
The setup code does a lot of actions, but at the end it fails with:
So meson correctly invokes itself with If I read the error message correctly, the actual reason why it failed is the missing Is this a meson dependency that needs to be installed separately? My current Python environment is pristine, as installed from the Python sources, and in the resulting |
Beta Was this translation helpful? Give feedback.
-
Pretend to be a PyInstaller binary vs a meson patch to ignore
|
Beta Was this translation helpful? Give feedback.
-
Preserve the Python source code vs compiling everything in frozen distributions?My previous solution for the standalone meson package was to compile all Apparently PyInstaller takes, at least with the default configuration, a similar approach. However, as discovered while building This fails if all Python files are compiled and the original sources are no longer included in the distribution. Currently I updated the build scripts to keep both source and compiled Python code, but the resulting binaries are pretty large now. I would like to remove the source files that are not needed, but knowing which is which does not seem an obvious choice. @eli-schwartz, in the meson folder structure, are there any other files except those in the Do you know of such scripts in the standard Python library that need to be present in source form? |
Beta Was this translation helpful? Give feedback.
-
Additional Python dependencies that might be useful during meson builds?Another small problem I had to fix was a dependency to the I did not investigate if this is a dependency needed by the meson code itself or by the glib meson code, I simply added a For just in case I also added a @eli-schwartz, given that my distribution is standalone/frozen, and it is not possible to install additional packages, is there a list of recommended Python packages to have at hand during meson builds? |
Beta Was this translation helpful? Give feedback.
-
I managed to rework my build scripts and the resulting standalone meson passes complex builds, like recent glib and qemu. I could not use PyInstaller, mainly due to some macOS specific issues. In case someone will be interested in details, the xPack standalone distribution uses a meson/meson.exe executable, compiled from On Linux/macOS, the Python library must include the Except the Even more, in addition to To save space, all The original The PyInstaller specific definitions ( |
Beta Was this translation helpful? Give feedback.
-
I'm maintaining a binary distribution of meson for almost 4 years, and things were functional, until recently, when I tried to build a recent
glib
and I encountered the following error:It looks like recent glib releases (2.80.0 and several older versions too, up to a point) use some advanced meson features (introspection?), which are not available in a standalone distribution like mine.
As it can be seen, I use a binary called
meson
, which is linked to the python library, so the systempython3
executable is no longer needed. Until now, this worked fine for a cross-platform distribution (macOS, Linux, Windows).The
meson.c
code is relatively straightforward, it seems complicated because it still includes some debug code, but it just initialises the Python environment and executes themesonmain.main()
function.The error comes from the
mesonbuild/modules/python.py
file, which invokesmeson
to run some Python code, and obviously fails.I'm not familiar with the meson code used by glib, and I don't know if the features used by glib are legit or not, but I think that the meson assumption that arg[0] is the path to the Python interpreter is a bit too strong.
I'd appreciate any advice on how to improve my standalone project to accommodate such advanced use cases too.
Beta Was this translation helpful? Give feedback.
All reactions