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

Zip python standard library on MacOS #112

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

o01eg
Copy link
Contributor

@o01eg o01eg commented Apr 9, 2023

Looks like MacOS supports archived standard library so I decided to enable it in addition to Windows and Android.

@o01eg o01eg self-assigned this Apr 9, 2023
@o01eg o01eg force-pushed the bump-python-3.8.12-zip branch 2 times, most recently from e1d9adf to 01d5071 Compare April 10, 2023 17:37
@o01eg o01eg mentioned this pull request Apr 10, 2023
Copy link
Member

@Vezzra Vezzra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can build the SDK with this PR, but when I try to build FO with that SDK, cmake fails:

-- Setting build type to 'Release' as none was specified.
-- Build type CMAKE_BUILD_TYPE set to Release
-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Use CCache for Xcode called with: ccache program  
-- Performing Test NOT_GNU_CXX_BUG_94190
-- Performing Test NOT_GNU_CXX_BUG_94190 - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found PythonInterp: /Users/user/SoftwareProjekte/FO/main/build/dep/bin/python3 (Required is at least version "3.7") 
-- Found PythonLibs: /Users/user/SoftwareProjekte/FO/main/build/dep/lib/libpython3.8.a (found suitable version "3.8.16", minimum required is "3.7") 
-- Python library version detected 3.8.16
-- Boost python version 38
CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:270 (find_package)


-- Boost version: 1.81.0
-- Found the following Boost libraries:
--   filesystem
--   iostreams
--   locale
--   log
--   log_setup
--   serialization
--   system
--   thread
--   regex
--   date_time
--   chrono
--   atomic
CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:282 (find_package)


-- Boost version: 1.81.0
-- Found the following Boost libraries:
--   python38
-- Found ZLIB: /Users/user/SoftwareProjekte/FO/main/build/dep/lib/libz.a (found version "1.2.11") 
-- Found SDL: /Users/user/SoftwareProjekte/FO/main/build/dep/Frameworks/SDL2.framework (found version "2.0.12") 
-- Found Freetype: /Users/user/SoftwareProjekte/FO/main/build/dep/lib/libfreetype.a (found version "2.9.0") 
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/OpenGL.framework   
-- Found OpenAL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/OpenAL.framework  
-- Found Ogg: /Users/user/SoftwareProjekte/FO/main/build/dep/Frameworks/ogg.framework  
-- Found Vorbis: /Users/user/SoftwareProjekte/FO/main/build/dep/Frameworks/vorbis.framework   
CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  GG/CMakeLists.txt:66 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  GG/CMakeLists.txt:66 (find_package)


CMake Warning at cmake/FindBoost.cmake:924 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/FindBoost.cmake:1046 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/FindBoost.cmake:1736 (_Boost_MISSING_DEPENDENCIES)
  GG/CMakeLists.txt:66 (find_package)


-- Boost version: 1.81.0
-- Found the following Boost libraries:
--   filesystem
--   regex
--   system
-- Found GLEW: /Users/user/SoftwareProjekte/FO/main/build/dep/include (found version "2.2.0") 
-- Found PNG: /Users/user/SoftwareProjekte/FO/main/build/dep/lib/libpng.a (found version "1.6.37") 
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/Users/user/SoftwareProjekte/FO/main/build/dep/bin/python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/Users/user/SoftwareProjekte/FO/main/build/dep/bin/python3'
  sys.base_prefix = '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL'
  sys.base_exec_prefix = '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL'
  sys.executable = '/Users/user/SoftwareProjekte/FO/main/build/dep/bin/python3'
  sys.prefix = '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL'
  sys.exec_prefix = '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL'
  sys.path = [
    '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL/lib/python38.zip',
    '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL/lib/python3.8',
    '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL/lib/python3.8/lib-dynload',
    '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL/lib/python3.8/plat-darwin',
    '/Users/user/SoftwareProjekte/FO/sdk/build/INSTALL/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
Traceback (most recent call last):
  File "<frozen zipimport>", line 520, in _get_decompress_func
ModuleNotFoundError: No module named 'zlib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen zipimport>", line 568, in _get_data
  File "<frozen zipimport>", line 523, in _get_decompress_func
zipimport.ZipImportError: can't decompress data; zlib not available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen zipimport>", line 241, in load_module
  File "<frozen zipimport>", line 709, in _get_module_code
  File "<frozen zipimport>", line 570, in _get_data
zipimport.ZipImportError: can't decompress data; zlib not available
CMake Error at CMakeLists.txt:371 (message):
  FreeOrion version failed


-- Configuring incomplete, errors occurred!
See also "/Users/user/SoftwareProjekte/FO/main/build/CMakeFiles/CMakeOutput.log".

@o01eg
Copy link
Contributor Author

o01eg commented Apr 14, 2023

Yes, I'm not managed it to work. I'll try again after Python 3.9 will be merged

@o01eg o01eg marked this pull request as draft April 14, 2023 19:33
@o01eg
Copy link
Contributor Author

o01eg commented Apr 15, 2023

@geoffthemedio
Copy link
Member

no comment...

@Vezzra
Copy link
Member

Vezzra commented Apr 16, 2023

@o01eg, using the links you provided, I can build the v15 version of the SDK of your repo, but building the macos-python-no-framework-zip branch of your repo with that SDK still fails.

Build logs: build_logs.zip

@o01eg
Copy link
Contributor Author

o01eg commented Apr 16, 2023

@Vezzra Yes, it fails on CI too, not sure what wrong with it.

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

Successfully merging this pull request may close these issues.

3 participants