Repository: miurahr/aqtinstall

Issue #662: Failure to decompress Qt 6.4.3 source archives packaged as `*.tar.gz`, not `*.7z`
Created: 2023-03-25T17:19:00Z
Describe the bug
Today, I noticed that in Qt 6.4.3, the Qt maintainers have started packaging source and doc archives as .tar.gz instead of .7z. Since aqtinstall only knows how to decompress 7z files, it raises py7zr.exceptions.Bad7zFile instead of decompressing the archive.
I have not checked exhaustively, but Qt 6.4.2 does not appear to be affected by this. For Qt 6.4.3, both install-src and install-doc are affected; install-example is not.
I do not know the extent of this problem; it is possible that other versions and commands are affected by this as well.
To Reproduce

install aqt using pip install aqtinstall
run aqt with this command: python -m aqt install-src mac 6.4.3 (or python -m aqt install-doc mac 6.4.3)
See error: py7zr.exceptions.Bad7zFile: not a 7z file

Expected behavior
I expected aqt to install the source code for Qt 6.4.3.
aqt output
❯ python -m aqt install-src mac 6.4.3
INFO    : aqtinstall(aqt) v3.1.3 on Python 3.11.2 [CPython Clang 14.0.0 (clang-1400.0.29.202)]
WARNING : Specified Qt version "6.4.3" did not exist when this version of aqtinstall was released. This may not install properly, but we will try our best.
INFO    : Downloading qtdoc...
INFO    : Downloading qt5compat...
INFO    : Downloading qtsvg...
INFO    : Downloading qtquick3dphysics...
INFO    : Redirected: qt.mirror.constant.com
INFO    : Redirected: qt.mirror.constant.com
INFO    : Redirected: qt.mirror.constant.com
INFO    : Redirected: qt.mirror.constant.com
INFO    : Downloading qtdatavis3d...
INFO    : Redirected: qt.mirror.constant.com
INFO    : Downloading qtcharts...
INFO    : Downloading qt5...
INFO    : Downloading qtlanguageserver...
INFO    : Redirected: qt.mirror.constant.com
INFO    : Redirected: qt.mirror.constant.com
INFO    : Redirected: qt.mirror.constant.com
INFO    : Downloading qtpositioning...
INFO    : Redirected: qt.mirror.constant.com
INFO    : Downloading qtsensors...
INFO    : Downloading qtmultimedia...
INFO    : Redirected: qt.mirror.constant.com
INFO    : Redirected: qt.mirror.constant.com
INFO    : Downloading qtspeech...
INFO    : Redirected: qt.mirror.constant.com
INFO    : Downloading qtwebengine...
INFO    : Redirected: qt.mirror.constant.com
WARNING : Caught Bad7zFile, terminating installer workers
ERROR   : not a 7z file
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/aqt/installer.py", line 177, in run
    args.func(args)
  File "/opt/homebrew/lib/python3.11/site-packages/aqt/installer.py", line 511, in run_install_src
    self._run_src_doc_examples("src", args)
  File "/opt/homebrew/lib/python3.11/site-packages/aqt/installer.py", line 498, in _run_src_doc_examples
    run_installer(srcdocexamples_archives.get_packages(), base_dir, sevenzip, keep, _archive_dest)
  File "/opt/homebrew/lib/python3.11/site-packages/aqt/installer.py", line 1151, in run_installer
    raise e from e
  File "/opt/homebrew/lib/python3.11/site-packages/aqt/installer.py", line 1127, in run_installer
    pool.starmap(installer, tasks)
  File "/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.2/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 774, in get
    raise self._value
py7zr.exceptions.Bad7zFile: not a 7z file
ERROR   : aqtinstall(aqt) v3.1.3 on Python 3.11.2 [CPython Clang 14.0.0 (clang-1400.0.29.202)]
Working dir: `/Users/dave/qt_test`
Arguments: `['/opt/homebrew/lib/python3.11/site-packages/aqt/__main__.py', 'install-src', 'mac', '6.4.3']` Host: `uname_result(system='Darwin', node='Daves-MBP.hsd1.ca.comcast.net', release='22.3.0', version='Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000', machine='arm64')`
===========================PLEASE FILE A BUG REPORT===========================
You have discovered a bug in aqt.
Please file a bug report at https://github.com/miurahr/aqtinstall/issues
Please remember to include a copy of this program's output in your report.

Desktop (please complete the following information):

OS: mac
aqt version INFO    : aqtinstall(aqt) v3.1.3 on Python 3.11.2 [CPython Clang 14.0.0 (clang-1400.0.29.202)]

