Skip to content

Add commercial support, fix WASM and issues with Qt 6.7.+ - #272

Merged
jurplel merged 26 commits into
jurplel:masterfrom
Kidev:master
Apr 21, 2025
Merged

jurplel merged 26 commits into
jurplel:masterfrom
Kidev:master

Conversation

@Kidev

@Kidev Kidev commented Dec 18, 2024 •

Copy link
Copy Markdown
Contributor

This PR includes

  • Updates to parameters and logic to handle the latest aqtinstall versions, making the action once again able to install any version of Qt, WASM and extensions included (aqtinstall >=3.2.0)
  • Add full support for installing Qt commercial versions provided you own a Qt account (paid or not). The account is required even if you only download open-source versions (aqtinstall >=3.2.2)
  • Updated outdated defaults, and used Qt 6.8.3 as LTS
  • Updated @action/cache to v4 to match Github's update

Context

Since Qt 6.7+, the Qt team decided to make WASM a part of all_os as host, with target wasm. This is sensible as the WASM version of Qt cannot work on its own and needs a host. To install Qt WASM for the latest versions, the host and target values must be edited. See examples.
This change is required by the latest versions of aqtinstall (>=3.2.0)

Examples:

Tip

Click [run] to see a successful Github Action run using each example
Click [workflow] to see the corresponding workflow

Latest Qt WASM [run] [workflow]

- name: Install Qt for host and WASM
  uses: jurplel/install-qt-action@v4
  with:
    version: '6.8.2'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'
    modules: 'qtquick3d'

Notice host and target. Since --autodesktop is always implied, this will download WASM for the current OS (so this will download linux_gcc_64 and wasm_singlethread if ran on linux).

Qt commercial [run] [workflow]:

- name: Install Qt commercial
  uses: jurplel/install-qt-action@v4
  with:
    version: '6.8.2'
    target: 'desktop'
    arch: 'linux_gcc_64'
    use-official: true
    email: ${{ secrets.QT_USERNAME }}
    pw: ${{ secrets.QT_PASSWORD }}
    modules: 'qtquick3d'

Notice the absence of host: the official installer only installs using the current OS as host. If provided, it will be ignored. You should use secrets for the login information. This will download linux_gcc_64 for linux using the official installer. If you own a paid Qt license, you can use a commercial only version in the version field, and it will work.

Qt commercial WASM [run] [workflow]

- name: Install Qt commercial
  uses: jurplel/install-qt-action@v4
  with:
    version: '6.8.2'
    target: 'desktop'
    arch: 'linux_gcc_64'
    use-official: true
    email: ${{ secrets.QT_USERNAME }}
    pw: ${{ secrets.QT_PASSWORD }}
    modules: 'wasm_singlethread qtquick3d'

Same as the previous one, host is implied. For the official installer however, there is no --autodesktop. Instead, the modules field get a widened meaning, and includes all Qt packages. So this example will install Qt for linux (implied to be the host), for the WASM host architecture linux_gcc_64, and will download the wasm_singlethread package (considered the target) along with qtquick3d for both.

@jdpurcell

Copy link
Copy Markdown
Contributor

@Kidev install-qt-action already passes --autodesktop, it's just that it doesn't typically work if you specify aqtsource as you were probably doing for testing. The logic for when it passes in the parameter is determined by:

const isAutodesktopSupported = async (): Promise<boolean> => {
  const rawOutput = await getPythonOutput("aqt", ["version"]);
  const match = rawOutput.match(/aqtinstall\(aqt\)\s+v(\d+\.\d+\.\d+)/);
  return match ? compareVersions(match[1], ">=", "3.0.0") : false;
};

The problem is, if you point aqtsource at a branch on your Git repo, due to aqt's use of setuptools-scm, the version is auto-generated like v0.1.dev1823 so the regex doesn't match it due to the letters, and it falls to the : false expression of the ternary conditional operator. In my opinion that should be changed to : true to allow easier use with aqtsource.

Right now as you discovered, one either needs to pass extra: '--autodesktop', or only point aqtsource to a version tag that satisfies the version expectation. For example when I was testing some things with aqt, I created a fake version tag like v3.1.100 for use with aqtsource so that setuptools-scm would auto-assign it that version.

@Kidev

Kidev commented Dec 21, 2024 •

Copy link
Copy Markdown
Contributor Author

Indeed, I'll remove it from the README and such then. In the meantime I got it all working, as you can see in this workflow file of a project of mine. You can check the latest run here. You can use it right now if you need to, no need to wait for either PRs:

