Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support linux_gcc_arm64 arch in 6.7.0 via new linux_arm64 host #766

Merged
merged 6 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 20
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
fetch-tags: true
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-install-qt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 20
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions aqt/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def _get_archives(self):
def _append_depends_tool(self, arch, tool_name):
os_target_folder = posixpath.join(
"online/qtsdkrepository",
self.os_name + ("_x86" if self.os_name == "windows" else "_x64"),
self.os_name + ("_x86" if self.os_name == "windows" else ("" if self.os_name == "linux_arm64" else "_x64")),
self.target,
tool_name,
)
Expand All @@ -379,7 +379,7 @@ def _append_depends_tool(self, arch, tool_name):
def _get_archives_base(self, name, target_packages):
os_target_folder = posixpath.join(
"online/qtsdkrepository",
self.os_name + ("_x86" if self.os_name == "windows" else "_x64"),
self.os_name + ("_x86" if self.os_name == "windows" else ("" if self.os_name == "linux_arm64" else "_x64")),
self.target,
# tools_ifw/
name,
Expand Down
7 changes: 6 additions & 1 deletion aqt/combinations.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@
"os_name": "linux",
"target": "desktop"
},
{
"arch": "linux_gcc_arm64",
"os_name": "linux_arm64",
"target": "desktop"
},
{
"arch": "wasm_32",
"os_name": "linux",
Expand Down Expand Up @@ -1296,4 +1301,4 @@
"6.7.0"
]
}
]
]
20 changes: 14 additions & 6 deletions aqt/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,15 @@ def _set_arch(arch: Optional[str], os_name: str, target: str, qt_version_or_spec
if arch is not None and arch != "":
return arch
if os_name == "linux" and target == "desktop":
return "gcc_64"
try:
if Version(qt_version_or_spec) >= Version("6.7.0"):
return "linux_gcc_64"
else:
return "gcc_64"
except ValueError:
return "gcc_64"
elif os_name == "linux_arm64" and target == "desktop":
return "linux_gcc_arm64"
elif os_name == "mac" and target == "desktop":
return "clang_64"
elif os_name == "mac" and target == "ios":
Expand Down Expand Up @@ -730,7 +738,7 @@ def _set_install_qt_parser(self, install_qt_parser, *, is_legacy: bool):

def _set_install_tool_parser(self, install_tool_parser, *, is_legacy: bool):
install_tool_parser.set_defaults(func=self.run_install_tool, is_legacy=is_legacy)
install_tool_parser.add_argument("host", choices=["linux", "mac", "windows"], help="host os name")
install_tool_parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
if not is_legacy:
install_tool_parser.add_argument(
"target",
Expand Down Expand Up @@ -787,7 +795,7 @@ def make_parser_sde(cmd: str, desc: str, is_legacy: bool, action, is_add_kde: bo

def make_parser_list_sde(cmd: str, desc: str, cmd_type: str):
parser = subparsers.add_parser(cmd, description=desc)
parser.add_argument("host", choices=["linux", "mac", "windows"], help="host os name")
parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
parser.add_argument(
"qt_version_spec",
metavar="(VERSION | SPECIFICATION)",
Expand Down Expand Up @@ -835,7 +843,7 @@ def _make_list_qt_parser(self, subparsers: argparse._SubParsersAction):
"$ aqt list-qt mac desktop --archives 5.9.0 clang_64 # list archives in base Qt installation\n"
"$ aqt list-qt mac desktop --archives 5.14.0 clang_64 debug_info # list archives in debug_info module\n",
)
list_parser.add_argument("host", choices=["linux", "mac", "windows"], help="host os name")
list_parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
list_parser.add_argument(
"target",
nargs="?",
Expand Down Expand Up @@ -919,7 +927,7 @@ def _make_list_tool_parser(self, subparsers: argparse._SubParsersAction):
"$ aqt list-tool mac desktop tools_ifw --long # print tool variant names with metadata for QtIFW\n"
"$ aqt list-tool mac desktop ifw --long # print tool variant names with metadata for QtIFW\n",
)
list_parser.add_argument("host", choices=["linux", "mac", "windows"], help="host os name")
list_parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
list_parser.add_argument(
"target",
nargs="?",
Expand Down Expand Up @@ -1006,7 +1014,7 @@ def _set_common_arguments(self, subparser, *, is_legacy: bool, is_target_depreca
"""
if is_legacy:
subparser.add_argument("qt_version", help='Qt version in the format of "5.X.Y"')
subparser.add_argument("host", choices=["linux", "mac", "windows"], help="host os name")
subparser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
if is_target_deprecated:
subparser.add_argument(
"target",
Expand Down
27 changes: 20 additions & 7 deletions aqt/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,12 @@ def get_semantic_version(qt_ver: str, is_preview: bool) -> Optional[Version]:

class ArchiveId:
CATEGORIES = ("tools", "qt")
HOSTS = ("windows", "mac", "linux")
HOSTS = ("windows", "mac", "linux", "linux_arm64")
TARGETS_FOR_HOST = {
"windows": ["android", "desktop", "winrt"],
"mac": ["android", "desktop", "ios"],
"linux": ["android", "desktop"],
"linux_arm64": ["desktop"],
}
EXTENSIONS_REQUIRED_ANDROID_QT6 = {"x86_64", "x86", "armv7", "arm64_v8a"}
ALL_EXTENSIONS = {"", "wasm", "src_doc_examples", *EXTENSIONS_REQUIRED_ANDROID_QT6}
Expand Down Expand Up @@ -231,7 +232,7 @@ def is_tools(self) -> bool:
def to_url(self) -> str:
return "online/qtsdkrepository/{os}{arch}/{target}/".format(
os=self.host,
arch="_x86" if self.host == "windows" else "_x64",
arch=("_x86" if self.host == "windows" else ("" if self.host == "linux_arm64" else "_x64")),
target=self.target,
)

Expand Down Expand Up @@ -384,12 +385,16 @@ def get_arch_dir_name(host: str, arch: str, version: Version) -> str:
return arch[6:]
elif host == "mac" and arch == "clang_64":
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_arm64" and arch == "linux_gcc_arm64":
return "gcc_arm64"
else:
return arch

@staticmethod
def default_linux_desktop_arch_dir() -> str:
return "gcc_64"
def default_linux_desktop_arch_dir() -> tuple[str, str]:
return ("gcc_64", "gcc_arm64")

@staticmethod
def default_win_msvc_desktop_arch_dir(_version: Version) -> str:
Expand Down Expand Up @@ -476,8 +481,11 @@ def find_installed_desktop_qt_dir(host: str, base_path: Path, version: Version,
arch_path = installed_qt_version_dir / QtRepoProperty.default_mac_desktop_arch_dir(version)
return arch_path if (arch_path / "bin/qmake").is_file() else None
elif host == "linux":
arch_path = installed_qt_version_dir / QtRepoProperty.default_linux_desktop_arch_dir()
return arch_path if (arch_path / "bin/qmake").is_file() else None
for arch_dir in QtRepoProperty.default_linux_desktop_arch_dir():
arch_path = installed_qt_version_dir / arch_dir
if (arch_path / "bin/qmake").is_file():
return arch_path
return None
elif host == "windows" and is_msvc:
arch_path = installed_qt_version_dir / QtRepoProperty.default_win_msvc_desktop_arch_dir(version)
return arch_path if (arch_path / "bin/qmake.exe").is_file() else None
Expand Down Expand Up @@ -928,7 +936,12 @@ def describe_filters(self) -> str:
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:
Expand Down
12 changes: 12 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions ci/generate_azure_pipelines_matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ def __init__(self, platform, build_jobs):
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),
miurahr marked this conversation as resolved.
Show resolved Hide resolved
PlatformBuildJobs("mac", mac_build_jobs),
PlatformBuildJobs("windows", windows_build_jobs),
]
Expand All @@ -106,6 +108,7 @@ def __init__(self, platform, build_jobs):
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:
Expand Down Expand Up @@ -480,6 +483,9 @@ def __init__(self, platform, build_jobs):
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'])}"
)
Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ All notable changes to this project will be documented in this file.
`Unreleased`_
=============

Added
-----
- Add support for arm64 architecture on linux desktop (#766)

`v3.1.12`_ (2, Mar. 2024)
=========================
Expand Down
32 changes: 20 additions & 12 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ List available versions of Qt, targets, modules, and architectures.

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: target

Expand Down Expand Up @@ -177,7 +177,7 @@ List source archives available for installation using the `install-src command`_

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: Qt version

Expand Down Expand Up @@ -217,7 +217,7 @@ installation using the `install-doc command`_, with the ``--archives`` option.

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: Qt version

Expand Down Expand Up @@ -262,7 +262,7 @@ installation using the `install-example command`_, with the ``--archives`` optio

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: Qt version

Expand Down Expand Up @@ -300,7 +300,7 @@ List available tools

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: target

Expand Down Expand Up @@ -502,7 +502,7 @@ There are various combinations to accept according to Qt version.

.. describe:: host

linux, windows or mac. The operating system on which the Qt development tools will run.
linux, linux_arm64, windows or mac. The operating system on which the Qt development tools will run.

.. describe:: target

Expand Down Expand Up @@ -533,7 +533,9 @@ There are various combinations to accept according to Qt version.

The compiler architecture for which you are developing. Options:

* gcc_64 for linux desktop
* gcc_64 or linux_gcc_64 for linux desktop

* linux_gcc_arm64 for linux_arm64 desktop

* clang_64 for mac desktop

Expand Down Expand Up @@ -587,7 +589,7 @@ Install Qt source code for the specified version and target.

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: target

Expand Down Expand Up @@ -647,7 +649,7 @@ Install Qt documentation for the specified version and target.

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: target

Expand Down Expand Up @@ -701,7 +703,7 @@ Install Qt examples for the specified version and target.

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: target

Expand Down Expand Up @@ -753,7 +755,7 @@ Install tools like QtIFW, mingw, Cmake, Conan, and vcredist.

.. describe:: host

linux, windows or mac
linux, linux_arm64, windows or mac

.. describe:: target

Expand Down Expand Up @@ -802,8 +804,14 @@ Example: Installing the newest LTS version of Qt 5.12:
.. code-block:: console

pip install aqtinstall
sudo aqt install-qt linux desktop 5.12 win64_mingw73
sudo aqt install-qt linux desktop 5.12 gcc_64

Example: Installing the newest LTS version of Qt 6.7 for linux arm64:

.. code-block:: console

pip install aqtinstall
sudo aqt install-qt linux_arm64 desktop 6.7

Example: Installing Android (armv7) Qt 5.13.2:

Expand Down
Loading
Loading