Skip to content

Commit

Permalink
Windows fix + add ci without ci-openrv from aswf for now
Browse files Browse the repository at this point in the history
Signed-off-by: Cédrik Fuoco <[email protected]>
  • Loading branch information
cedrik-fuoco-adsk committed Nov 1, 2024
1 parent 5ca3dd8 commit 7a6f8f5
Show file tree
Hide file tree
Showing 18 changed files with 710 additions and 345 deletions.
20 changes: 17 additions & 3 deletions .github/actions/build-qt5-for-arm64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ inputs:
qt-version:
description: 'Qt version to build'
required: true
qt-version-short:
description: 'Qt version to build major.minor'
required: true
vfx-platform:
description: 'VFX Platform'
required: true
python3-version:
description: 'Python 3 version'
required: true
Expand Down Expand Up @@ -93,9 +99,17 @@ runs:
shell: bash

- name: Download Qt ${{ inputs.qt-version }} source
if: steps.arm64-qt.outputs.cache-hit != 'true'
if: steps.arm64-qt.outputs.cache-hit != 'true' && matrix.vfx-platform == 'CY2023'
run: |
curl https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/official_releases/qt/${{ inputs.qt-version-short }}/${{ inputs.qt-version }}/single/qt-everywhere-opensource-src-${{ inputs.qt-version }}.tar.xz -o qt.tar.xz
tar xf qt.tar.xz
mv qt-everywhere-src-${{ inputs.qt-version }} qt-src
shell: bash

- name: Download Qt ${{ inputs.qt-version }} source
if: steps.arm64-qt.outputs.cache-hit != 'true' && matrix.vfx-platform == 'CY2024'
run: |
curl https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/official_releases/qt/5.15/${{ inputs.qt-version }}/single/qt-everywhere-opensource-src-${{ inputs.qt-version }}.tar.xz -o qt.tar.xz
curl https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/official_releases/qt/${{ inputs.qt-version-short }}/${{ inputs.qt-version }}/single/qt-everywhere-src-${{ inputs.qt-version }}.tar.xz -o qt.tar.xz
tar xf qt.tar.xz
mv qt-everywhere-src-${{ inputs.qt-version }} qt-src
shell: bash
Expand All @@ -115,7 +129,7 @@ runs:
-no-rpath \
-opensource \
-plugin-sql-sqlite \
-openssl \
-openssl-linked \
-verbose \
-opengl desktop \
-no-warnings-are-errors \
Expand Down
232 changes: 219 additions & 13 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions cmake/dependencies/patch/python.3.11.get_externals.bat.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
index b4362a5a25..5deb59828f 100644
index dfacd1d1e78..a6699138548 100644
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -53,7 +53,7 @@ echo.Fetching external libraries...
set libraries=
set libraries=%libraries% bzip2-1.0.8
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.4
-if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.0.13
+if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1u
set libraries=%libraries% sqlite-3.45.1.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.12.1
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.12.1
-if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.0.15
+if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.4.0
set libraries=%libraries% mpdecimal-4.0.0
set libraries=%libraries% sqlite-3.45.3.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.15.0
@@ -77,7 +77,7 @@ echo.Fetching external binaries...

set binaries=
if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi-3.4.4
-if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.0.13
+if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1u
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.12.1
-if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.0.15
+if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.4.0
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.15.0
if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06

