Closed heinezen closed 6 months ago
Wow, what a clusterfuck, I remember when we discovered that. Didn't know it's still leaving its trail! Excellent idea with the DllManager, will probably make it much easier to react to Python's weirdness in that regard in the future. 👍🏽
Fixes the import errors for the compiled libraries and Python modules on Windows by adding better default search paths. If you build openage from source with the documented instructions, there shouldn't be any Python errors after this PR.
The problem in https://github.com/SFTtech/openage/issues/1644 was that the dependent libraries were no longer found automatically since Python 3.8 and you had to use
--add-dll-search-path
to avoid errors. However, it's not always obvious how this argument should be used. Therefore, openage now sets sane defaults to search for:python.dll
openage.dll
nyan.dll
Furthermore, it fixes the errors in https://github.com/SFTtech/openage/issues/1624 . These happened because the DLLs are only set per process, so subprocesses in
multiprocessing
were not aware about the DLL search paths. This problem is now solved by adding aDllDirectoryManager
object that can be passed around and then used to add/remove DLL search paths.