- name: Install Qt for host architecture
  uses: Kidev/install-qt-action@v4.2.0
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'
    set-env: 'true'
    modules: 'qtquick3d'
    aqtsource: 'git+https://github.com/Kidev/aqtinstall.git@wasm'
    extra: '--autodesktop'

@Kidev Kidev mentioned this pull request Dec 22, 2024
@crueter

crueter commented Jan 2, 2025 •

Copy link
Copy Markdown

@Kidev My application depends on Qt Quick, and this doesn't seem to properly install it for WASM or Android.

Failed to find required Qt component "Quick".

Here's my config:

- name: Install Qt (Host)
  uses: Kidev/install-qt-action@v4.2.0
  with:
    cache: on
    version: 6.8.1

- name: Install Qt (WASM)
  if: // ...
  uses: Kidev/install-qt-action@v4.2.0
  with:
    cache: on
    host: all_os
    target: wasm
    version: 6.8.1
    arch: wasm_singlethread
    set-env: true
    modules: 'qtquick3d'
    aqtsource: 'git+https://github.com/Kidev/aqtinstall.git@wasm'

Why is Quick not getting installed?

Actually, scrolling up, it can't find Qt core...

Found package configuration file:

    /.../lib/cmake/Qt6Quick/Qt6QuickConfig.cmake

  but it set Qt6Quick_FOUND to FALSE so package "Qt6Quick" is considered to
  be NOT FOUND.  Reason given by package:

  Qt6Quick could not be found because dependency Qt6Core could not be found.

...because it can't find Qt6CoreTools.

Found package configuration file:

    /.../lib/cmake/Qt6Core/Qt6CoreConfig.cmake

  but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
  NOT FOUND.  Reason given by package:

  Qt6Core could not be found because dependency Qt6CoreTools could not be
  found.

@crueter

crueter commented Jan 2, 2025

Copy link
Copy Markdown

Nevermind, I had the wrong host paths set in my configure command.

@Kidev

Kidev commented Jan 6, 2025 •

Copy link
Copy Markdown
Contributor Author

The PR fixing WASM and more was merged into master and aqtinstall will soon release its version 3.2.0 including those changes. For it to work, I updated the default value of aqtversion to 3.2.*. I also updated the default value of version to the only Qt LTS version remaining (6.8.1). My temporary version of the Action is available here. Note the version v4.2.1 will only work once the release is published (I will update once it is the case). Until then you must still use v4.2.0.

Note

Until the release 3.2.0 of aqtinstall is published, use:

- name: Install Qt for host architecture
  uses: Kidev/install-qt-action@v4.2.0
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'
    aqtsource: 'git+https://github.com/miurahr/aqtinstall.git'
    extra: '--autodesktop'

Here is a working deploy as example

Note

Once the release 3.2.0 of aqtinstall is published, use:

- name: Install Qt for host architecture
  uses: Kidev/install-qt-action@v4.2.1
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'

@Kidev Kidev changed the title To fix issues with Qt 6.7+ and match with aqtinstall, allows 'all_os' for host and 'wasm' for target Fix WASM and issues with Qt 6.7.+ Jan 6, 2025
@xavier2k6

Copy link
Copy Markdown
Contributor

py7zr default could probably be bumped as well to ==0.22.* to coincide with aqtinstall/dependencies.

https://github.com/miurahr/aqtinstall/blob/master/pyproject.toml#L29

@xavier2k6

Copy link
Copy Markdown
Contributor

BTW: I have PR #267 Open for the python-version range, thoughts?

@Kidev

Kidev commented Jan 6, 2025 •

Copy link
Copy Markdown
Contributor Author

BTW: I have PR #267 Open for the python-version range, thoughts?

It is a good idea, I also have updated it in my latest update, along with py7zr.

It is not yet ready for this PR, still need some testing, but I'm working on getting commercial versions available to the installation using this Action (miurahr/aqtinstall#878 https://github.com/Kidev/install-qt-action). Here you can see a successful install of Qt using the use-commercial feature (note the install succeeds, but the workflow fails because as of today, addons are not yet supported by the use-commercial feature. It is work in progress though)

image

@Kidev Kidev changed the title Fix WASM and issues with Qt 6.7.+ AddFix WASM and issues with Qt 6.7.+ Jan 27, 2025
@Kidev Kidev changed the title AddFix WASM and issues with Qt 6.7.+ Add commercial support, fix WASM and issues with Qt 6.7.+ Jan 27, 2025
@Kidev

Kidev commented Jan 27, 2025 •

Copy link
Copy Markdown
Contributor Author

Added working support for Qt commercial.

You can see an example using my version of the workflow
It uses my version of install-qt-action (v4.4.2) while this PR is not merged

