From cc3bea03563971d4fbe669af9b98159c13a45a47 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:07:00 -0700 Subject: [PATCH] Fix Windows build busters. - Always include cstdint in GlobalDefines.h to avoid missing decl errors. - Change NATRON_BUILD_WORKSPACE to a shorter path to avoid path length errors that can occur during python file compilation. - Change logic in build-Windows-installer.sh related to mt.exe and the Qt Installer Framework so that these binaries could be retrieved from the Windows SDK and msys2 respectively. --- .github/workflows/build_installer.yml | 10 ++++----- Global/GlobalDefines.h | 4 +--- tools/jenkins/build-Windows-installer.sh | 27 ++++++++++++++++++------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_installer.yml b/.github/workflows/build_installer.yml index 7c2207b7d..2797cb013 100644 --- a/.github/workflows/build_installer.yml +++ b/.github/workflows/build_installer.yml @@ -4,6 +4,10 @@ on: workflow_dispatch: {} push: +env: + NATRON_BUILD_WORKSPACE: 'D:/nbw' + CI: 'True' + jobs: win-installer: name: Windows Installer @@ -11,8 +15,6 @@ jobs: defaults: run: shell: msys2 {0} - env: - CI: 'True' steps: - name: Checkout branch @@ -41,7 +43,6 @@ jobs: - name: Build id: build run: | - NATRON_BUILD_WORKSPACE=${GITHUB_WORKSPACE}/natron_build NATRON_BUILD_WORKSPACE_UNIX=$(cygpath -u ${NATRON_BUILD_WORKSPACE}) mkdir ${NATRON_BUILD_WORKSPACE_UNIX} @@ -76,8 +77,6 @@ jobs: defaults: run: shell: msys2 {0} - env: - CI: 'True' steps: - name: Checkout branch @@ -106,7 +105,6 @@ jobs: - name: Build id: build run: | - NATRON_BUILD_WORKSPACE=${GITHUB_WORKSPACE}/natron_build NATRON_BUILD_WORKSPACE_UNIX=$(cygpath -u ${NATRON_BUILD_WORKSPACE}) mkdir ${NATRON_BUILD_WORKSPACE_UNIX} diff --git a/Global/GlobalDefines.h b/Global/GlobalDefines.h index 3a41fc94c..3fe45350d 100644 --- a/Global/GlobalDefines.h +++ b/Global/GlobalDefines.h @@ -26,6 +26,7 @@ #include // ***** END PYTHON BLOCK ***** +#include #include #if defined(_WIN32) #include @@ -47,9 +48,6 @@ #undef isalpha #undef isalnum -#if !defined(Q_MOC_RUN) && !defined(SBK_RUN) -#include -#endif #include #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include diff --git a/tools/jenkins/build-Windows-installer.sh b/tools/jenkins/build-Windows-installer.sh index d021db062..b70c9a071 100755 --- a/tools/jenkins/build-Windows-installer.sh +++ b/tools/jenkins/build-Windows-installer.sh @@ -131,14 +131,27 @@ $GSED -e "s/_VERSION_/${NATRON_VERSION_FULL}/;s#_RBVERSION_#${NATRON_GIT_BRANCH} cp "$INC_PATH/config/"*.png "$INSTALLER_PATH/config/" # make sure we have mt and qtifw -if [ ! -f "$SDK_HOME/bin/mt.exe" ] || [ ! -f "$SDK_HOME/bin/binarycreator.exe" ]; then - if [ ! -d "$SRC_PATH/natron-windows-installer" ]; then - ( cd "$SRC_PATH"; - $CURL "$THIRD_PARTY_BIN_URL/natron-windows-installer.zip" --output "$SRC_PATH/natron-windows-installer.zip" - unzip natron-windows-installer.zip - ) + +if ! which mt.exe; then + # Add Windows SDK to path so that mt.exe is available. + WIN_SDK_MAJOR_VERSION=10 + WIN_SDK_BASE_PATH="/c/Program Files (x86)/Windows Kits/${WIN_SDK_MAJOR_VERSION}/bin" + WIN_SDK_VERSION=$(ls "${WIN_SDK_BASE_PATH}" | grep "${WIN_SDK_MAJOR_VERSION}." | sort -n | tail -1) + PATH="${WIN_SDK_BASE_PATH}/${WIN_SDK_VERSION}/x64/":${PATH} + + if ! which mt.exe; then + echo "Failed to find mt.exe" + exit 1 + fi +fi + +if ! which binarycreator.exe && [ ! -f "/Setup.exe" ]; then + pacman -S mingw-w64-x86_64-qt-installer-framework + + if ! which binarycreator.exe; then + echo "Failed to find binarycreator.exe" + exit 1 fi - cp "$SRC_PATH/natron-windows-installer/mingw$BITS/bin/"{archivegen.exe,binarycreator.exe,installerbase.exe,installerbase.manifest,repogen.exe,mt.exe} "$SDK_HOME/bin/" fi function installPlugin() {