Skip to content

Commit 89f898a

Browse files
Merge branch 'main' into fix-ci-macos
Signed-off-by: Cédrik Fuoco <[email protected]>
2 parents 8785162 + 673f2b7 commit 89f898a

File tree

7 files changed

+59
-26
lines changed

7 files changed

+59
-26
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,7 @@ jobs:
470470

471471
- name: Install Python dependencies
472472
run: |
473-
python3 --version
474473
python3 -m pip install --user --upgrade -r requirements.txt
475-
python3 -m pip install --user --upgrade pipdeptree
476-
python3 -m pipdeptree
477474
478475
- name: Install Homebrew dependencies
479476
# icu4c is needed for Qt UIC executable / AUTOUIC.
@@ -537,11 +534,7 @@ jobs:
537534
run: |
538535
cmake --build _build --config ${{ matrix.build-type }} --target dependencies --parallel=$(python -c 'import os; print(os.cpu_count())') -v
539536
ls -al _build
540-
541-
- name: Display RV's python dependencies list to confirm pyopengl-accelerate installation
542-
run: |
543-
./_build/RV_DEPS_PYTHON/install/bin/python -m pip list
544-
537+
545538
- name: Build OpenRV main executable
546539
run: |
547540
cmake --build _build --config ${{ matrix.build-type }} --target main_executable --parallel=$(python -c 'import os; print(os.cpu_count())') -v

