mob.new: glob mob ios/*.swift in generated iOS build.zig#16
Merged
Conversation
The generated iOS build.zig / build_device.zig hardcoded the mob Swift source list (MobViewModel/MobRootView/MobGpuView). When mob adds a new Swift file, generated apps that don't list it fail with "cannot find '<Type>' in scope" (+ cascading onChange errors) — exactly the break that hit master iOS builds. Glob $mob_dir/ios/*.swift at build time (b.build_root.handle.openDir + iterate) so new mob Swift sources compile without a template edit. Mirrors mob_dev's release-path glob. Verified the generated build.zig compiles under zig 0.16 and the glob enumerates the .swift files. Adds a generator test asserting the glob (and that the hardcoded list is gone) for both sim + device templates. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build.zig/build_device.zighardcoded the mob Swift source list (MobViewModel/MobRootView/MobGpuView). Whenmobadds a new Swift file, generated apps that don't list it fail withcannot find '<Type>' in scope(+ cascadingonChangeerrors) — the exact break that hit master iOS builds whenMobGpuView.swiftlanded.$mob_dir/ios/*.swiftat build time (b.build_root.handle.openDir(io, …)+ iterate, threadingb.graph.ioper zig 0.16's I/O API) so a newly-added mob Swift source compiles without a template edit. Mirrors the mob_dev release-path glob (mob_dev PR feat(background): iOS + Android background task templates #13).Verification
build.zigwithzig build(zig 0.16): the full file compiles (reachesbuild()'s runtime option checks) and the glob enumerates the real.swiftfiles.MobGpuView.swiftline is gone) for both sim + device templates.Note: two
project_generator_testfailures (--localpaths,--pythonend-to-end) are pre-existing — they fail on the unmodified base too, from the documented worktree path-resolver caveat.🤖 Generated with Claude Code