rules_xcodeproj icon indicating copy to clipboard operation
rules_xcodeproj copied to clipboard

Support index-while-building when building with Bazel

Open brentleyjones opened this issue 3 years ago • 3 comments

When using the swift.index_while_building feature, Bazel will produce index stores while building. We should enable that feature by default in _xcodeproj_transition (though once we have multiple configs, we should only enable it for build, not index) and:

  • Add the outputs to the build output group
  • Use index-import to copy the index files into Xcode's index store
    • We will want to use -import-output-file to only copy over what's needed for each library
    • Though if using swift.use_global_index_store, the per-library index store should already be only what's needed? If so, we could pass that feature as well/instead
    • If we do this based on the need to run stubs/swiftc.py, then we can reduce the amount of copying further, as stubs/swiftc.py will only run when something has changed

brentleyjones avatar May 04 '22 21:05 brentleyjones

With Hybrid BwX, and eventually Focused Projects, the need for this is going up.

brentleyjones avatar Jun 28 '22 12:06 brentleyjones

Non-swift targets will probably need https://github.com/bazelbuild/bazel/issues/15983.

brentleyjones avatar Jul 26 '22 20:07 brentleyjones

Without this there is no indexing data for unfocused targets. Even with that, I'm removing it as a blocker for 0.7.0, as there are performance considerations I want to deeply investigate, including being able to remove index-while-building from the Index Build and SwiftUI Previews builds.

brentleyjones avatar Aug 05 '22 13:08 brentleyjones

https://github.com/buildbuddy-io/rules_xcodeproj/issues/1060

brentleyjones avatar Sep 14 '22 19:09 brentleyjones

#1040 resolved this.

brentleyjones avatar Sep 14 '22 19:09 brentleyjones