Skip to content

Commit

Permalink
Fix issue related to extensions interfering with wasm on 6.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
Kidev committed Dec 15, 2024
1 parent 1df829a commit cacabe8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
15 changes: 8 additions & 7 deletions aqt/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,14 @@ def _get_archives_base(self, name, target_packages):
arch = "x86_64"
elif self.os_name == "linux_arm64":
arch = "arm64"
for ext in ["qtwebengine", "qtpdf"]:
extensions_target_folder = posixpath.join(
"online/qtsdkrepository", os_name, "extensions", ext, self._version_str(), arch
)
extensions_xml_url = posixpath.join(extensions_target_folder, "Updates.xml")
extensions_xml_text = self._download_update_xml(extensions_xml_url)
update_xmls.append(UpdateXmls(extensions_target_folder, extensions_xml_text))
if self.target != "wasm":
for ext in ["qtwebengine", "qtpdf"]:
extensions_target_folder = posixpath.join(
"online/qtsdkrepository", os_name, "extensions", ext, self._version_str(), arch
)
extensions_xml_url = posixpath.join(extensions_target_folder, "Updates.xml")
extensions_xml_text = self._download_update_xml(extensions_xml_url)
update_xmls.append(UpdateXmls(extensions_target_folder, extensions_xml_text))

self._parse_update_xmls(update_xmls, target_packages)

Expand Down
34 changes: 19 additions & 15 deletions aqt/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ def is_tools(self) -> bool:
return self.category == "tools"

def to_os_arch(self) -> str:
if self.host == "all_os":
return "all_os"
return "{os}{arch}".format(
os=self.host,
arch=(
Expand Down Expand Up @@ -277,22 +279,18 @@ def to_url(self) -> str:
def to_folder(self, version: Version, qt_version_no_dots: str, extension: Optional[str] = None) -> str:
if version >= Version("6.8.0"):
if self.target == "wasm":
# For Qt 6.8+ WASM, path structure is qt6_681/qt6_681_wasm_multithread
return "{category}{major}_{ver}/{category}{major}_{ver}{ext}".format(
category=self.category,
major=qt_version_no_dots[0],
ver=qt_version_no_dots,
ext="_" + extension if extension else "",
)
else:
return "{category}{major}_{ver}/{category}{major}_{ver}{ext}".format(
category=self.category,
major=qt_version_no_dots[0],
ver=qt_version_no_dots,
ext="_" + extension if extension else "",
)
# Qt 6.8+ WASM uses a split folder structure
folder = f"qt{version.major}_{qt_version_no_dots}"
if extension:
folder = f"{folder}/{folder}_{extension}"
return folder
elif version >= Version("6.5.0") and self.target == "wasm":
# Qt 6.5-6.7 WASM uses direct wasm_[single|multi]thread folder
if extension:
return f"qt{version.major}_{qt_version_no_dots}_{extension}"
return f"qt{version.major}_{qt_version_no_dots}"
else:
# Pre-6.8 structure remains the same
# Pre-6.8 structure for non-WASM or pre-6.5 structure
return "{category}{major}_{ver}{ext}".format(
category=self.category,
major=qt_version_no_dots[0],
Expand Down Expand Up @@ -429,6 +427,10 @@ def dir_for_version(ver: Version) -> str:

@staticmethod
def get_arch_dir_name(host: str, arch: str, version: Version) -> str:
"""
Determines the architecture directory name based on host, architecture and version.
Special handling is done for WASM, mingw, MSVC and various platform-specific cases.
"""
if arch.startswith("win64_mingw"):
return arch[6:] + "_64"
elif arch.startswith("win64_llvm"):
Expand All @@ -449,6 +451,8 @@ def get_arch_dir_name(host: str, arch: str, version: Version) -> str:
return "gcc_64"
elif host == "linux_arm64" and arch == "linux_gcc_arm64":
return "gcc_arm64"
elif host == "all_os" and arch in ("wasm_singlethread", "wasm_multithread", "wasm_32"):
return arch
else:
return arch

Expand Down

0 comments on commit cacabe8

Please sign in to comment.