[2026-10-15] eagle: personal/projects/balda/balda.md personal/projects/balda/execution-broker.md personal/projects/balda/setup.md work/projects/vscode-migration/tech-design-xcode-build-server.md work/projects/vscode-migration/xcode-build-server.md
This commit is contained in:
1 parent
ed60df36f8
commit
a364f53bbb
5 files changed
+13
-10
No files matched your search
@@ -16,21 +16,21 @@
|
||||
- an unclear number of users and an unclear owner.
|
||||
- The Swift language server (sourcekit-lsp) can get build information from a *build server* instead of a Swift package. [sourcekit-xcode-bsp](https://github.com/slime-studio/sourcekit-xcode-bsp) is an open-source build server that reads `.xcodeproj` / `.xcworkspace` with swift-build, the build engine Apple open-sourced from Xcode.
|
||||
- **Requirements:**
|
||||
- No change to the Xcode projects, schemes, CI or release, and nothing changes for people who only use Xcode.
|
||||
- No change to the Xcode projects, schemes, CI or release, and **nothing changes** for people who only use Xcode.
|
||||
- Opt-in and easy to remove.
|
||||
- macOS and iOS, including tests and packages.
|
||||
- **macOS and iOS**, including tests and packages.
|
||||
- People who use both Xcode and VS Code don't build or index everything twice.
|
||||
|
||||
## Problem Statement
|
||||
|
||||
Code intelligence and debugging in VS Code and Cursor need build information that today only Xcode has. We want to provide it from the Xcode projects as they are, without restructuring the codebase around it.
|
||||
Code autocompletion, jump-to-definition and debugging in VS Code and Cursor need build information that today only Xcode has. We want to provide it from the Xcode projects as they are, without restructuring the codebase around it.
|
||||
|
||||
## Recommended Approach
|
||||
|
||||
Add an opt-in VS Code setup to the repository: a workspace file and a few scripts in `scripts/vscode/`. Nothing else in the repository changes.
|
||||
|
||||
**What a developer gets**
|
||||
- Completion, jump to definition, references and live errors for app, test and package code, on macOS or iOS. One platform is chosen per worktree and can be switched.
|
||||
- Completion, jump-to-definition, references and live errors for app, test and package code, on macOS or iOS. One platform is chosen per worktree and can be switched.
|
||||
- Tasks to build any scheme and run unit tests; errors and failed tests show in the Problems panel.
|
||||
- Debugging with breakpoints:
|
||||
- the macOS app, launched from the editor;
|
||||
|
||||
@@ -39,6 +39,7 @@ An alternative to the [[projects/vscode-migration/tech-design-spm-browser-packag
|
||||
8. **Index shared with Xcode works:** with Xcode's DerivedData layout (index store = `Index.noindex/DataStore`, `INDEX_REGULAR_BUILD_*` = `Build/…`), units written by an xcodebuild build count as up to date: after building `macOS Browser`, indexing skipped all app files (2,150 files left vs 3,972). BSP prepares in `Index.noindex/SourceKitBuild` so it never shares a build DB with an open Xcode.
|
||||
9. **Xcode-compatible builds:** `xcodebuild` without `-derivedDataPath` and the wrapper don't rebuild after each other (no-op 26–31 s). With `-derivedDataPath` pointing to the same folder they do.
|
||||
10. **iOS simulator:** generic destination fails (`fix_libswiftWebkit_simulator.sh` needs `TARGET_DEVICE_OS_VERSION`) → build for a concrete simulator. Debugging: `simctl launch --wait-for-debugger` + lldb-dap attach by **pid** works (breakpoint in `AppDelegate`). lldb-dap with `attachCommands` or with `program` + pid never stops at breakpoints (CLI lldb does) → launch config uses `${command:pickProcess}` (newest first). VS Code substitutes variables before `preLaunchTask`, so run the task first.
|
||||
10a. **Gray breakpoints in VS Code (macOS app):** the launch configs had `sourceMap` `/^wt → worktree` for all builds. lldb also applies it in reverse when setting breakpoints, so `<worktree>/…/File.swift` became `/^wt/…/File.swift`, which regular (Xcode-mode) debug info doesn't contain → "no locations". Fix: no `sourceMap`; `xcodebuild.sh` writes `.build/debug.lldbinit` per build (source map only for `DDG_WORKTREE_CACHE=1`), launch configs `command source` it in `initCommands`. Confirmed fixed in VS Code 2026-10-15.
|
||||
11. Index sharing between worktrees: rejected (absolute paths + mtime-based staleness).
|
||||
12. `workspace/_pollIndex` isn't in release sourcekit-lsp → indexer waits for "Indexing" progress end + 60 s quiet; gives up after 5 min without progress.
|
||||
13. swift-build service runs in its own process group → stop children first.
|
||||
|
||||
Reference in new issue
Block a user