14 changes: 7 additions & 7 deletions cmake/dependencies/patch/python.3.11.python.props.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/PCbuild/python.props b/PCbuild/python.props
index d85fe4ab2a..ff2224251f 100644
index 6e90178f4ea..7e8072d4b0b 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -74,8 +74,8 @@
<libffiDir Condition="$(libffiDir) == ''">$(ExternalsDir)libffi-3.4.4\</libffiDir>
@@ -71,8 +71,8 @@
<libffiOutDir Condition="$(libffiOutDir) == ''">$(libffiDir)$(ArchName)\</libffiOutDir>
<libffiIncludeDir Condition="$(libffiIncludeDir) == ''">$(libffiOutDir)include</libffiIncludeDir>
- <opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-3.0.13\</opensslDir>
- <opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-3.0.13\$(ArchName)\</opensslOutDir>
+ <opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-1.1.1u\</opensslDir>
+ <opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-1.1.1u\$(ArchName)\</opensslOutDir>
<mpdecimalDir Condition="$(mpdecimalDir) == ''">$(ExternalsDir)\mpdecimal-4.0.0\</mpdecimalDir>
- <opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-3.0.15\</opensslDir>
- <opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-3.0.15\$(ArchName)\</opensslOutDir>
+ <opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-3.4.0\</opensslDir>
+ <opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-3.4.0\$(ArchName)\</opensslOutDir>
<opensslIncludeDir Condition="$(opensslIncludeDir) == ''">$(opensslOutDir)include</opensslIncludeDir>
<nasmDir Condition="$(nasmDir) == ''">$(ExternalsDir)\nasm-2.11.06\</nasmDir>
<zlibDir Condition="$(zlibDir) == ''">$(ExternalsDir)\zlib-1.3.1\</zlibDir>
83 changes: 28 additions & 55 deletions cmake/dependencies/python3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
#


SET(_python3_target
"RV_DEPS_PYTHON3"
)
Expand All @@ -13,27 +12,15 @@ SET(_opentimelineio_target
"RV_DEPS_OPENTIMELINEIO"
)

RV_VFX_SET_VARIABLE(
_pyside_target
CY2023 "RV_DEPS_PYSIDE2"
CY2024 "RV_DEPS_PYSIDE6"
)
RV_VFX_SET_VARIABLE(_pyside_target CY2023 "RV_DEPS_PYSIDE2" CY2024 "RV_DEPS_PYSIDE6")

SET(PYTHON_VERSION_MAJOR
3
)

RV_VFX_SET_VARIABLE(
PYTHON_VERSION_MINOR
CY2023 "10"
CY2024 "11"
)
RV_VFX_SET_VARIABLE(PYTHON_VERSION_MINOR CY2023 "10" CY2024 "11")

RV_VFX_SET_VARIABLE(
PYTHON_VERSION_PATCH
CY2023 "13"
CY2024 "9"
)
RV_VFX_SET_VARIABLE(PYTHON_VERSION_PATCH CY2023 "13" CY2024 "9")

