GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Customize generation and compiling of frozen modules · Issue #425 · python-cmake-buildsystem/python-cmake-buildsystem Open DescriptionFirst of all, thanks for the cool project, I finally embedded python in my application using CMake! I embed python in a static and isolated configuration, without using modules on the filesystem. After setting all compile time and runtime defines I got stuck with an error on initialization (same as in #339): While in most cases this means problems with the path to the core "*.py" libraries, in my case it means that the "encodings" module is not frozen (in memory). After a couple of days of fighting and deep research I came up with a solution and figured out what was going on. All frozen python modules must be generated in two places:
The files from the second case are generated in this project by hardcoded statements in python-cmake-buildsystem/blob/master/cmake/libpython/CMakeLists.txt ( But to add frozen modules to the global lists in frozen.c the script cpython/Tools/build/freeze_modules.py is used. I also found that the "encodings" module is non-frozen not by accident and can be restored (see: https://github.com/python/cpython/blob/8ac7613dc8b8f82253d7c0e2b6ef6ed703a0a1ee/Tools/build/freeze_modules.py#L56). So, putting it all together, I created a helper CMakeLists.txt in my project that does all the magic for my static runtime, and everything works: CMakeLists.txt I think it would be great to implement such patches and generation here, in python-cmake-buildsystem project to not patch the project that patches CPython :D ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |