Skip to content

Commit 6ee18d0

Browse files
Merge branch 'main' into fix-ci-macos
2 parents 220b0e9 + 673f2b7 commit 6ee18d0

File tree

5 files changed

+54
-17
lines changed

5 files changed

+54
-17
lines changed

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)