From 73c751afaf302a73fc557bd2b5edffb5ee63b393 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Mon, 19 May 2025 14:43:49 -0600 Subject: [PATCH] Deps_builder: Win: X64: Fix msys2 setup on a freshly installed environment diff.exe requires newer runtime dll's. For now only fix this on X64 as on windows on arm there's issues with newer msys2 versions (but I do now know exactly what they are anthony has brought it up in the past) this can however not remain in a broken state, so fixing it for X64 only. Also fix typo in download_package function These two fixes together should bring a fresh vmprep install back to working order. --- .../build_environment/cmake/setup_msys2.cmake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build_files/build_environment/cmake/setup_msys2.cmake b/build_files/build_environment/cmake/setup_msys2.cmake index f2c1abf3823..fab395cd942 100644 --- a/build_files/build_environment/cmake/setup_msys2.cmake +++ b/build_files/build_environment/cmake/setup_msys2.cmake @@ -24,7 +24,7 @@ macro(download_package package_name) set(MSYS2_${package_name}_FILE ${_final_filename}) if(NOT EXISTS "${_final_filename}") if(MSYS2_USE_UPSTREAM_PACKAGES) - set(_final_url ${URI}) + set(_final_url ${URL}) else() set(_final_url "https://projects.blender.org/blender/lib-windows_x64/media/branch/build_environment/${_file_name}") endif() @@ -132,6 +132,20 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/m4.exe") ) message(STATUS "Installing required packages") + + if(NOT BLENDER_PLATFORM_WINDOWS_ARM) + # A newer runtime package is required since the tools downloaded in the next step + # depend on it, we however cannot update the runtime from a msys2_shell.cmd since + # bash.exe will lock the runtime dlls so we execute pacman directly. + # + # For now only run this on X64 as there are some known issues (but unknown to me) + # with newer msys2 on Windows on ARM. + execute_process( + COMMAND ${DOWNLOAD_DIR}/msys2/msys64/usr/bin/pacman -S msys2-runtime --noconfirm + WORKING_DIRECTORY ${DOWNLOAD_DIR}/msys2/msys64 + ) + endif() + execute_process( COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c "pacman -S patch m4 coreutils pkgconf make diffutils autoconf-wrapper --noconfirm && exit"