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

Fix WASM and issues with Qt 6.7.+ #272

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Kidev
Copy link

@Kidev Kidev commented Dec 18, 2024

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, it will soon be required to use the action like this:

- name: Install Qt for host and WASM
  uses: jurplel/[email protected]
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'
    modules: 'all'

This change will be required once this PR goes through, but it is not breaking anything until it does get merged

@jdpurcell
Copy link

@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
Copy link
Author

Kidev commented Dec 21, 2024

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/[email protected]
  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
Copy link

crueter commented Jan 2, 2025

@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/[email protected]
  with:
    cache: on
    version: 6.8.1

- name: Install Qt (WASM)
  if: // ...
  uses: Kidev/[email protected]
  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
Copy link

crueter commented Jan 2, 2025

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

@Kidev
Copy link
Author

Kidev commented Jan 6, 2025

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/[email protected]
  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/[email protected]
  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

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

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

@Kidev
Copy link
Author

Kidev commented Jan 6, 2025

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

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.

4 participants