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

Update SDK Python to 3.9.10 #88

Merged
merged 1 commit into from
Apr 16, 2023
Merged

Conversation

o01eg
Copy link
Contributor

@o01eg o01eg commented Apr 4, 2022

No description provided.

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.

Looks ok AFAICT.

@o01eg
Copy link
Contributor Author

o01eg commented Apr 10, 2022

Did you try to build freeorion with it on Windows and MacOS?

@Vezzra
Copy link
Member

Vezzra commented Apr 10, 2022

Did you try to build freeorion with it on Windows and MacOS?

Oh, you want me to test it - no, I didn't have the time for that yet. Will try to get around to it next week...

@Vezzra

This comment was marked as outdated.

@o01eg
Copy link
Contributor Author

o01eg commented Apr 15, 2022

0001-... was adoped to upstream I see. I've removed it but later I'll check other patches.
0002-... still correct.

@Vezzra
Copy link
Member

Vezzra commented Apr 18, 2022

... later I'll check other patches

Ok, tell me when you're done with checking the patches, then I'll try again.

@o01eg
Copy link
Contributor Author

o01eg commented May 8, 2022

@Vezzra Could you try again?

I reimported patches to python-cmake git, rebased them and reformatted them as patches.

@o01eg
Copy link
Contributor Author

o01eg commented May 8, 2022

Also, could we make something with broken CI here?

Vezzra
Vezzra previously requested changes May 10, 2022
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.

Patching the Python cmake files seems to work now, but the subsequent cmake configure step fails with this error:

CMake Error at CMakeLists.txt:870 (endif):
  endif An ENDIF command was found outside of a proper IF ENDIF structure.
  Or its arguments did not match the opening IF command.

Complete cmake console output attached:
cmake_output.txt.zip

@Vezzra
Copy link
Member

Vezzra commented May 10, 2022

Here is the cmake file the error message refers to (I think). There is a lonely endif statement on the indicated line, I hope you can figure out how that happened/how to fix it. I guess some of the patching, while not failing with an error, still doesn't work as it should...?

CMakeLists.txt.zip

@o01eg o01eg requested a review from Vezzra May 10, 2022 13:59
@o01eg o01eg dismissed Vezzra’s stale review May 10, 2022 13:59

I've updated broken patch

@o01eg
Copy link
Contributor Author

o01eg commented May 10, 2022

Found mismatched if-endif. Fixed it.

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.

The SDK builds successfully now, but I can't build FO master with that SDK. It fails during the cmake configure step, cmake output is this:

