Skip to content

mob.new: glob mob ios/*.swift in generated iOS build.zig#16

Merged
GenericJam merged 1 commit into
masterfrom
swift-glob
May 27, 2026
Merged

mob.new: glob mob ios/*.swift in generated iOS build.zig#16
GenericJam merged 1 commit into
masterfrom
swift-glob

Conversation

@GenericJam
Copy link
Copy Markdown
Owner

Summary

  • 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) — the exact break that hit master iOS builds when MobGpuView.swift landed.
  • Fix: glob $mob_dir/ios/*.swift at build time (b.build_root.handle.openDir(io, …) + iterate, threading b.graph.io per 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

  • Built a generated build.zig with zig build (zig 0.16): the full file compiles (reaches build()'s runtime option checks) and the glob enumerates the real .swift files.
  • Generator test added asserting the glob (and that the hardcoded MobGpuView.swift line is gone) for both sim + device templates.

Note: two project_generator_test failures (--local paths, --python end-to-end) are pre-existing — they fail on the unmodified base too, from the documented worktree path-resolver caveat.

🤖 Generated with Claude Code

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>
@GenericJam GenericJam merged commit 1240d7e into master May 27, 2026
3 checks passed
@GenericJam GenericJam deleted the swift-glob branch May 27, 2026 15:40
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.

1 participant