AcademySoftwareFoundation / xstudio

xSTUDIO is a modern, high performance and feature rich playback and review application designed for organisations and individuals in the post production, VFX and Animation industries.
Apache License 2.0
639 stars 83 forks source link

xStudio Installation on Windows: Missing distutils in Python 3.12.7 #123

Open derek-rein opened 1 month ago

derek-rein commented 1 month ago

I encountered an issue while trying to build the xStudio project on Windows. The build process fails with an error indicating that the Python environment is missing the distutils module. Below are the details of the build output.

Severity    Code    Description Project File    Line    Suppression State   Details
Error       CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: C:/xStudio/build/vcpkg/downloads/tools/python/python-3.12.7-x64/python.exe -I C:/xStudio/build/vcpkg_installed/x64-windows/tools/meson/meson.py -Ddoc=disabled -Dcache-build=disabled -Dtests=disabled --backend ninja --wrap-mode nodownload -Dbuildtype=plain --libdir lib --native C:/xStudio/build/vcpkg/buildtrees/fontconfig/meson-x64-windows-dbg.log -Ddebug=true --prefix C:/xStudio/build/vcpkg/packages/fontconfig_x64-windows/debug --includedir ../include -Dcmake_prefix_path=['C:/xStudio/build/vcpkg_installed/x64-windows/debug','C:/xStudio/build/vcpkg_installed/x64-windows','C:/xStudio/build/vcpkg_installed/x64-windows/share'] C:/xStudio/build/vcpkg/buildtrees/fontconfig/src/2.14.2-7f52ee670b.clean
    Working Directory: C:/xStudio/build/vcpkg/buildtrees/fontconfig/x64-windows-dbg
    Error code: 1
    See logs for more information:
      C:\xStudio\build\vcpkg\buildtrees\fontconfig\config-x64-windows-dbg-meson-log.txt.log
      C:\xStudio\build\vcpkg\buildtrees\fontconfig\config-x64-windows-dbg-out.log       C:\xStudio\scripts/cmake/vcpkg_execute_required_process.cmake           

C:\xStudio\build\vcpkg\buildtrees\fontconfig\config-x64-windows-dbg-meson-log.txt.log

...

'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte
Unusable script 'C:/xStudio/build/vcpkg/downloads/tools/python/python-3.12.7-x64/python.exe'
Could not introspect Python (['C:/xStudio/build/vcpkg/downloads/tools/python/python-3.12.7-x64/python.exe', 'C:\\Users\\user\\AppData\\Local\\Temp\\tmprgyhhhwt.py']): exit code 1

Program stderr:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Temp\tmprgyhhhwt.py", line 5, in <module>
    import distutils.command.install
ModuleNotFoundError: No module named 'distutils'

..\src\2.14.2-7f52ee670b.clean\meson.build:47:0: ERROR: <PythonExternalProgram 'python' -> ['C:/xStudio/build/vcpkg/downloads/tools/python/python-3.12.7-x64/python.exe']> is not a valid python or it is missing distutils

C:\xStudio\build\vcpkg\buildtrees\fontconfig\config-x64-windows-dbg-out.log

...
Found pkg-config: C:/xStudio/build/vcpkg/downloads/tools/msys2/1e74ca60daa10104/mingw64/bin/pkg-config.exe (2.2.0)
Run-time dependency freetype2 found: YES 24.3.18
Run-time dependency expat found: YES 2.5.0

..\src\2.14.2-7f52ee670b.clean\meson.build:47:0: ERROR: <PythonExternalProgram 'python' -> ['C:/xStudio/build/vcpkg/downloads/tools/python/python-3.12.7-x64/python.exe']> is not a valid python or it is missing distutils

A full log can be found at C:\xStudio\build\vcpkg\buildtrees\fontconfig\x64-windows-dbg\meson-logs\meson-log.txt

Steps to Reproduce:

Attempt to build the xStudio project using the provided build commands. Observe the output related to the missing distutils module. Expected Behavior: The build should complete successfully without errors related to missing Python modules.

Additional Notes: From Python 3.12.x distutils was removed in favor of setuptools. Dev environment tested with both 3.10 and 3.11 on PATH.

maxpareschi commented 3 weeks ago

I can second the bug, same problem on my end. solution would be to upgrade meson to >= 1.3.0 to be compatible with 3.12 after distuitils removal or downgrade to python 3.11 for this particular build as mentioned here: https://github.com/microsoft/vcpkg/issues/35332

Rapheus commented 1 week ago

+1 Having the same problem on my end as well

tedwaine commented 22 hours ago

Hi - I'm working on this. A workaround is to change the "features": ["all"] against the ffmpeg target in the vcpkg.json file. It's ffmpeg that has a dependency on fontconfig, but I doubt we need that feature for xstudio anyway.

tedwaine commented 20 hours ago

This will be fixed in the next release. To get around it now you can edit the vcpkg.json file. Try replacing this entry

{"ffmpeg", "features": ["all"]}

with something like this:

{ "name": "ffmpeg", "features": [ "aom", "avcodec", "avdevice", "avfilter", "avformat", "bzip2", "dav1d", "iconv", "lzma", "mp3lame", "openjpeg", "openmpt", "openssl", "opus", "snappy", "soxr", "speex", "swresample", "swscale", "theora", "vorbis", "vpx", "webp", "xml2", "x264", "x265", "zlib" ] }