Skip to content

Commit

Permalink
Fix Windows build busters.
Browse files Browse the repository at this point in the history
- 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 repectively.
  • Loading branch information
acolwell committed Oct 16, 2023
1 parent 525a5d5 commit a5a93f4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ on:
workflow_dispatch: {}
push:

env:
NATRON_BUILD_WORKSPACE: 'D:/nbw'
CI: 'True'

jobs:
win-installer:
name: Windows Installer
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
env:
CI: 'True'

steps:
- name: Checkout branch
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -76,8 +77,6 @@ jobs:
defaults:
run:
shell: msys2 {0}
env:
CI: 'True'

steps:
- name: Checkout branch
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 1 addition & 3 deletions Global/GlobalDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <Python.h>
// ***** END PYTHON BLOCK *****

#include <cstdint>
#include <utility>
#if defined(_WIN32)
#include <string>
Expand All @@ -47,9 +48,6 @@
#undef isalpha
#undef isalnum

#if !defined(Q_MOC_RUN) && !defined(SBK_RUN)
#include <cstdint>
#endif
#include <QtCore/QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QtCore/QForeachContainer>
Expand Down
27 changes: 20 additions & 7 deletions tools/jenkins/build-Windows-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit a5a93f4

Please sign in to comment.