bridge: scope maker qml_path injection to when@dev
Some checks failed
CI / Quality (push) Failing after 4m0s
Release / Linux AppImage (push) Successful in 5m30s

The v0.1.2 build broke the staging-symfony container compile: explicit
top-level `services.PhpQml\Bridge\Maker\BridgeResourceMaker:` blocks
forced ResolveClassPass to load AbstractMaker, which is excluded by
`composer install --no-dev`. The glob alone tolerates the missing
parent (FileLoader silently drops classes that fail class_exists), but
explicit blocks bypass that check.

Fix: keep v0.1.1's plain glob untouched; move the qml_path argument
overrides into a `when@dev:` envelope that prod/no-dev compiles never
touch. Dev builds still resolve the bound parameter (verified via
debug:container — Argument value `../qml/`); prod cache:clear no
longer aborts on missing AbstractMaker; integration-bundled passes
end-to-end locally.

No public-API change; release CI fix only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-03 16:48:51 +02:00
parent 8b2fc4dd06
commit c78d471368

View File

@@ -12,10 +12,21 @@ services:
arguments: arguments:
$expectedToken: '%env(default::BRIDGE_TOKEN)%' $expectedToken: '%env(default::BRIDGE_TOKEN)%'
PhpQml\Bridge\Maker\BridgeResourceMaker: # Maker classes extend symfony/maker-bundle's AbstractMaker, which is a
arguments: # require-dev dependency. In `composer install --no-dev` builds (the
$qmlPath: '%bridge.qml_path%' # staging-symfony tree the AppImage is assembled from) AbstractMaker is
# absent: PHP fails to autoload BridgeResourceMaker etc., so the glob
# above silently drops them — that's fine. But a top-level explicit
# `services.PhpQml\Bridge\Maker\BridgeResourceMaker:` block forces
# ResolveClassPass to load the class regardless of dev/prod, which then
# crashes the prod container compile. Scope the qml_path injection to
# `when@dev:` so prod builds never touch these definitions.
when@dev:
services:
PhpQml\Bridge\Maker\BridgeResourceMaker:
arguments:
$qmlPath: '%bridge.qml_path%'
PhpQml\Bridge\Maker\BridgeWindowMaker: PhpQml\Bridge\Maker\BridgeWindowMaker:
arguments: arguments:
$qmlPath: '%bridge.qml_path%' $qmlPath: '%bridge.qml_path%'