qtdeclarative: durably regenerate qlalr grammar on incremental rebuild
redbear-ci / check (push) Has been cancelled

A relibc ABI change invalidates qtdeclarative's fingerprint and triggers an
incremental rebuild that keeps the 1-line empty qqmljsgrammar_p.h stub (it
survives the recipe's CMakeCache/CMakeFiles removal), so ninja skips qlalr
regeneration and every consumer of qqmljslexer_p.h fails with 'expected
class-name' / 'QQmlJS::Parser incomplete type'. Delete the stale qlalr outputs
(qqmljsgrammar_p.h + qqmljsgrammar.cpp) before configure so qt_process_qlalr
regenerates them. Pattern (j): stale codegen after a toolchain rebuild — now
durable instead of needing a manual clean rebuild each time.

Validated: qtdeclarative built (libQt6Qml/libQt6Quick) in the full cascade build.
This commit is contained in:
2026-08-02 09:37:16 +03:00
parent b20f45817a
commit 85b047a817
@@ -148,6 +148,18 @@ fi
rm -f CMakeCache.txt
rm -rf CMakeFiles
# Remove stale qlalr-generated grammar. The QML lexer/parser grammar
# (qqmljsgrammar_p.h + qqmljsgrammar.cpp) is generated by qt_process_qlalr from
# src/qml/parser/qqmljs.g; the source ships none. An incremental rebuild (e.g.
# after a relibc ABI change invalidates the fingerprint) can leave a 1-line empty
# stub that survives CMakeCache/CMakeFiles removal, so ninja considers it up to
# date and skips regeneration — every consumer of qqmljslexer_p.h then fails with
# "expected class-name" / "QQmlJS::Parser has incomplete type". Deleting the
# stale outputs forces qt_process_qlalr to regenerate them (missing output ->
# rule re-runs). This is pattern (j): stale codegen after a toolchain rebuild.
find . -name 'qqmljsgrammar_p.h' -delete 2>/dev/null || true
find . -name 'qqmljsgrammar.cpp' -delete 2>/dev/null || true
redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules qml
# Patch masm/CheckedArithmetic.h: add missing ArithmeticOperations<unsigned, long>