You can use it right now yourself like this, until this PR is merged:

- name: Install Qt
  uses: Kidev/install-qt-action@v4.4.2
  with:
    version: '6.8.1'
    target: 'desktop'
    arch: 'linux_gcc_64'
    aqtsource: 'git+https://github.com/miurahr/aqtinstall'
    use-commercial: true
    user: ${{ secrets.QT_USERNAME }}
    password: ${{ secrets.QT_PASSWORD }}
    modules: 'qtquick3d'

@Kidev

Kidev commented Feb 13, 2025

Copy link
Copy Markdown
Contributor Author

Fixed the issue after the re-sync, and some force push shenanigans to run the workflows on my repo too

@Kidev

Kidev commented Feb 13, 2025 •

Copy link
Copy Markdown
Contributor Author

Update: @jurplel almost all tests pass on my repo. There are issues with the windows-2019 runner however. I'm pretty sure it's because of MSVC2019, that is no longer supported by aqtinstall (see here for the discussion with the maintainer and other contributors of aqtinstall).

The commercial PR can be found here for more info.

Caution

The docs and some commands have changed, I'll update this soon, along with some tests

@Kidev

Kidev commented Mar 21, 2025 •

Copy link
Copy Markdown
Contributor Author

There seems to have been an update on the Qt repos, the name of the installer have been changed (online installer v4.9). I pushed a fix in aqtinstall but in the meantime the official option will fail:

INFO    : Downloading Qt installer to /home/runner/.local/share/aqt/tmp/qt-unified-linux-x64-online.run
ERROR   : Error installing official installer Failed to download installer: Failed to download checksum for the file 'qt-unified-linux-x64-online.run' from mirrors '['https://download.qt.io/']

Until this gets merged, you can use

aqtsource: 'git+https://github.com/Kidev/aqtinstall.git@official_ux'

Here it is in action: [workflow] [run].

Also Qt 6.8.3 does not exist yet, I'm changing it to 6.8.2.

For the aqtversion value, I think it's safe to keep >= as the updates are retro compatible

Updated the top post to make it able to be used as documentation.

@xavier2k6

Copy link
Copy Markdown
Contributor

Also Qt 6.8.3 does not exist yet

Got delayed until start of next week -> https://lists.qt-project.org/pipermail/releasing/2025-March/003048.html

Blocker from mailing list has now been resolved -> https://bugreports.qt.io/browse/QTBUG-134289

@xavier2k6

Copy link
Copy Markdown
Contributor

off-topic: any options for FOSS to use Qt 5.15.16/Qt 6.5.5 etc.?

@crueter

crueter commented Mar 21, 2025

Copy link
Copy Markdown

off-topic: any options for FOSS to use Qt 5.15.16/Qt 6.5.5 etc.?

KDE maintains these older versions afaict, I'm not sure if they provide anything other than Linux builds however.

@xavier2k6

xavier2k6 commented Mar 21, 2025 •

Copy link
Copy Markdown
Contributor

off-topic: any options for FOSS to use Qt 5.15.16/Qt 6.5.5 etc.?

KDE maintains these older versions afaict, I'm not sure if they provide anything other than Linux builds however.

vcpkg provides latest Qt 5 (Qt 5.15.16) & latest Qt6 (Qt 6.8.x)

Just thought there may be another way via this action to support installing Qt 5.15.16 or indeed Qt 6.5.5 on windows via official installer......not a big deal (no pre-existing compiled binaries available)

@crueter

crueter commented Mar 21, 2025

Copy link
Copy Markdown

Good opportunity for someone to host binary installers with the KDE builds.

@Kidev

Kidev commented Mar 21, 2025 •

Copy link
Copy Markdown
Contributor Author

off-topic: any options for FOSS to use Qt 5.15.16/Qt 6.5.5 etc.?

KDE maintains these older versions afaict, I'm not sure if they provide anything other than Linux builds however.

vcpkg provides latest Qt 5 (Qt 5.15.16) & latest Qt6 (Qt 6.8.x)

Just thought there may be another way via this action to support installing Qt 5.15.16 or indeed Qt 6.5.5 on windows via official installer......not a big deal (no pre-existing compiled binaries available)

You can install those versions using the official installer, you just need a paid account.

- name: Install Qt 6.5.5 Windows on 'windows-2019'
  uses: jurplel/install-qt-action@v4
  with:
    version: '6.5.5'
    target: 'desktop'
    arch: 'win64_msvc2019_64'
    use-official: true
    email: ${{ secrets.QT_USERNAME }}
    pw: ${{ secrets.QT_PASSWORD }}
    modules: 'all'