-- Setting build type to 'Release' as none was specified.
-- Build type CMAKE_BUILD_TYPE set to Release
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- 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
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.8.3", minimum required is "3.6") 
-- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib (found suitable version "3.8.3", minimum required is "3.6") 
-- Python library version detected 3.8.3
-- 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:254 (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:254 (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:254 (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:254 (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:254 (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:254 (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:254 (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:254 (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:254 (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:254 (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:254 (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:254 (find_package)


-- Boost version: 1.74.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:266 (find_package)


-- Boost version: 1.74.0
-- Found the following Boost libraries:
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 Error at cmake/FindBoost.cmake:2174 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.74.0

  Boost include path: /Users/user/SoftwareProjekte/FO/main/build/dep/include

  Could not find the following Boost libraries:

          boost_python3

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:270 (find_package)


-- 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/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework   
-- Found OpenAL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.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.74.0
-- Found the following Boost libraries:
--   filesystem
--   regex
--   system
-- Found GLEW: /Users/user/SoftwareProjekte/FO/main/build/dep/include  
-- Found PNG: /Users/user/SoftwareProjekte/FO/main/build/dep/lib/libpng.a (found version "1.6.37") 
Build number matches build number in existing Version.cpp, skip regenerating it
Build number matches build number in existing Version.cpp, skip regenerating it
Building v0.4.10+ build 2022-05-09.3abfde4
-- Could NOT find CPPCheck (missing: CPPCHECK_EXECUTABLE) 
-- Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE) 
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
INSTALL TARGETS - target freeorion has RESOURCE files but no RESOURCE DESTINATION.
-- Configuring incomplete, errors occurred!
See also "/Users/user/SoftwareProjekte/FO/main/build/CMakeFiles/CMakeOutput.log".

@o01eg
Copy link
Contributor Author

o01eg commented May 13, 2022

@Vezzra It found incorrect python installation. Could you point it to 3.9 python with -DPYTHON_EXECUTABLE ?

@o01eg o01eg requested a review from Vezzra May 13, 2022 11:03
@Vezzra
Copy link
Member

Vezzra commented May 15, 2022

@o01eg,

It found incorrect python installation. Could you point it to 3.9 python with -DPYTHON_EXECUTABLE ?

Ah, ok. Tried that now, however, I didn't use -DPYTHON_EXECUTABLE, but adjusted lines 117 and 245 in CMakeLists.txt to Python version 3.9. Anyway, it worked. Can build and run FO with the new SDK now.

I ran the test on my Mac, do you need me to do that test also on Windows?

@o01eg
Copy link
Contributor Author

o01eg commented May 15, 2022

Yes, but I suppose it will be simpler as Windows doesn't tend to have system-wide installed python.

@o01eg o01eg requested a review from Vezzra May 15, 2022 16:00
@geoffthemedio
Copy link
Member

On Windows, building the SDK seems to work, but the resulting zip is slightly oddly named: FreeOrionSDK_12_MSVC-v142-.zip

@geoffthemedio
Copy link
Member

I tried bulding the SDK and then FreeOrion in x64 mode, and it seems to work. Just had to tweak the FreeOrion MSVC project files somewhat. Maybe that's the solution going forward? Switch to x64 builds?

@o01eg o01eg mentioned this pull request May 17, 2022
@o01eg
Copy link
Contributor Author

o01eg commented May 17, 2022

@geoffthemedio I've opened PR to fix possible choose of wrong architecture in GLEW #90

@o01eg o01eg force-pushed the sdk-python3.9.10 branch 3 times, most recently from 28b8429 to bd87b7b Compare May 19, 2022 06:02
@o01eg o01eg marked this pull request as draft May 26, 2022 12:30
@hifron
Copy link

hifron commented May 30, 2022

If building FO(with Python 3.6) on Windows 11 with VS 22, there is needed 32bit Python and compiling with VS Code needs choosing VS compiler version amd64_x86 (that's compiling on 64bit architecture for 32bit app)... But 32bit version of compilers and its testing for production is probably no more so tested including recent problems on Windows Server 2022 when were present various malfunctions in practice...

MacOS problems could maybe resolved by switching MacOS to version 11 instead of 10.something(10.15?)... There is already version MacOS 12 in beta, which maybe next year will be actual, who knows... https://github.com/actions/virtual-environments

@o01eg o01eg marked this pull request as ready for review April 10, 2023 13:57
@geoffthemedio
Copy link
Member

SDK builds seemingly OK. Building FreeOrion with CMake gives errors:

C:\Users\g_top\Desktop\FOSDK14\FreeOrion\build>cmake .. -G "Visual Studio 17 2022" -T v143 -A x64 -DBUILD_TESTING=On -DCMAKE_C_FLAGS=/MP -DCMAKE_CXX_FLAGS=/MP -DPYTHON_EXECUTABLE="C:\Users\g_top\Desktop\FOSDK14\bin\python3.9.exe" -DPYTHON_LIBRARY="C:\Users\g_top\Desktop\FOSDK14\lib\python39.lib" -DPYTHON_INCLUDE_DIR="C:\Users\g_top\Desktop\FOSDK14\include\python3.9\"

[...]

Traceback (most recent call last):
  File "C:\Users\g_top\Desktop\FOSDK14\bin\python39.zip\subprocess.py", line 74, in <module>
ModuleNotFoundError: No module named '_winapi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\g_top\Desktop\FOSDK14\FreeOrion\cmake\make_versioncpp.py", line 8, in <module>
    from platform import system
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\g_top\Desktop\FOSDK14\bin\python39.zip\platform.py", line 119, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\g_top\Desktop\FOSDK14\bin\python39.zip\subprocess.py", line 78, in <module>
ModuleNotFoundError: No module named '_posixsubprocess'
CMake Error at CMakeLists.txt:371 (message):
  FreeOrion version failed


-- Configuring incomplete, errors occurred!
See also "C:/Users/g_top/Desktop/FOSDK14/FreeOrion/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/g_top/Desktop/FOSDK14/FreeOrion/build/CMakeFiles/CMakeError.log".

C:\Users\g_top\Desktop\FOSDK14\FreeOrion\build>

CMakeOutput.log
CMakeError.log

@o01eg
Copy link
Contributor Author

o01eg commented Apr 10, 2023

That because I set -DENABLE_WINAPI=OFF. I copied it from attempt year ago, not sure what was wrong here.

@o01eg

This comment was marked as outdated.

@o01eg
Copy link
Contributor Author

o01eg commented Apr 12, 2023

Release made with this changes https://github.com/o01eg/freeorion-sdk/releases/tag/v14

@o01eg
Copy link
Contributor Author

o01eg commented Apr 12, 2023

Updated branch macos-python-no-framework for it.

Also made artifacts from it for MacOS: https://github.com/o01eg/freeorion/actions/runs/4676648333

@geoffthemedio
Copy link
Member

builds OK with CMake when specifying the python pathes. didn't try without specifying them.

@o01eg
Copy link
Contributor Author

o01eg commented Apr 13, 2023

Nice, wait for @Vezzra for result. I've updated minimum MacOS version for boost also #107 (review)

@Vezzra
Copy link
Member

Vezzra commented Apr 14, 2023

wait for @Vezzra for result

@o01eg, what do you need from me? Shall I re-test this PR if it still works on macOS?

@o01eg
Copy link
Contributor Author

o01eg commented Apr 14, 2023

@Vezzra May be only test if artifact works.

@Vezzra
Copy link
Member

Vezzra commented Apr 14, 2023

Ok, I did test it anyway, and I get errors now. I can build the SDK, but building FO with that SDK fails.

Build logs: build_logs.zip

@o01eg
Copy link
Contributor Author

o01eg commented Apr 14, 2023

@Vezzra I've add fixes to my branch macos-python-no-framework

@o01eg
Copy link
Contributor Author

o01eg commented Apr 15, 2023

I propose to release SDK after merging this PR.

@Vezzra
Copy link
Member

Vezzra commented Apr 16, 2023

I propose to release SDK after merging this PR.

Any PRs in the main freeorion repo that need to get merged into master for master to successfully build and run with the new version of the SDK?

@o01eg
Copy link
Contributor Author

o01eg commented Apr 16, 2023

@Vezzra I didn't open mine PR yet from macos-python-no-framework

I've opened PR: freeorion/freeorion#4482

@o01eg o01eg merged commit 1a10119 into freeorion:master Apr 16, 2023
@o01eg o01eg deleted the sdk-python3.9.10 branch April 16, 2023 16:05
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.

4 participants