reload: skip the app's separate Swift module emission

Merged
TE
2mo ago
+22-0

Summary

  • scripts/reload.sh builds the app target with the standalone Swift driver and -no-emit-module-separately, so no separate emit-module job type-checks every app declaration on each edit. Packages, the CLI, and extensions keep their settings (the overrides are keyed on $(TARGET_NAME)).
  • The app's Debug configuration generates no Objective-C interface header. Nothing includes it: the app has no Objective-C that imports Swift.
  • Nothing imports the app's Swift module except cmuxTests (@testable import), which reload never builds. Test builds go through test-unit.sh and CI scripts, which are unchanged.
  • CMUX_RELOAD_APP_EMIT_MODULE=1 restores the old behavior.

This is the change #14364 made for cmuxTests (test edit 31 s to 4 s), applied to the app for dev reloads.

Numbers

Edit-loop benchmark (scripts/ci/app-edit-loop-benchmark.py on perf/app-edit-loop), Blacksmith 12-vCPU, Xcode 26.6, reload.sh incremental:

editemit module (today)this PR
comment in an app view37.9 s25.1 s
string literal in a function body39.9 s26.9 s
new fileprivate / internal top-level decl40.1 / 40.5 s29.1 / 29.6 s
new method on a hot type (508 files)65.9 s65.5 s
package body edit20.5 s20.5 s

The first reload after this lands rebuilds once because the Swift flags changed (about 4 min on that runner).

Testing

๐Ÿค– Generated with Claude Code


Summary by cubic

Makes scripts/reload.sh skip the app's separate Swift module emission during dev reloads, so incremental app edits rebuild faster. The app target now uses the standalone Swift driver with -no-emit-module-separately; packages, the CLI, and extensions keep their existing settings. Nothing imports the app's Swift module except cmuxTests (via @testable import), which reload never builds, and the app's Debug configuration now generates no Objective-C interface header since nothing includes it. Set CMUX_RELOAD_APP_EMIT_MODULE=1 to restore the previous behavior.

Benchmarks (12-vCPU runner, Xcode 26.6, incremental reload):

  • Comment in an app view: 37.9 s โ†’ 25.1 s; string literal in function body: 39.9 s โ†’ 26.9 s; new top-level decl: 40.1/40.5 s โ†’ 29.1/29.6 s.
  • New method on a hot type (508 files) and package body edits are unchanged.
  • The first reload after landing triggers one rebuild (~4 min) because the Swift flags changed.
  • lldb's po/expr in app frames need the module; set CMUX_RELOAD_APP_EMIT_MODULE=1 to get expression evaluation back.