jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
446 stars 78 forks source link

Qt Github action Compilation Error: 'invalid choice: 'install-qt'' #208

Closed calcitem closed 9 months ago

calcitem commented 9 months ago

Dear Maintainer,

I am writing this issue to report a compilation error that has arisen using the Qt Github action. The error message I am encountering is as follows:

c:\users\runneradmin\appdata\local\pip\cache\wheels\cb\ee\c0\8b7da5d06750d049187f4672e1fd70fade43ec0d2ee5b5fcda
Successfully built patch
Installing collected packages: patch, urllib3, semantic-version, idna, charset-normalizer, certifi, requests, aqtinstall
Successfully installed aqtinstall-1.2.5 certifi-2023.7.22 charset-normalizer-3.3.0 idna-3.4 patch-1.16 requests-2.31.0 semantic-version-2.10.0 urllib3-2.0.6
C:\hostedtoolcache\windows\Python\3.11.5\x64\python.exe -m aqt install-qt windows desktop 5.15.2 win64_msvc2019_64 --outputdir D:\a\Sanmill/Qt --modules qtcore qtwgui qtmultimedia --external 7z
usage: aqt [-h] [-c CONFIG]
           {install,doc,examples,src,tool,list,help,version} ...
aqt: error: argument {install,doc,examples,src,tool,list,help,version}: invalid choice: 'install-qt' (choose from 'install', 'doc', 'examples', 'src', 'tool', 'list', 'help', 'version')
Error: Error: The process 'C:\hostedtoolcache\windows\Python\3.11.5\x64\python.exe' failed with exit code 2

This issue wasn't present yesterday, but today, it has occurred repeatedly despite several attempts to resolve it.

For your reference, the yml file can be accessed at: https://github.com/calcitem/Sanmill/blob/dev/.github/workflows/qt-on-windows.yml

The complete log of the compilation can be found at: https://github.com/calcitem/Sanmill/actions/runs/6396836019/job/17363487121

Please let me know if you need any further information. Thank you in advance for your assistance.

pzhlkj6612 commented 9 months ago

Hi.

aqtinstall-1.2.5

It's a too old version of aqtinstall.

Your workflow:

      - name: Install Qt
        uses: jurplel/install-qt-action@v3
        with:
          version: '5.15.2'
          host: 'windows'
          target: 'desktop'
          arch: 'win64_msvc2019_64'
          install-deps: 'true'
          modules: 'qtcore qtwgui qtmultimedia'
          cached: 'false'
          setup-python: 'true'
          tools: 'tools_cmake,3.24.2,qt.tools.cmake.win64'
          set-env: 'false'
          tools-only: 'false'
          aqtversion: '==1.2.5'     <----------------------
          py7zrversion: '==0.16.1'
          extra: '--external 7z'

In most cases, there is no need to specify "aqtversion":

aqtversion

Version of aqtinstall to use, given in the format used by pip, for example: ==0.7.1, >=0.7.1, ==0.7.*. This is intended to be used to troubleshoot any bugs that might be caused or fixed by certain versions of aqtinstall.

Default: ==3.1.*

from: https://github.com/jurplel/install-qt-action/blob/8957947946ac9b7623a4ee3c75ab306ffd8ced1c/README.md#aqtversion

I think you should start with fewest inputs (in with:), then add what you need if error occurs.

jurplel commented 9 months ago

The above post is correct. Closing this, feel free to reopen

calcitem commented 9 months ago

Thank you for your assistance. After making the modifications, I encountered other errors and still couldn't compile successfully. However, it appears to be an issue with aqtinstall. I will consult with the author of aqtinstall for further guidance.

https://github.com/calcitem/Sanmill/actions/runs/6401206305/job/17375947088

Successfully installed aqtinstall-3.1.7 beautifulsoup4-4.12.2 bs4-0.0.1 certifi-2023.7.22 charset-normalizer-3.3.0 defusedxml-0.7.1 humanize-4.8.0 idna-3.4 inflate64-0.3.1 patch-1.16 psutil-5.9.5 py7zr-0.20.6 pybcj-1.0.1 requests-2.31.0 semantic-version-2.10.0 soupsieve-2.5 urllib3-2.0.6
C:\hostedtoolcache\windows\Python\3.11.5\x64\python.exe -m aqt install-qt windows desktop 5.15.2 win64_msvc2019_64 --outputdir D:\a\Sanmill/Qt --modules qtcore qtwgui qtmultimedia --external 7z
INFO    : aqtinstall(aqt) v3.1.7 on Python 3.11.5 [CPython MSC v.1936 64 bit (AMD64)]
WARNING : Specified modules ['qtcore', 'qtmultimedia', 'qtwgui'] did not exist when this version of aqtinstall was released. This may not install properly, but we will try our best.
ERROR   : The packages ['qtcore', 'qtmultimedia', 'qtwgui'] were not found while parsing XML of package information!
==============================Suggested follow-up:==============================
* Please use 'aqt list-qt windows desktop --modules 5.15.2 <arch>' to show modules available.
Error: Error: The process 'C:\hostedtoolcache\windows\Python\3.11.5\x64\python.exe' failed with exit code 1
calcitem commented 9 months ago

After conducting research, I've determined the reasons why the build was failing.

According to the documentation for install-qt-action, the cache attribute is no longer supported.

Also, qt.tools.qtcreator is not supported as per the tools section of the documentation.

I have made the necessary modifications and the build is successful now. Thank you all for your assistance.

pzhlkj6612 commented 9 months ago

Well,


Successfully installed aqtinstall-3.1.7 beautifulsoup4-4.12.2 bs4-0.0.1 certifi-2023.7.22 charset-normalizer-3.3.0 defusedxml-0.7.1 humanize-4.8.0 idna-3.4 inflate64-0.3.1 patch-1.16 psutil-5.9.5 py7zr-0.20.6 pybcj-1.0.1 requests-2.31.0 semantic-version-2.10.0 soupsieve-2.5 urllib3-2.0.6
C:\hostedtoolcache\windows\Python\3.11.5\x64\python.exe -m aqt install-qt windows desktop 5.15.2 win64_msvc2019_64 --outputdir D:\a\Sanmill/Qt --modules qtcore qtwgui qtmultimedia --external 7z
INFO    : aqtinstall(aqt) v3.1.7 on Python 3.11.5 [CPython MSC v.1936 64 bit (AMD64)]
WARNING : Specified modules ['qtcore', 'qtmultimedia', 'qtwgui'] did not exist when this version of aqtinstall was released. This may not install properly, but we will try our best.
ERROR   : The packages ['qtcore', 'qtmultimedia', 'qtwgui'] were not found while parsing XML of package information!
==============================Suggested follow-up:==============================
* Please use 'aqt list-qt windows desktop --modules 5.15.2 <arch>' to show modules available.
Error: Error: The process 'C:\hostedtoolcache\windows\Python\3.11.5\x64\python.exe' failed with exit code 1

"qtcore" is a built-in module and not required to be installed. I think this website may help you with finding modules: aqt list-qt server


According to the documentation for install-qt-action, the cache attribute is no longer supported.

Maybe you were saying cached? That's an input in older versions.


Also, qt.tools.qtcreator is not supported as per the tools section of the documentation.

I don't think so. Did you try this:

    - name: Install Qt
      uses: jurplel/install-qt-action@v3
      with:
        # ...
        tools: 'tools_qtcreator,qt.tools.qtcreator'


And,

I think you should start with fewest inputs (in with:), then add what you need if error occurs.