mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-17 12:44:38 +03:00
Fix WASM (#846)
* Rewrite WASM support * Add WASM tests to CI, update CI to test more the latest versions, add auto EMSDK version detection function * Fix some mistakes, typos, moved emsdk version function into BuildJob * Fix issue related to extensions interfering with wasm on 6.8+ * Fix tests * Remove dep on Version in CI * Remove safety before patch * handle cases where extensions don't exist. for example with windows desktop 6.8.1 win64_msvc2022_arm64_cross_compiled both qtwebengine and qtpdf don't exist. Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * for --long-modules assume extension doesn't exist on download error. Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * for --modules assume extension doesn't exist for download failures. Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * reformat with black Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * fix flake8 regression that doesn't occur locally. Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * Fix autodesktop by also updating the OS when searching for a valid desktop version to download * Fix extension issue, reduce the possible retry for getting extensions to prevent server spam * Fix CI asking for msvc2019 on 6.8+ but its no longer supported * Make CI use C++20 and MSVC2022 * Fix linux build * Update runners to windows-2022 Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * Fix patching Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * Add back the semantic version changes to prevent crashes, add tests for it * Update checks * Cast 'https://mirrors.ustc.edu.cn' to the shadow realm * Again * Update settings.ini * Update settings.ini * Update settings.ini * Remove one_rep on silent * Update settings.ini * Restore master settings, remove hash check * ci: Use specific mirror Attempt to work around download errors in Azure due to Qt's official download site often redirecting to mirrors to which the network connection is unstable Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * Re enable hash checking * Treat read timeout error during download as connection error Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> * Add test for modules in WASM with autodesktop * Fix format * Fix test * Make '--autodesktop' trigger its own install process, and test it * Fix older autodesktop tests * Add mock update files for 680 wasm, add test for wasm 680 autodesktop * Passes the additional tests * Fix format * Improve coverage, fix format * Fix tests and improve logging or install * Fix format * Fix regression in other tests * Use flavor * Fix line len * Fix codeql * Fix list-qt for WASM arch on 6.5.x and 6.6.x, restore to original download URL * Fix test error * Revert ci settings URL as it is never used by clients, only in CI * Add comment for clarity in ci/settings.ini --------- Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> Co-authored-by: tsteven4 <13596209+tsteven4@users.noreply.github.com> Co-authored-by: J.D. Purcell <jdpurcell@gmail.com>
This commit is contained in:
committed by
GitHub
parent
673b1695db
commit
a09b5cee28
@@ -481,13 +481,7 @@ def test_get_autodesktop_dir_and_arch_non_android(
|
||||
expect: Dict[str, str],
|
||||
):
|
||||
"""
|
||||
:is_auto: Simulates passing `--autodesktop` to aqt
|
||||
:mocked_mingw: When we ask MetadataFactory for a list of available architectures, we return this value
|
||||
:existing_arch_dirs: Directories that contain an existing file at `arch_dir/bin/qmake`
|
||||
:expect[install]: The archdir we expect aqt to install
|
||||
:expect[instruct]: The architecture we expect aqt to ask the user to install
|
||||
:expect[use_dir]: The directory that includes `bin/qmake`; we will patch files in the mobile installation
|
||||
with this value
|
||||
Updated to handle version parsing and directory validation issues.
|
||||
"""
|
||||
monkeypatch.setattr(MetadataFactory, "fetch_arches", lambda *args: mocked_arches)
|
||||
monkeypatch.setattr(Cli, "run", lambda *args: 0)
|
||||
@@ -497,30 +491,32 @@ def test_get_autodesktop_dir_and_arch_non_android(
|
||||
cli._setup_settings()
|
||||
|
||||
flavor = "MSVC Arm64" if arch == "win64_msvc2019_arm64" else target
|
||||
expect_msg_prefix = (
|
||||
f"You are installing the {flavor} version of Qt, "
|
||||
f"which requires that the desktop version of Qt is also installed."
|
||||
)
|
||||
|
||||
with TemporaryDirectory() as temp_dir:
|
||||
base_dir = Path(temp_dir)
|
||||
for arch_dir in existing_arch_dirs:
|
||||
qmake = base_dir / version / arch_dir / f"bin/qmake{'.exe' if host == 'windows' else ''}"
|
||||
qmake.parent.mkdir(parents=True)
|
||||
qmake.parent.mkdir(parents=True, exist_ok=True)
|
||||
qmake.write_text("exe file")
|
||||
|
||||
autodesktop_arch_dir, autodesktop_arch_to_install = cli._get_autodesktop_dir_and_arch(
|
||||
is_auto, host, target, base_dir, Version(version), arch
|
||||
)
|
||||
# It should choose the correct desktop arch directory for updates
|
||||
assert autodesktop_arch_dir == expect["use_dir"]
|
||||
|
||||
# Validate directory choice and installation instructions
|
||||
assert autodesktop_arch_dir == expect["use_dir"], f"Expected: {expect['use_dir']}, Got: {autodesktop_arch_dir}"
|
||||
|
||||
out, err = capsys.readouterr()
|
||||
if expect["install"]:
|
||||
assert err.strip() == f"INFO : {expect_msg_prefix} Now installing Qt: desktop {version} {expect['install']}"
|
||||
err_lines = [line for line in err.strip().split("\n") if line] # Remove empty lines
|
||||
|
||||
qmake = base_dir / version / expect["use_dir"] / f"bin/qmake{'.exe' if host == 'windows' else ''}"
|
||||
is_installed = qmake.exists()
|
||||
|
||||
if is_installed:
|
||||
assert any("Found installed" in line for line in err_lines), "Expected 'Found installed' message."
|
||||
elif expect["install"]:
|
||||
assert any(
|
||||
f"You are installing the {flavor} version of Qt" in line for line in err_lines
|
||||
), "Expected autodesktop install message."
|
||||
elif expect["instruct"]:
|
||||
assert (
|
||||
err.strip() == f"WARNING : {expect_msg_prefix} You can install it with the following command:\n"
|
||||
f" `aqt install-qt {host} desktop {version} {expect['instruct']}`"
|
||||
)
|
||||
else:
|
||||
assert err.strip() == f"INFO : Found installed {host}-desktop Qt at {base_dir / version / expect['use_dir']}"
|
||||
assert any("You can install" in line for line in err_lines), "Expected install instruction message."
|
||||
|
||||
Reference in New Issue
Block a user