SET(_python3_version
"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}"
Expand All @@ -50,20 +37,12 @@ SET(_opentimelineio_version
"0.15"
)

RV_VFX_SET_VARIABLE(
_pyside_version
CY2023 "5.15.10"
CY2024 "6.5.3"
)
RV_VFX_SET_VARIABLE(_pyside_version CY2023 "5.15.10" CY2024 "6.5.3")

SET(_python3_download_url
"https://github.com/python/cpython/archive/refs/tags/v${_python3_version}.zip"
)
RV_VFX_SET_VARIABLE(
_python3_download_hash
CY2023 "21b32503f31386b37f0c42172dfe5637"
CY2024 "392eccd4386936ffcc46ed08057db3e7"
)
RV_VFX_SET_VARIABLE(_python3_download_hash CY2023 "21b32503f31386b37f0c42172dfe5637" CY2024 "392eccd4386936ffcc46ed08057db3e7")

SET(_opentimelineio_download_url
"https://github.com/AcademySoftwareFoundation/OpenTimelineIO"
Expand All @@ -74,15 +53,13 @@ SET(_opentimelineio_git_tag

RV_VFX_SET_VARIABLE(
_pyside_archive_url
CY2023 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside_version}-src/pyside-setup-opensource-src-${_pyside_version}.zip"
CY2024 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside6/PySide6-${_pyside_version}-src/pyside-setup-everywhere-src-${_pyside_version}.zip"
CY2023
"https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside_version}-src/pyside-setup-opensource-src-${_pyside_version}.zip"
CY2024
"https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside6/PySide6-${_pyside_version}-src/pyside-setup-everywhere-src-${_pyside_version}.zip"
)

RV_VFX_SET_VARIABLE(
_pyside_download_hash
CY2023 "87841aaced763b6b52e9b549e31a493f"
CY2024 "515d3249c6e743219ff0d7dd25b8c8d8"
)
RV_VFX_SET_VARIABLE(_pyside_download_hash CY2023 "87841aaced763b6b52e9b549e31a493f" CY2024 "515d3249c6e743219ff0d7dd25b8c8d8")

SET(_install_dir
${RV_DEPS_BASE_DIR}/${_python3_target}/install
Expand Down Expand Up @@ -141,10 +118,7 @@ IF(RV_TARGET_WINDOWS)
LIST(APPEND _python3_make_command "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
ENDIF()


# TODO_QT: Maybe we could use something like NOT CY2023
# since after 2023, it is Qt6
# TODO_QT: Below code could be simplified, but for now it is faster to test.
# TODO_QT: Maybe we could use something like NOT CY2023 since after 2023, it is Qt6 TODO_QT: Below code could be simplified, but for now it is faster to test.
IF(RV_VFX_PLATFORM STREQUAL CY2023)
SET(_pyside_make_command_script
"${PROJECT_SOURCE_DIR}/src/build/make_pyside.py"
Expand Down Expand Up @@ -175,10 +149,10 @@ IF(RV_VFX_PLATFORM STREQUAL CY2023)
LIST(APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT}")
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
SET(_pyside_make_command_script
"${PROJECT_SOURCE_DIR}/src/build/make_pyside6.py"
"${PROJECT_SOURCE_DIR}/src/build/make_pyside6.py"
)
SET(_pyside_make_command
python3 "${_pyside_make_command_script}"
python3 "${_pyside_make_command_script}"
)

LIST(APPEND _pyside_make_command "--variant")
Expand Down Expand Up @@ -278,20 +252,18 @@ SET(_requirements_install_command
)

IF(RV_TARGET_WINDOWS)
SET(_patch_python3_11_command
"patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python.3.11.openssl.props.patch &&\
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python.3.11.python.props.patch &&\
SET(_patch_python3_11_command
"patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python.3.11.python.props.patch &&\
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python.3.11.get_externals.bat.patch"
)

RV_VFX_SET_VARIABLE(
_patch_command
CY2023 ""
CY2024 "${_patch_python3_11_command}"
)
RV_VFX_SET_VARIABLE(_patch_command CY2023 "" CY2024 "${_patch_python3_11_command}")
# Split the command into a semi-colon separated list.
separate_arguments(_patch_command)
STRING(REGEX REPLACE ";+" ";" _patch_command "${_patch_command}")
SEPARATE_ARGUMENTS(_patch_command)
STRING(
REGEX
REPLACE ";+" ";" _patch_command "${_patch_command}"
)
ENDIF()

EXTERNALPROJECT_ADD(
Expand Down Expand Up @@ -343,10 +315,7 @@ SET(${_pyside_target}-build-flag
${_install_dir}/${_pyside_target}-build-flag
)


# TODO_QT: Maybe we could use something like NOT CY2023
# since after 2023, it is Qt6
# TODO_QT: Below code could be simplified, but for now it is faster to test.
# TODO_QT: Maybe we could use something like NOT CY2023 since after 2023, it is Qt6 TODO_QT: Below code could be simplified, but for now it is faster to test.
IF(RV_VFX_PLATFORM STREQUAL CY2023)
ADD_CUSTOM_COMMAND(
COMMENT "Building PySide2 using ${_pyside_make_command_script}"
Expand All @@ -360,7 +329,9 @@ IF(RV_VFX_PLATFORM STREQUAL CY2023)
USES_TERMINAL
)

SET(_build_flag_depends ${${_pyside_target}-build-flag})
SET(_build_flag_depends
${${_pyside_target}-build-flag}
)
ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
ADD_CUSTOM_COMMAND(
COMMENT "Building PySide6 using ${_pyside_make_command_script}"
Expand All @@ -371,7 +342,9 @@ ELSEIF(RV_VFX_PLATFORM STREQUAL CY2024)
USES_TERMINAL
)

SET(_build_flag_depends ${${_pyside_target}-build-flag})
SET(_build_flag_depends
${${_pyside_target}-build-flag}
)
ENDIF()

IF(RV_TARGET_WINDOWS)
Expand Down
16 changes: 9 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# This file contains all of RV's python build requirements. They are NOT packaged with the app.

pyyaml # License: MIT License (MIT)
requests # License: Apache Software License (Apache 2.0)
wheel # License: MIT License (MIT)
pyzstd==0.15.9 # License: BSD License (BSD-3-Clause)
py7zr==0.22.0 # License: GNU Lesser General Public License v2 or later (LGPLv2+) (LGPL-2.1-or-later)
dohq-artifactory # License: MIT License (MIT License)
pre-commit # License: MIT License (MIT)
pyyaml # License: MIT License (MIT)
requests # License: Apache Software License (Apache 2.0)
wheel # License: MIT License (MIT)
pyzstd==0.15.9; python_version <= '3.8' # License: BSD License (BSD-3-Clause)
pyzstd; python_version > '3.8' # License: BSD License (BSD-3-Clause)
py7zr==0.22.0; python_version <= '3.8' # License: GNU Lesser General Public License v2 or later (LGPLv2+) (LGPL-2.1-or-later)
py7zr; python_version > '3.8' # License: GNU Lesser General Public License v2 or later (LGPLv2+) (LGPL-2.1-or-later)
dohq-artifactory # License: MIT License (MIT License)
pre-commit
1 change: 0 additions & 1 deletion src/bin/apps/rv/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
#else
#include <TwkGLFFBO/FBOVideoDevice.h>
#include <IPCore/ImageRenderer.h>
#include <QtOpenGL/QGLContext>
#endif

#include <QTextCodec>
Expand Down
3 changes: 2 additions & 1 deletion src/bin/python/py-interp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ main(int argc, char **argv)
//
// On windows: force -i
//
wchar_t* w_nargv[] = {Py_DecodeLocale(argv[0], nullptr), L"-i", L'\0'};
wchar_t arg2[] = L"-i";
wchar_t* w_nargv[] = {Py_DecodeLocale(argv[0], nullptr), arg2, nullptr};

if (argc == 1)
return Py_Main(2, w_nargv);
Expand Down
12 changes: 7 additions & 5 deletions src/build/make_pyside6.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def prepare() -> None:
shutil.move(libclang_tmp, libclang_extracted)

libclang_install_dir = os.path.join(libclang_extracted, "libclang")

if OPENSSL_OUTPUT_DIR:
os.environ["PATH"] = os.path.pathsep.join(
[
Expand Down Expand Up @@ -208,9 +208,10 @@ def build() -> None:
f"--qtpaths={os.path.join(QT_OUTPUT_DIR, 'bin', 'qtpaths' + ('.exe' if platform.system() == 'Windows' else ''))}",
"--ignore-git",
"--standalone",
"--verbose",
"--verbose-build",
"--log-level=verbose",
f"--parallel={os.cpu_count() or 1}",
"--skip-docs",
]

if OPENSSL_OUTPUT_DIR:
Expand Down Expand Up @@ -279,9 +280,10 @@ def build() -> None:

parser.add_argument("--variant", dest="variant", type=str, required=True)


# Major and minor version with dots.
parser.add_argument("--python-version", dest="python_version", type=str, required=True, default="")
parser.add_argument(
"--python-version", dest="python_version", type=str, required=True, default=""
)

parser.set_defaults(prepare=False, build=False)

Expand All @@ -295,7 +297,7 @@ def build() -> None:
QT_OUTPUT_DIR = args.qt
VARIANT = args.variant
PYTHON_VERSION = args.python_version

print(args)

if args.prepare:
Expand Down
Loading

0 comments on commit 7a6f8f5

Please sign in to comment.