Additional context
Here's the relevant PackageUpdate from the Updates.xml file. Please note the .tar.xz file extension:
<PackageUpdate>
 <Name>qt.qt6.643.src</Name>
 <DisplayName>Sources</DisplayName>
 <Description>Qt 6.4.3 Source Components</Description>
 <Version>6.4.3-0-202303121118</Version>
 <ReleaseDate>2023-03-12</ReleaseDate>
 <SortingPriority>100</SortingPriority>
 <DownloadableArchives>
  qtdoc-everywhere-src-6.4.3.tar.xz, qtwayland-everywhere-src-6.4.3.tar.xz, qtbase-everywhere-src-6.4.3.tar.xz, qtsvg-everywhere-src-6.4.3.tar.xz, qtdeclarative-everywhere-src-6.4.3.tar.xz, qttools-everywhere-src-6.4.3.tar.xz, qt5compat-everywhere-src-6.4.3.tar.xz, qtshadertools-everywhere-src-6.4.3.tar.xz, qtquick3d-everywhere-src-6.4.3.tar.xz, qtquick3dphysics-everywhere-src-6.4.3.tar.xz, qtquicktimeline-everywhere-src-6.4.3.tar.xz, qttranslations-everywhere-src-6.4.3.tar.xz, qt5-everywhere-src-6.4.3.tar.xz, qt3d-everywhere-src-6.4.3.tar.xz, qtactiveqt-everywhere-src-6.4.3.tar.xz, qtcharts-everywhere-src-6.4.3.tar.xz, qtcoap-everywhere-src-6.4.3.tar.xz, qtconnectivity-everywhere-src-6.4.3.tar.xz, qtdatavis3d-everywhere-src-6.4.3.tar.xz, qthttpserver-everywhere-src-6.4.3.tar.xz, qtimageformats-everywhere-src-6.4.3.tar.xz, qtlanguageserver-everywhere-src-6.4.3.tar.xz, qtlottie-everywhere-src-6.4.3.tar.xz, qtmqtt-everywhere-src-6.4.3.tar.xz, qtmultimedia-everywhere-src-6.4.3.tar.xz, qtnetworkauth-everywhere-src-6.4.3.tar.xz, qtopcua-everywhere-src-6.4.3.tar.xz, qtpositioning-everywhere-src-6.4.3.tar.xz, qtremoteobjects-everywhere-src-6.4.3.tar.xz, qtscxml-everywhere-src-6.4.3.tar.xz, qtsensors-everywhere-src-6.4.3.tar.xz, qtserialbus-everywhere-src-6.4.3.tar.xz, qtserialport-everywhere-src-6.4.3.tar.xz, qtspeech-everywhere-src-6.4.3.tar.xz, qtvirtualkeyboard-everywhere-src-6.4.3.tar.xz, qtwebchannel-everywhere-src-6.4.3.tar.xz, qtwebengine-everywhere-src-6.4.3.tar.xz, qtwebsockets-everywhere-src-6.4.3.tar.xz, qtwebview-everywhere-src-6.4.3.tar.xz
 </DownloadableArchives>
 <UpdateFile OS="Any" CompressedSize="736456112" UncompressedSize="3552029494"/>
 <SHA1>fad59af06e0bb615e9ff36ca010ae57d3255e1e0</SHA1>
</PackageUpdate>

Duplicate issue #664: Source "qtbase" archive not downloaded
Created: 2023-03-29T07:39:04Z
INFO    : aqtinstall(aqt) v3.1.4 on Python 3.7.9 [CPython MSC v.1900 64 bit (AMD64)]
WARNING : The parameter 'target' with value 'desktop' is deprecated and marked for removal in a future version of aqt.
In the future, please omit this parameter.
INFO    : Downloading qtbase...
INFO    : Redirected: qt.mirror.constant.com
WARNING : Caught Bad7zFile, terminating installer workers
ERROR   : not a 7z file
Traceback (most recent call last):
  File "c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\aqt\installer.py", line 180, in run
    args.func(args)
  File "c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\aqt\installer.py", line 514, in run_install_src
    self._run_src_doc_examples("src", args)
  File "c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\aqt\installer.py", line 501, in _run_src_doc_examples
    run_installer(srcdocexamples_archives.get_packages(), base_dir, sevenzip, keep, _archive_dest)
  File "c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\aqt\installer.py", line 1171, in run_installer
    raise e from e
  File "c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\aqt\installer.py", line 1130, in run_installer
    pool.starmap(installer, tasks)
  File "c:\hostedtoolcache\windows\python\3.7.9\x64\lib\multiprocessing\pool.py", line 276, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "c:\hostedtoolcache\windows\python\3.7.9\x64\lib\multiprocessing\pool.py", line 657, in get
    raise self._value
py7zr.exceptions.Bad7zFile: not a 7z file
ERROR   : aqtinstall(aqt) v3.1.4 on Python 3.7.9 [CPython MSC v.1900 64 bit (AMD64)]
Working dir: `D:\a\rssguard\rssguard`
Arguments: `['C:\\hostedtoolcache\\windows\\Python\\3.7.9\\x64\\Scripts\\aqt', 'install-src', '-O', 'D:\\a\\rssguard\\rssguard\\qt', 'windows', 'desktop', '6.4.3', '--archives', 'qtbase']` Host: `uname_result(system='Windows', node='fv-az41-649', release='10', version='10.0.17763', machine='AMD64', processor='Intel64 Family 6 Model 85 Stepping 7, GenuineIntel')`
===========================PLEASE FILE A BUG REPORT===========================
You have discovered a bug in aqt.
Please file a bug report at https://github.com/miurahr/aqtinstall/issues
Please remember to include a copy of this program's output in your report.
INFO    : aqtinstall(aqt) v3.1.4 on Python 3.7.9 [CPython MSC v.1900 64 bit (AMD64)]
INFO    : Downloading qt.tools.openssl.win_x64...
INFO    : Redirected: qt.mirror.constant.com
INFO    : Finished installation of openssl_1.1.1q_prebuild_x64.7z in 3.94092350
INFO    : Finished installation
INFO    : Time elapsed: 5.91253290 second

Closing comment (2023-03-29T13:19:13Z): This is a duplicate of #662. The fix hasn't been released yet, but you can try the master branch and see if the fix works for you.