Web build pipeline fixes for #148 - #178
Conversation
Fixes found while integrating the web build into a downstream consumer: - valdi_compiled.bzl: declare web output flavor from the compiler's web_output_target (release only when android+ios targets are release and the build isn't forced to debug) instead of output_flavor alone, so debug-target modules (e.g. jasmine) no longer mis-declare web/release outputs the compiler never writes. - CollapseWebPaths.cpp: recursively collect module res directories and break out of the per-dir image scan so transitively-staged res dirs still register (previously blank icons at runtime). - valdi_collapse_web_paths.bzl: skip non-web source files in the native pass so paths that would escape the -o output tree no longer fail under a strict sandbox; keep real module names for compiler-generated web/<flavor>/res. - web_path_browserify_shim.js.tpl: preserve leading ".." segments when normalizing relative paths. - web_webpack.config.js.tpl + web_bytes_loader.js.tpl + wiring: replace the non-existent 'asset/bytes' module type with a custom loader that emits .bin/.protodecl resources as Uint8Array. - HotReloadLifecycleReporter.swift: serialize lifecycle writes with an NSLock so concurrent lines from different queues are not interleaved. - docs + skill: clarify that a custom-view binds via exactly one mechanism (viewFactory or a platform class), never both. Based on the web build branch.
Sensitive Files Detected🔧 Build rules — Affects build rules for all Valdi consumers. This is an automated notice. A maintainer will review after import. |
📊 PR Size: size/MTotal changes: 235 lines (12 files) Top files changed:
...and 2 more files Size calculated as additions + deletions. Labels: XS (<10), S (<50), M (<250), L (<1000), XL (1000+) |
|
| Test Suite | Result |
|---|---|
| Valdi Smoke Tests | ✅ success |
| API Surface Check | ✅ success |
| valdi_web Integration Test | ❌ failure |
| Linux: C++ Tests | ❌ failure |
| Snapshot Tests | ✅ success |
| Linux: Build & Export | ✅ success |
| Linux: Build Compiler | ✅ success |
| Test Coverage Delta | ❌ failure |
| macOS: C++ & Platform Tests | ❌ failure |
| Linux: Hotreload Smoke | ✅ success |
| Linux: Registry Validation | ✅ success |
| Linux: Module Tests | ✅ success |
Some tests failed. Please check the workflow logs for details.
🚀 Bazel remote cache is now enabled - future builds will be faster!
Workflow: Valdi CI
CI failure triageNone of the current failures are introduced by this PR. Comparing against the base branch's own most recent
Linux: C++ Tests is the only job that differs from base. It's a test-target timeout — the runtime unit-test binary hung on This PR's diff touches nothing linked into that binary:
So that binary is identical to base (which passed) — a timing-flaky timeout on this run, not a regression. A re-run of Linux: C++ Tests should go green. The three pre-existing failures are unrelated to these build-pipeline fixes and also fail on the base branch. |
|
Thanks for tracking these down. Several changes address real gaps in #148, but there are a few parts I would revise before merging. I reviewed all 12 changed files at Please preserve the external-repository path normalizationRemoving
The declaration-condition reversal also changes an in-repository Skipping declarations that don't belong in the native-copy pass can be handled separately. Please retain repository normalization in the package/native mapping and registration paths.
|
- Restore _repository_relative_short_path() and is_valdi_source_path in valdi_collapse_web_paths.bzl; removing them reversed 4684e76's external-repository packaging fix. Keep the _dest() web/<flavor>/res skip and the native-pass web-only skip over the repository-normalized path. - Revert the .bin/.protodecl webpack rule to the built-in `asset/bytes` type and drop the custom bytes loader. `asset/bytes` exists in webpack >= 5.104.1 (the version the Bazel web build resolves). - Restore the custom-view destroy() callback and `AttributeHandler | void` factory return type in native-customviews.md; keep the one-mechanism callout. - Revert the recursive image-registry scan in CollapseWebPaths.cpp to the non-recursive scan. The _dest() fix stages every transitive module's res at the canonical src/<module>/res, so the recursive traversal produced a byte-identical _image_registry.js. Keep the declaration import('...') rewrite and its test.
|
Thanks for the careful review — all four points addressed in a9f172c. External-repository path normalization — restored
Custom-view docs — kept the one-mechanism (viewFactory xor platform-class) clarification, and restored the Recursive image discovery — demonstrated it's unnecessary once placement is corrected, and reverted it. With the Verified the downstream web targets still build and both browser integration tests pass with |
scorsin-oai
left a comment
There was a problem hiding this comment.
I hereby approve of this PR
Fixes found while integrating #148's web build into a downstream consumer. Based on #148.
Fixes
web_output_target(valdi_compiled.bzl): a module emits/consumesweb/releaseonly when both the android and ios output targets are release and the build isn't forced to debug; otherwiseweb/debug. Keying offoutput_flavoralone mis-declaredweb/releaseoutputs for debug-target modules (e.g. jasmine) that the compiler only ever writes asweb/debug.resdirectories (CollapseWebPaths.cpp): recursively collect every moduleresdirectory andbreakout of the per-directory image scan so transitively-stagedresdirs are still registered. Previously only immediate children ofsrc/were scanned, so transitive-dependency images were bundled but never registered (blank icons at runtime).valdi_collapse_web_paths.bzl): source files with noweb/segment fall back to a raw path that would escape the-ooutput directory and fail under a strict sandbox; skip them (they are placed by the main collapse pass) and preserve real module names for compiler-generatedweb/<flavor>/res...in the path shim (web_path_browserify_shim.js.tpl): relative-path normalization no longer drops leading parent-directory segments.asset/bytes(web_webpack.config.js.tpl+ newweb_bytes_loader.js.tpl+ wiring invaldi_web_application.bzl/app_templates/BUILD.bazel): webpack has no built-in byte-array module type, so.bin/.protodeclresources are emitted asUint8Arrayvia a custom loader.HotReloadLifecycleReporter.swift): events are emitted from multiple queues; anNSLockserializes writes so concurrent lines are not interleaved.native-customviews.md, custom-view skill): a<custom-view>binds its native view via exactly one mechanism — aviewFactoryor a platform class name — never both.