- name: Install Qt 5.15.16 Linux on 'ubuntu-24.04'
  uses: jurplel/install-qt-action@v4
  with:
    version: '5.15.16'
    target: 'desktop'
    arch: 'gcc_64'
    use-official: true
    email: ${{ secrets.QT_USERNAME }}
    pw: ${{ secrets.QT_PASSWORD }}
    modules: 'all'

With a open-source account you cannot, and building Qt is outside the scope of aqtinstall

Good opportunity for someone to host binary installers with the KDE builds.

I would not advise this, as it would be a massive security concern

@Kidev Kidev mentioned this pull request Mar 21, 2025
@xavier2k6

Copy link
Copy Markdown
Contributor

@Kidev Thanks!

@xavier2k6

Copy link
Copy Markdown
Contributor

Binaries for Qt 6.8.3 are showing now as being available:

https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_683/qt6_683/

@xavier2k6

Copy link
Copy Markdown
Contributor

README.md

py7zrversion: '==0.20.*'

Change to (py7zrversion: '==0.22.*') as that's the proposed new default.

Still needs to be changed, Line 311 of this PR

@Kidev

Kidev commented Mar 25, 2025

Copy link
Copy Markdown
Contributor Author

@xavier2k6 Will change
@jdpurcell I think I remember you saying somewhere that you tried updating the @action/cache package to v4 and succeeding. When I try, the action keep failing, any idea what I messed up?

@xavier2k6

xavier2k6 commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

@Kidev for the cache to be updated, you'll need to update the dependencies in action\package.json & possibly action\package-lock.json files

EDIT:
looks like you may have missed a dependency (to be added) @vercel/ncc: 0.38.3

EDIT 2:
@actions/io: 1.1.3 may also need to be added.

@jdpurcell

jdpurcell commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

@Kidev I think I did something like npm install @actions/cache@4.0.3 but I had a lot of trouble with the way the dependencies are stored in the node_modules directory and committed to the repo. That seems to be the old way of doing it and these days the dependencies usually get bundled into a single file. It's also weird because node_modules is in .gitignore but it shouldn't be when using the older style of publishing with the whole directory in the repo. I decided to leave it in .gitignore and update it to do bundling instead.

I think your problem is since node_modules is still in .gitignore, Git only partially detects changes in there - just modifications and deletions, but not new files added. Even if you remove it from .gitignore it's still a pain because then it wants to add a bunch of unnecessary dependencies too (all the devDependencies, not just the main ones) unless you are careful when installing/updating dependencies (e.g. npm install --omit=dev). I found it easier to do bundling. I'm not much of a Node / JS / TS expert though, that was just my conclusion after a long troubleshooting session with ChatGPT 😄.

@Kidev

Kidev commented Mar 26, 2025 •

Copy link
Copy Markdown
Contributor Author

Thanks @xavier2k6 @jdpurcell.

I think your problem is since node_modules is still in .gitignore, Git only partially detects changes in there - just modifications and deletions, but not new files added. Even if you remove it from .gitignore it's still a pain because then it wants to add a bunch of unnecessary dependencies too (all the devDependencies, not just the main ones) unless you are careful when installing/updating dependencies (e.g. npm install --omit=dev). I found it easier to do bundling. I'm not much of a Node / JS / TS expert though, that was just my conclusion after a long troubleshooting session with ChatGPT 😄.

Oh that's it for sure, that's a sneaky error that already happened to me a while back for something else, a sneaky .gitignore mistake. Nice catch! And since I'm not familiar with typescript errors (I use JS but it's for QML aha), I was not able to pinpoint the error because I assumed the whole node_modules dir was pushed... But yeah the release process had me really confused when I first wanted to share PRs aha

@Kidev

Kidev commented Mar 26, 2025 •

Copy link
Copy Markdown
Contributor Author

Everything's done.

  • Updated the main post with examples and links to runs/workflows
  • I used 3.2.* for aqtinstall version so that it works now (except for the use-official feature, explained later) by using v3.2.1 but will use v3.2.2 when released. This is important as there were changes on the Qt official installer names, and aqtinstall v3.2.1 no longer supports commercial. I already pushed a PR that fixes that, but for it to work we'll need v3.2.2 to be released.
  • Updated outdated defaults, and used Qt 6.8.3 as LTS
  • Updated @action/cache to v4 to match Github's update

@Kidev
Kidev requested a review from jurplel April 9, 2025 20:13
@Kidev

Kidev commented Apr 9, 2025 •

Copy link
Copy Markdown
Contributor Author

I have re-synced with master to limit the python version, so now all checks of the CI pass again (CI CI-android)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants