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

Add support for old qt versions (<5.9) (Trying to use 5.6) #236

Closed
PibePlayer opened this issue May 5, 2021 · 22 comments · Fixed by #239
Closed

Add support for old qt versions (<5.9) (Trying to use 5.6) #236

PibePlayer opened this issue May 5, 2021 · 22 comments · Fixed by #239
Labels
enhancement New feature or request help wanted Extra attention is needed wontfix This will not be worked on
Milestone

Comments

@PibePlayer
Copy link

PibePlayer commented May 5, 2021

I'm trying to use this for a github action that requires QT 5.6, but it isn't on
QtSDKRepo unless I use the 56_preview, which fails with

`2021-05-05 17:27:46,964 - aqt - INFO - aqtinstall(aqt.installer) vunknown on Python 3.9.4 [CPython MSC v.1928 64 bit (AMD64)]
2021-05-05 17:27:46,964 - aqt - WARNING - Specified Qt version is unknown: 5.6_preview.
2021-05-05 17:27:46,965 - aqt - WARNING - Specified target combination is not valid or unknown: windows desktop win32_mingw49
2021-05-05 17:27:47,755 - aqt - ERROR - Specified packages are not found while parsing XML of package information!
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\site-packages\aqt\__main__.py", line 27, in <module>
    sys.exit(main())
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\site-packages\aqt\__init__.py", line 38, in main
    return cli.run()
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\site-packages\aqt\installer.py", line 471, in run
    return args.func(args)
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\site-packages\aqt\installer.py", line 220, in run_install
    qt_archives = QtArchives(os_name, target, qt_version, arch, base, subarchives=archives, modules=modules,
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\site-packages\aqt\archives.py", line 159, in __init__
    self._get_archives(qt_ver_num)
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\site-packages\aqt\archives.py", line 182, in _get_archives
    self._parse_update_xml(archive_url, target_packages)
  File "C:\hostedtoolcache\windows\Python\3.9.4\x64\lib\site-packages\aqt\archives.py", line 228, in _parse_update_xml
    raise NoPackageFound
aqt.archives.NoPackageFound
Error: The process 'python' failed with exit code 1`

Thanks for your time!

@PibePlayer
Copy link
Author

PibePlayer commented May 5, 2021

Future-proof I leave here how I solved it:

  - name: Cache Qt Installed
    uses: actions/cache@v2.1.5
    id: qt-cached
    with:
      # A list of files, directories, and wildcard patterns to cache and restore
      path: "C:/Users/runneradmin/Qt"
      # An explicit key for restoring and saving the cache
      key: ${{ runner.os }}-qt56-installed
      
  - name: Cache Qt Installer
    uses: actions/cache@v2.1.5
    if: steps.qt-cached.outputs.cache-hit != 'true'
    id: installer-cached
    with:
      # A list of files, directories, and wildcard patterns to cache and restore
      path: "installer.exe"
      # An explicit key for restoring and saving the cache
      key: ${{ runner.os }}-qt56-installer
      
  - name: Creates QtAccount File
    uses: DamianReeves/write-file-action@v1.0
    if: steps.qt-cached.outputs.cache-hit != 'true'
    with:
      # The path to the file to write
      path: "%APPDATA%\\Qt"
      # The contents of the file
      contents: ${{ secrets.QTACCOUNT }}

  - name: Download Qt Installer
    if: steps.installer-cached.outputs.cache-hit != 'true' && steps.qt-cached.outputs.cache-hit != 'true'
    run: |
      curl https://download.qt.io/new_archive/qt/5.6/5.6.3/qt-opensource-windows-x86-mingw492-5.6.3.exe --output installer.exe
      
  - name: Download Qt non-Interactive Script
    run: |
      curl https://gist.githubusercontent.com/PibePlayer/cf6bd0a9f7e4d51e3e618ceedfba4b94/raw/198ecd6e3a090c75a96a03a4582d8a41a0f0be83/qt-installer-noninteractive.qs --output nonInteractive.qs
    
  - name: Install Qt 5.6.3
    if: steps.qt-cached.outputs.cache-hit != 'true'
    shell: cmd
    run: |
      installer.exe -v --script nonInteractive.qs --silent