cmake/dependencies/python3.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ EXTERNALPROJECT_ADD(
294294
# ##############################################################################################################################################################
295295
# This is temporary until the patch gets into the official PyOpenGL repo. #
296296
# ##############################################################################################################################################################
297-
IF(NOT RV_TARGET_APPLE_ARM64)
297+
# Only for Apple Intel. Windows and Linux uses the requirements.txt file to install PyOpenGL-accelerate.
298+
IF(APPLE
299+
AND RV_TARGET_APPLE_X86_64
300+
)
298301
MESSAGE(STATUS "Patching PyOpenGL and building PyOpenGL from source")
299302
SET(_patch_pyopengl_command
300303
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/pyopengl-accelerate.patch

src/build/make_pyside6.py

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,32 +80,65 @@ def prepare() -> None:
8080
# PySide6 requires Clang 13+.
8181
print("Setting up Clang...")
8282
clang_filename_suffix = ""
83+
fallback_clang_filename_suffix = None
8384

8485
system = platform.system()
8586
if system == "Darwin":
86-
clang_version_search = re.search(
87-
"version (\d+)\.(\d+)\.(\d+)",
88-
os.popen("clang --version").read(),
89-
)
90-
clang_version_str = ".".join(clang_version_search.groups())
91-
if clang_version_str == "17.0.0":
92-
# The 17.0.0 version does not exist on the Qt server
93-
clang_version_str = "17.0.1"
94-
clang_filename_suffix = clang_version_str + "-based-macos-universal.7z"
87+
88+
def get_clang_version():
89+
version_output = os.popen("clang --version").read()
90+
version_search = re.search(r"version (\d+)\.(\d+)\.(\d+)", version_output)
91+
if version_search:
92+
return version_search.groups()
93+
print(f"ERROR: Could not extract clang --version")
94+
return None
95+
96+
def get_clang_filename_suffix(version):
97+
version_str = ".".join(version)
98+
return f"{version_str}-based-macos-universal.7z"
99+
100+
def get_fallback_clang_filename_suffix(version):
101+
major_minor_version_str = ".".join(version[:2])
102+
if major_minor_version_str == "17.0":
103+
return "17.0.1-based-macos-universal.7z"
104+
return None
105+
106+
clang_version = get_clang_version()
107+
if clang_version:
108+
clang_filename_suffix = get_clang_filename_suffix(clang_version)
109+
fallback_clang_filename_suffix = get_fallback_clang_filename_suffix(
110+
clang_version
111+
)
112+
95113
elif system == "Linux":
96114
clang_filename_suffix = "19.1.0-based-linux-Rhel8.8-gcc10.3-x86_64.7z"
97115
elif system == "Windows":
98116
clang_filename_suffix = "19.1.0-based-windows-vs2019_64.7z"
99117

100118
download_url = LIBCLANG_URL_BASE + clang_filename_suffix
101119
libclang_zip = os.path.join(TEMP_DIR, "libclang.7z")
102-
if os.path.exists(libclang_zip) is False:
103-
download_file(download_url, libclang_zip)
120+
104121
# if we have a failed download, clean it up and redownload.
105122
# checking for False since it can return None when archive doesn't have a CRC
106-
elif verify_7z_archive(libclang_zip) is False:
123+
if os.path.exists(libclang_zip) and verify_7z_archive(libclang_zip) is False:
107124
os.remove(libclang_zip)
108-
download_file(download_url, libclang_zip)
125+
126+
# download it if necessary
127+
if os.path.exists(libclang_zip) is False:
128+
download_ok = download_file(download_url, libclang_zip)
129+
if not download_ok and fallback_clang_filename_suffix:
130+
fallback_download_url = LIBCLANG_URL_BASE + fallback_clang_filename_suffix
131+
print(
132+
f"WARNING: Could not download or version does not exist: {download_url}"
133+
)
134+
print(
135+
f"WARNING: Attempting to fallback on known version: {fallback_download_url}..."
136+
)
137+
download_ok = download_file(fallback_download_url, libclang_zip)
138+
if not download_ok:
139+
print(
140+
f"ERROR: Could not download or version does not exist: {download_url}"
141+
)
109142

110143
# clean up previous failed extraction
111144
libclang_tmp = os.path.join(TEMP_DIR, "libclang-tmp")

src/build/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ def download_file(url, file_path):
231231
"""
232232
Download a file with HTTP or HTTPS.
233233
234+
Returns True if the HTTP request succeeded, False otherwise
235+
234236
param: url: url to download
235237
param file_path: destination file path
236238
"""
@@ -251,6 +253,8 @@ def download_file(url, file_path):
251253
file.write(chunk)
252254
print(f"{current} / {total} ({round((current / total) * 100)}%)")
253255

256+
return req.ok
257+
254258

255259
def get_cygpath_windows(cygpath: str) -> str:
256260
"""

src/plugins/rv-packages/stereo_disassembly/PACKAGE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package: Stereo Disassmbly
1+
package: Stereo Disassembly
22
author: Autodesk, Inc.
33
organization: Autodesk, Inc.
44
version: 1.3
@@ -48,7 +48,7 @@ description: |
4848
<div class="paragraph"><p>Four menu items provide access to various functions of the package:</p></div>
4949
<div class="sect3">
5050
<h4 id="_em_image_stereo_disassembly_add_disassembly_node_em"><em>Image/Stereo/Disassembly-Add Disassembly Node</em></h4>
51-
<div class="paragraph"><p>Selecting this menu item will cause RV to examine the currently visible sources, and for each, if it does not already have a StereoDisassmbly node, add one. Note that the node will be added "internally" (in the RVLinearizePipelineGroup within the Source), so the new node will not be visible in the Session manager, and any view using this Source will see the result of the "disassembly".</p></div>
51+
<div class="paragraph"><p>Selecting this menu item will cause RV to examine the currently visible sources, and for each, if it does not already have a StereoDisassembly node, add one. Note that the node will be added "internally" (in the RVLinearizePipelineGroup within the Source), so the new node will not be visible in the Session manager, and any view using this Source will see the result of the "disassembly".</p></div>
5252
</div>
5353
<div class="sect3">
5454
<h4 id="_em_image_stereo_disassembly_remove_disassembly_node_em"><em>Image/Stereo/Disassembly-Remove Disassembly Node</em></h4>

src/plugins/rv-packages/stereo_disassembly/stereo_disassembly_help.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This experimental package enables you to load stereo media with both eyes in the
2525
Four menu items provide access to various functions of the package:
2626

2727
==== 'Image/Stereo/Disassembly-Add Disassembly Node' ====
28-
Selecting this menu item will cause RV to examine the currently visible sources, and for each, if it does not already have a StereoDisassmbly node, add one. Note that the node will be added "internally" (in the RVLinearizePipelineGroup within the Source), so the new node will not be visible in the Session Manager, and any view using this Source will see the result of the "disassembly".
28+
Selecting this menu item will cause RV to examine the currently visible sources, and for each, if it does not already have a StereoDisassembly node, add one. Note that the node will be added "internally" (in the RVLinearizePipelineGroup within the Source), so the new node will not be visible in the Session Manager, and any view using this Source will see the result of the "disassembly".
2929

3030
==== 'Image/Stereo/Disassembly-Remove Disassembly Node' ====
3131
Remove StereoDisassembly nodes from all visible sources.

src/plugins/rv-packages/stereo_disassembly/stereo_disassembly_help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ <h3 id="_menu_items">Menu Items</h3>
612612
<div class="paragraph"><p>Four menu items provide access to various functions of the package:</p></div>
613613
<div class="sect3">
614614
<h4 id="_em_image_stereo_disassembly_add_disassembly_node_em"><em>Image/Stereo/Disassembly-Add Disassembly Node</em></h4>
615-
<div class="paragraph"><p>Selecting this menu item will cause RV to examine the currently visible sources, and for each, if it does not already have a StereoDisassmbly node, add one. Note that the node will be added "internally" (in the RVLinearizePipelineGroup within the Source), so the new node will not be visible in the Session Manager, and any view using this Source will see the result of the "disassembly".</p></div>
615+
<div class="paragraph"><p>Selecting this menu item will cause RV to examine the currently visible sources, and for each, if it does not already have a StereoDisassembly node, add one. Note that the node will be added "internally" (in the RVLinearizePipelineGroup within the Source), so the new node will not be visible in the Session Manager, and any view using this Source will see the result of the "disassembly".</p></div>
616616
</div>
617617
<div class="sect3">
618618
<h4 id="_em_image_stereo_disassembly_remove_disassembly_node_em"><em>Image/Stereo/Disassembly-Remove Disassembly Node</em></h4>

0 commit comments

Comments
 (0)