mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-16 20:27:05 +03:00
Fixes and tests. Untested Azure pipeline support.
This commit is contained in:
@@ -387,7 +387,7 @@ class QtRepoProperty:
|
||||
return QtRepoProperty.default_mac_desktop_arch_dir(version)
|
||||
elif host == "linux" and arch in ("gcc_64", "linux_gcc_64"):
|
||||
return "gcc_64"
|
||||
elif host == "linux" and arch == "linux_gcc_arm64":
|
||||
elif host == "linux_arm64" and arch == "linux_gcc_arm64":
|
||||
return "gcc_arm64"
|
||||
else:
|
||||
return arch
|
||||
@@ -936,7 +936,12 @@ class MetadataFactory:
|
||||
def fetch_default_desktop_arch(self, version: Version, is_msvc: bool = False) -> str:
|
||||
assert self.archive_id.target == "desktop", "This function is meant to fetch desktop architectures"
|
||||
if self.archive_id.host == "linux":
|
||||
return "gcc_64"
|
||||
if version >= Version("6.7.0"):
|
||||
return "linux_gcc_64"
|
||||
else:
|
||||
return "gcc_64"
|
||||
elif self.archive_id.host == "linux_arm64":
|
||||
return "linux_gcc_arm64"
|
||||
elif self.archive_id.host == "mac":
|
||||
return "clang_64"
|
||||
elif self.archive_id.host == "windows" and is_msvc:
|
||||
|
||||
@@ -53,3 +53,15 @@ jobs:
|
||||
matrix: $[ dependencies.MatricesGenerator.outputs['mtrx.linux'] ]
|
||||
steps:
|
||||
- template: ci/steps.yml
|
||||
|
||||
- job: Linux ARM64
|
||||
dependsOn: MatricesGenerator
|
||||
pool:
|
||||
vmImage: 'ubuntu-22.04'
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
options: --platform linux/arm64
|
||||
strategy:
|
||||
matrix: $[ dependencies.MatricesGenerator.outputs['mtrx.linux_arm64'] ]
|
||||
steps:
|
||||
- template: ci/steps.yml
|
||||
@@ -92,11 +92,13 @@ python_versions = ["3.9", "3.11", "3.12"]
|
||||
qt_versions = ["5.12.12", "5.15.14", "6.5.3"]
|
||||
|
||||
linux_build_jobs = []
|
||||
linux_arm64_build_jobs = []
|
||||
mac_build_jobs = []
|
||||
windows_build_jobs = []
|
||||
|
||||
all_platform_build_jobs = [
|
||||
PlatformBuildJobs("linux", linux_build_jobs),
|
||||
PlatformBuildJobs("linux_arm64", linux_arm64_build_jobs),
|
||||
PlatformBuildJobs("mac", mac_build_jobs),
|
||||
PlatformBuildJobs("windows", windows_build_jobs),
|
||||
]
|
||||
@@ -106,6 +108,7 @@ for qt_version in qt_versions:
|
||||
linux_build_jobs.append(
|
||||
BuildJob("install-qt", qt_version, "linux", "desktop", "gcc_64", "gcc_64")
|
||||
)
|
||||
linux_arm64_build_jobs.append(BuildJob("install-qt", "6.7.0", "linux_arm64", "desktop", "linux_gcc_arm64", "gcc_arm64"))
|
||||
|
||||
# Mac Desktop
|
||||
for qt_version in qt_versions:
|
||||
@@ -368,32 +371,36 @@ windows_build_jobs.extend(
|
||||
)
|
||||
|
||||
# Test binary patch of qmake
|
||||
linux_build_jobs.extend(
|
||||
[
|
||||
# New output dir is shorter than the default value; qmake could fail to
|
||||
# locate prefix dir if the value is patched wrong
|
||||
BuildJob(
|
||||
"install-qt",
|
||||
"5.12.11",
|
||||
"linux",
|
||||
"desktop",
|
||||
"gcc_64",
|
||||
"gcc_64",
|
||||
output_dir="/t/Q",
|
||||
),
|
||||
# New output dir is longer than the default value.
|
||||
# This case is meant to work without any bugfix; if this fails, the test is setup wrong
|
||||
BuildJob(
|
||||
"install-qt",
|
||||
"5.12.11",
|
||||
"linux",
|
||||
"desktop",
|
||||
"gcc_64",
|
||||
"gcc_64",
|
||||
output_dir="/some/super/long/arbitrary/path/to" * 5,
|
||||
),
|
||||
]
|
||||
)
|
||||
for lst, os_name, version, arch, arch_dir in (
|
||||
(linux_build_jobs, "linux", "5.12.11", "gcc_64", "gcc_64"),
|
||||
(linux_arm64_build_jobs, "linux_arm64", "6.7.0", "linux_gcc_arm64", "gcc_arm64"),
|
||||
):
|
||||
lst.extend(
|
||||
[
|
||||
# New output dir is shorter than the default value; qmake could fail to
|
||||
# locate prefix dir if the value is patched wrong
|
||||
BuildJob(
|
||||
"install-qt",
|
||||
version,
|
||||
os_name,
|
||||
"desktop",
|
||||
arch,
|
||||
arch_dir,
|
||||
output_dir="/t/Q",
|
||||
),
|
||||
# New output dir is longer than the default value.
|
||||
# This case is meant to work without any bugfix; if this fails, the test is setup wrong
|
||||
BuildJob(
|
||||
"install-qt",
|
||||
version,
|
||||
os_name,
|
||||
"desktop",
|
||||
arch,
|
||||
arch_dir,
|
||||
output_dir="/some/super/long/arbitrary/path/to" * 5,
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
qt_creator_bin_path = "./Tools/QtCreator/bin/"
|
||||
qt_creator_mac_bin_path = "./Qt Creator.app/Contents/MacOS/"
|
||||
@@ -480,6 +487,9 @@ print("Setting Variables below")
|
||||
print(
|
||||
f"##vso[task.setVariable variable=linux;isOutput=true]{json.dumps(matrices['linux'])}"
|
||||
)
|
||||
print(
|
||||
f"##vso[task.setVariable variable=linux_arm64;isOutput=true]{json.dumps(matrices['linux_arm64'])}"
|
||||
)
|
||||
print(
|
||||
f"##vso[task.setVariable variable=windows;isOutput=true]{json.dumps(matrices['windows'])}"
|
||||
)
|
||||
|
||||
15
tests/data/linux_arm64-desktop-expect.json
Normal file
15
tests/data/linux_arm64-desktop-expect.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"qt": {
|
||||
"qt": [
|
||||
"6.7.0"
|
||||
],
|
||||
"preview": [
|
||||
]
|
||||
},
|
||||
"tools": [
|
||||
"tools_maintenance",
|
||||
"tools_ifw",
|
||||
"tools_cmake",
|
||||
"sdktool"
|
||||
]
|
||||
}
|
||||
20
tests/data/linux_arm64-desktop.html
Normal file
20
tests/data/linux_arm64-desktop.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Index of /online/qtsdkrepository/linux_arm64/desktop</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" type="text/css" href="/static/normalize.css"><link rel="stylesheet" type="text/css" href="/static/style.css"><link rel="stylesheet" href="/static/bootstrap.css" type="text/css"><link rel="stylesheet" href="/static/bootstrap-download-index.css" type="text/css"><script type="text/javascript" src="/static/jquery.js"></script> <script type="text/javascript" src="/static/javascript-index.js"></script> <script type="text/javascript" src="/static/javascript-mirrorlist.js"></script> </head>
|
||||
<body>
|
||||
<h1>Index of /online/qtsdkrepository/linux_arm64/desktop</h1>
|
||||
<table><tr><th> </th><th><a href="?C=N;O=A">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th>Metadata</th></tr><tr><th colspan="5"><hr /></th></tr>
|
||||
<tr><td valign="top"> </td><td><a href="/online/qtsdkrepository/linux_arm64/">Parent Directory</a></td><td> </td><td align="right"> - </td><td> </td></tr>
|
||||
<tr><td valign="top"> </td><td><a href="tools_maintenance/">tools_maintenance/</a></td><td align="right">19-Feb-2024 12:34 </td><td align="right"> - </td><td> </td></tr>
|
||||
<tr><td valign="top"> </td><td><a href="tools_ifw/">tools_ifw/</a></td><td align="right">19-Feb-2024 12:10 </td><td align="right"> - </td><td> </td></tr>
|
||||
<tr><td valign="top"> </td><td><a href="tools_cmake/">tools_cmake/</a></td><td align="right">15-Feb-2024 11:39 </td><td align="right"> - </td><td> </td></tr>
|
||||
<tr><td valign="top"> </td><td><a href="sdktool/">sdktool/</a></td><td align="right">07-Feb-2024 14:36 </td><td align="right"> - </td><td> </td></tr>
|
||||
<tr><td valign="top"> </td><td><a href="qt6_dev/">qt6_dev/</a></td><td align="right">08-Feb-2024 09:30 </td><td align="right"> - </td><td> </td></tr>
|
||||
<tr><td valign="top"> </td><td><a href="qt6_670/">qt6_670/</a></td><td align="right">16-Feb-2024 07:43 </td><td align="right"> - </td><td> </td></tr>
|
||||
<tr><th colspan="5"><hr /></th></tr>
|
||||
</table>
|
||||
<br/><address><a href="http://mirrorbrain.org/">MirrorBrain</a> powered by <a href="http://httpd.apache.org/">Apache</a></address>
|
||||
</body></html>
|
||||
@@ -1464,6 +1464,25 @@ def test_install_installer_archive_extraction_err(monkeypatch):
|
||||
r"INFO : Time elapsed: .* second"
|
||||
),
|
||||
),
|
||||
(
|
||||
"install-qt linux_arm64 desktop 6.7 linux_gcc_arm64".split(),
|
||||
"linux_arm64",
|
||||
"desktop",
|
||||
"6.7.0",
|
||||
"linux_gcc_arm64",
|
||||
"gcc_arm64",
|
||||
"https://www.alt.qt.mirror.com",
|
||||
"linux_arm64/desktop/qt6_670/Updates.xml",
|
||||
[plain_qtbase_archive("qt.qt6.670.linux_gcc_arm64", "linux_gcc_arm64", host="linux_arm64")],
|
||||
re.compile(
|
||||
r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n"
|
||||
r"INFO : Resolved spec '6\.7' to 6\.7\.0\n"
|
||||
r"INFO : Downloading qtbase\.\.\.\n"
|
||||
r"Finished installation of qtbase-linux_arm64-linux_gcc_arm64\.7z in .*\n"
|
||||
r"INFO : Finished installation\n"
|
||||
r"INFO : Time elapsed: .* second"
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_installer_passes_base_to_metadatafactory(
|
||||
@@ -1491,7 +1510,13 @@ def test_installer_passes_base_to_metadatafactory(
|
||||
|
||||
def mock_get_url(url: str, *args, **kwargs) -> str:
|
||||
# If we are fetching an index.html file, get it from tests/data/
|
||||
if url == f"{base_url}/online/qtsdkrepository/{host}_x{'86' if host == 'windows' else '64'}/{target}/":
|
||||
if host == "linux_arm64":
|
||||
repo_dir = "linux_arm64"
|
||||
elif host == "windows":
|
||||
repo_dir = "windows_x86"
|
||||
else:
|
||||
repo_dir = f"{host}_x64"
|
||||
if url == f"{base_url}/online/qtsdkrepository/{repo_dir}/{target}/":
|
||||
return (Path(__file__).parent / "data" / f"{host}-{target}.html").read_text("utf-8")
|
||||
|
||||
# Intercept and check the base url, but only if it's not a hash.
|
||||
@@ -1517,4 +1542,4 @@ def test_installer_passes_base_to_metadatafactory(
|
||||
sys.stdout.write(out)
|
||||
sys.stderr.write(err)
|
||||
|
||||
assert expect_out.match(err)
|
||||
assert expect_out.match(err), err
|
||||
|
||||
@@ -128,6 +128,7 @@ def spec_regex():
|
||||
("windows", "winrt", "windows-winrt.html", "windows-winrt-expect.json"),
|
||||
("linux", "android", "linux-android.html", "linux-android-expect.json"),
|
||||
("linux", "desktop", "linux-desktop.html", "linux-desktop-expect.json"),
|
||||
("linux_arm64", "desktop", "linux_arm64-desktop.html", "linux_arm64-desktop-expect.json"),
|
||||
("mac", "android", "mac-android.html", "mac-android-expect.json"),
|
||||
("mac", "desktop", "mac-desktop.html", "mac-desktop-expect.json"),
|
||||
("mac", "ios", "mac-ios.html", "mac-ios-expect.json"),
|
||||
|
||||
Reference in New Issue
Block a user