Skip to content

qml: Compile application sources ahead of time - #863

Open
johnny9 wants to merge 1 commit into
bitcoin-core:qt6from
johnny9:codex/695-854-qml-cache
Open

qml: Compile application sources ahead of time#863
johnny9 wants to merge 1 commit into
bitcoin-core:qt6from
johnny9:codex/695-854-qml-cache

Conversation

@johnny9

@johnny9 johnny9 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This compiles the application QML and JavaScript with qt6_add_qml_module.
qmlcachegen now checks these files during the build and embeds the generated
units in the executable. Existing qrc:/qml/... paths remain unchanged. Images,
fonts, and controls/qmldir remain in the manual resource file.

On Qt 6.6 and newer, the application uses only the embedded AOT units. It does
not read or write host-generated .qmlc or .jsc files. Qt 6.2 through 6.5
cannot control embedded and host cache files separately, so those versions use
the embedded QML source with the host cache disabled.

This prevents invalid QML from reaching packaged builds and prevents stale host
cache files from affecting application upgrades.

The change also adds unit and launch tests for the cache policy and adds the Qt
private declarative headers required by cachegen builds.

Tested on Ubuntu 24.04 with Qt 6.4.2:

  • Built bitcoin-core-app, bitcoinqml_unit_tests, and bitcoinqml_qmltests.
  • Passed both CTest targets.
  • Passed the cold-launch and stale-cache smoke test.
  • Confirmed that an invalid QML token fails the build in qmlcachegen.
  • Passed git diff --check.

Fixes #695
Fixes #854

@johnny9
johnny9 force-pushed the codex/695-854-qml-cache branch from f68fa3b to 48e77ff Compare August 18, 2026 02:14
@johnny9
johnny9 marked this pull request as ready for review August 18, 2026 18:00
@johnny9
johnny9 force-pushed the codex/695-854-qml-cache branch from 48e77ff to 4c1227c Compare August 20, 2026 00:49
@johnny9
johnny9 force-pushed the codex/695-854-qml-cache branch from 4c1227c to e3fd144 Compare August 25, 2026 02:11
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.

Build system: define a safe QML cache policy for packaged upgrades Build system: enable Qt 6 QML cachegen for build-time QML syntax errors

1 participant