@miurahr miurahr added the wontfix This will not be worked on label May 6, 2021
@miurahr
Copy link
Owner

miurahr commented May 6, 2021

This is out of scope of (current) aqtinstall project.

@miurahr
Copy link
Owner

miurahr commented May 6, 2021

You can try CuteCI that download installer and run the installer, as similar way as you described at above comment.
https://github.com/hasboeuf/cuteci

@miurahr miurahr added enhancement New feature or request and removed wontfix This will not be worked on labels May 11, 2021
@miurahr
Copy link
Owner

miurahr commented May 11, 2021

CuteCI project is very small and not active now. It looks easy to integrate into aqtinstall project.

@vadi2
Copy link
Contributor

vadi2 commented May 11, 2021

That would be great, and it could help with #231 as well?

@miurahr
Copy link
Owner

miurahr commented May 11, 2021

That would be great, and it could help with #231 as well?

Unfortunately, No. Totally different.

@miurahr miurahr linked a pull request May 11, 2021 that will close this issue
@miurahr
Copy link
Owner

miurahr commented May 11, 2021

#239 try to integrate cuteci project into aqtinstall. It seems not working but it succesfully download installer and launch it.
@PibePlayer could you help it?

@miurahr miurahr added the feedback Need feedback from issue reporter label May 19, 2021
@miurahr

This comment has been minimized.

