GaijinEntertainment / DagorEngine

Dagor Engine and Tools source code from Gaijin Games KFT
Other
2.2k stars 274 forks source link

Python versions prior to 3.3 fail for linux due to non-standard OS identification based on sys.platform #77

Closed RandomGamingDev closed 2 weeks ago

RandomGamingDev commented 2 months ago

When identifying linux this is used:

sys.platform == 'linux'

but it fails for versions prior to python 3.3 since sys.platform used to include the kernel version, which was removed in python 3.3 which can be seen here: https://bugs.python.org/issue12326

The standard usage which is documented here is to replace it with sys.platform.startswith('linux') not only for linux, both other OSes as well, which provides better backwards and forward compatibility, and also means better support for other platforms (e.g. bsd): https://docs.python.org/3/library/sys.html#sys.platform

Unrelated Question: Will bsd support ever come to the DagorEngine?

NicSavichev commented 2 months ago

I'm afraid we require minimun Python 3.10, so 3.3- is irrelevant. Version should be checked better on script prologue.

NicSavichev commented 2 months ago

Will bsd support ever come to the DagorEngine?

There should not be any global problems for building DagorEngine for any unix/linux OS, including BSD. If you can suggest some relevant OS build for testing I can check and fix issues found. Engine requires modern compilers (gcc and/or clang) capable of at least C++17 and small number of installed libs. make_devtools.py can be changed for specific OS distributive to install needed packages (using names suitable for this distributive and using packet manager available in that OS)