diff --git a/xcodeproj/internal/bazel_integration_files/generate_index_build_bazel_dependencies.sh b/xcodeproj/internal/bazel_integration_files/generate_index_build_bazel_dependencies.sh index 4c67d3d4e..1939ed91f 100755 --- a/xcodeproj/internal/bazel_integration_files/generate_index_build_bazel_dependencies.sh +++ b/xcodeproj/internal/bazel_integration_files/generate_index_build_bazel_dependencies.sh @@ -10,11 +10,12 @@ readonly config="${BAZEL_CONFIG}_indexbuild" output_groups=( # Compile params "bc $BAZEL_TARGET_ID" - # Products (i.e. bundles) and index store data. The products themselves aren't - # used, they cause transitive files to be created. We use - # `--remote_download_regex` below to collect the files we care + # Indexstores and their filelist. Requesting indexstore directories triggers + # transitive Swift compilation (producing swiftmodules, indexstores, and + # generated headers) without linking, avoiding large product binaries. We use + # `--remote_download_regex` below to download the files we care # about. - "bp $BAZEL_TARGET_ID" + "bi $BAZEL_TARGET_ID" ) indexstores_filelists=() diff --git a/xcodeproj/internal/files/output_files.bzl b/xcodeproj/internal/files/output_files.bzl index 3b19c0f5a..1565701ee 100644 --- a/xcodeproj/internal/files/output_files.bzl +++ b/xcodeproj/internal/files/output_files.bzl @@ -262,8 +262,17 @@ def _collect_output_files( transitive = [transitive_products], ) + # Indexing output group: contains indexstores (to trigger Swift compilation) + # and the indexstores filelist (for import_indexstores). Unlike `bp`, this + # does not include linked products, avoiding large binary materialization. + indexing_depset = memory_efficient_depset( + [indexstores_filelist], + transitive = [transitive_indexstores], + ) + direct_group_list = [ ("bc {}".format(id), transitive_compile_params), + ("bi {}".format(id), indexing_depset), ("bl {}".format(id), transitive_link_params), (products_output_group_name, products_depset), ]