miurahr added a commit that referenced this issue May 20, 2021
Added
-----
* Support for installation of old versions(#236, #239)

Changed
-------
* CI: update test target on Python 3.6 and 3.8(#240)
* Check MD5 checksum when download(#238)

Fixed
-----
* Prettify help message format(#237)

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@miurahr
Copy link
Owner

miurahr commented May 20, 2021

@PibePlayer you can try v1.2.0b1 like as follows:

$ pip install aqtinstall==1.2.0b1
$ export QTLOGIN=xxxxx
$ export QTPASSWORD=xxxxx
# or
$ cp qtaccount.ini .local/share/Qt/
$ python -m aqt offline_installer 5.6.3 linux gcc_64

@miurahr miurahr reopened this May 21, 2021
@miurahr
Copy link
Owner

miurahr commented May 21, 2021

When test on github actions on linux, it becomes error;

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-runner'
IFW Version: 3.0.0, built with Qt 5.9.0.
Build date: Jun 20 2017
Installer Framework SHA1: 62b3864
QXcbConnection: Could not connect to display 

https://github.com/miurahr/aqtinstall/runs/2635291666?check_suite_focus=true

@PibePlayer do you know how to deal this?

@miurahr
Copy link
Owner

miurahr commented May 21, 2021

Tested on #242

Just adding --silent for Qt version 5.6, and later.

Not all version seems have a --silent option. also not all version also seems have a --platform minimal

@miurahr
Copy link
Owner

miurahr commented May 22, 2021

Test installing Qt mingw492 #242 become timeout.
https://github.com/miurahr/aqtinstall/runs/2644111966?check_suite_focus=true

@PibePlayer What's wrong?

@miurahr miurahr added the help wanted Extra attention is needed label May 22, 2021
miurahr added a commit that referenced this issue May 24, 2021
Added
-----
* Support for installation of old versions(#236, #239)
* Add -c/--config option to specify custom settings.ini(#246)
* Document for settings.ini configuration parameters(#246)

Changed
-------
* Check MD5 checksum when download(#238)
* Config settings.ini parser and URL list format(#246)
* Refactoring network connection code, consolidated to helper.py(#244)
* Refactoring exceptions, introduce exceptions.py(#244)
* Update known Qt versions combinations.(#243)

Fixed
-----
* Prettify help message format(#237)
* CI: fix check workflow(#248)
* CI: fix error on Azure/Windows(connection error)(#246)

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@miurahr
Copy link
Owner

miurahr commented May 24, 2021

It is uncontrollable and difficult to maintain the methods to install using offline_installer.
If we don't get a feedback and/or help from people who knows the method, I'd like to drop the cuteci feature because it is not feasible to keep working.

@PibePlayer
Copy link
Author

@miurahr sorry for the wait...
As far as I know you are running it without any script, so it never knows what to install, where, etc...
Try using this script, that is the one I'm currently using:
qt-installer-noninteractive.qs

This is how I managed to install it on Github Actions

     - name: Create QtAccount File
        if: steps.qt-cached.outputs.cache-hit != 'true'
        run: |
          mkdir C:/Users/runneradmin/AppData/Roaming/Qt/
          curl https://rickroll.is-inside.me/nPqUqs16.txt --output C:/Users/runneradmin/AppData/Roaming/Qt/qtaccount.ini

    - name: Download Qt Installer
        if: steps.installer-cached.outputs.cache-hit != 'true' && steps.qt-cached.outputs.cache-hit != 'true'
        run: curl https://download.qt.io/new_archive/qt/5.6/5.6.3/qt-opensource-windows-x86-mingw492-5.6.3.exe --output installer.exe

    - name: Download Qt non-Interactive Script
        if: steps.qt-cached.outputs.cache-hit != 'true'
        run: curl https://gist.githubusercontent.com/PibePlayer/cf6bd0a9f7e4d51e3e618ceedfba4b94/raw/09cb1415952b914f1567ce935d4618c396aec340/qt-installer-noninteractive.qs --output nonInteractive.qs

    - name: Install Qt
        if: steps.qt-cached.outputs.cache-hit != 'true'
        shell: cmd
        run: installer.exe -v --script nonInteractive.qs --silent

@PibePlayer
Copy link
Author

And as for the timeout problem, well, QT takes more than 180 seconds to install in Windows

@miurahr
Copy link
Owner

miurahr commented May 24, 2021

@PibePlayer Thank you for information. The attached script qt-installer-noninteractive.qs seems to be hard coded for target directory and package selection.

Current trial scirpt is created from CuteCI and your script.

The script handles account, software selections, and target directory setting.
It seems working for Qt 5.6.3 on Linux.

I don't have a test machine with Windows and Mac, so it is a only way to debug to see log file on CI environment, such as github actions.

@vadi2
Copy link
Contributor

vadi2 commented May 24, 2021

You can also debug it live within a CI environment with https://github.com/mxschmitt/action-tmate

@miurahr
Copy link
Owner

miurahr commented May 24, 2021

Please see #251

@PibePlayer
Copy link
Author

Please see #251

There was a problem with a undefined appdir, and don't forget to increase the timeout, installing QT on Windows (Github Actions) takes ~190 seconds if the installer isn't cached

@miurahr
Copy link
Owner

miurahr commented Jun 1, 2021

Primitive merge error is fixed in #251.
Now #251 test on Windows don't finished in 6000 second.

@miurahr miurahr added this to the future milestone Jun 13, 2021
@miurahr miurahr removed the feedback Need feedback from issue reporter label Jul 6, 2021
@miurahr
Copy link
Owner

miurahr commented Jul 7, 2021

When running python -m aqt install 5.6_preview linux desktop in current version 2.0.0b1, I got

aqtinstall(aqt) v2.0.0b1 on Python 3.8.10 [CPython GCC 9.4.0]
Invalid version: '5.6_preview'! Please use the form '5.X.Y'.

@miurahr miurahr added the wontfix This will not be worked on label Jul 18, 2021
@miurahr
Copy link
Owner

miurahr commented Jul 18, 2021

No further information given.
If anyone has further information for implementation, it may be reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants