Running & Testing
● Copy .app or .xctest to Xcode DerivedData (ie "bazel-out")
● Xcode does the rest, which helps preserves many IDE features
Slide 53
Slide 53 text
More to Integrating bazel in Xcode
● Installing apps and tests
● Appease the Xcode build, by copying build artifacts
● Supporting the IDE by importing build outputs
● Generating debugger settings
Slide 54
Slide 54 text
Basically, an ad-hoc,
informally specified,
installer
Slide 55
Slide 55 text
Hyrum's Law
"With a sufficient number of users of an API,
it does not matter what you promise in the contract:
all observable behaviors of your system
will be depended on by somebody."
- Hyrum Wright, Googler
Indexing Facts of Life
● Backbone of important IDE features
● Common developer slowdown
● Usually proprietary
● Out of band
Slide 61
Slide 61 text
Indexing Integration
● swiftc & clang can produce indexes while building
● Indexes embed some absolute paths
● swiftc & clang and their component libraries are open source
● index-import: Purpose built tool for installing indexes into Xcode
● https://github.com/lyft/index-import
Slide 62
Slide 62 text
Debugging
Slide 63
Slide 63 text
Debugging, with lldb
● Paths have been at the core of every challenge
● Source paths, binary paths, absolute paths, relative paths, project paths, build
paths
● Fix by removing paths, or making them relative
Slide 64
Slide 64 text
Debugging, with lldb
● Compiler flags, with the help of Bazel wrapped clang, rules_swift worker
● Linking locally to ensure the binary has local paths
● Empty swift module, locally compiled and bearing embedded debugging options
● Generating lldb settings and wiring them into developer's global settings
Slide 65
Slide 65 text
Finally, everything
works
Slide 66
Slide 66 text
Stepping Back
Slide 67
Slide 67 text
Stepping Back
1. Build with Bazel
2. Customizable project generation
3. Taken the build away from Xcode
Slide 68
Slide 68 text
Focused Subprojects
Slide 69
Slide 69 text
Pick any targets,
dependencies not
required
Slide 70
Slide 70 text
Focused Subprojects
● Generating projects is faster
● Launching Xcode and time to usability is faster
● Provide natural scopes for teams/projects
● Performance scales by developer scope, not repo
Slide 71
Slide 71 text
IDE Finer Details
Slide 72
Slide 72 text
IDE Finer Details
● Native Xcode test experience
● Augmented project search
● Compiler fixits
● Full index, not focused index
● Refactoring
● Remote cache!
Slide 73
Slide 73 text
Unresolved
Slide 74
Slide 74 text
Unresolved
● Progress bar is useless, build log looks different
● No background indexing
● bazel×swiftc parallelism mismatch
● Code coverage features don't work