From c94265cd1f1b041dd8cdb06ebc6a70d6eb75a541 Mon Sep 17 00:00:00 2001 From: "i@jerrmarino.com" Date: Wed, 2 Jun 2021 14:00:32 -0700 Subject: [PATCH 1/2] Bump rules_swift to HEAD Now it works without worker. - Add the updated flag for IWBV2 - Remove index-import as it's now baked in This drops the fork of rules_swift --- .bazelrc | 5 +++-- .bazelversion | 2 +- BUILD.bazel | 6 +++--- rules/library.bzl | 2 +- rules/repositories.bzl | 42 +++--------------------------------------- 5 files changed, 11 insertions(+), 46 deletions(-) diff --git a/.bazelrc b/.bazelrc index afd4041ce..224f63e50 100644 --- a/.bazelrc +++ b/.bazelrc @@ -25,9 +25,10 @@ build --compilation_mode=dbg # Use 'worker' strategy for swift compilation build --strategy=SwiftCompile=worker -# This flips index_while_building_v2 - see docs/index_while_building.md for a +# This flips enable_global_index_store - see docs/index_while_building.md for a # detailed summary -build --features swift.index_while_building_v2 +build --features swift.use_global_index_store +build --features swift.index_while_building # Prevents leaking unexpected binaries via PATH to tests build --test_env=PATH=/usr/bin:/bin:/usr/sbin:/sbin diff --git a/.bazelversion b/.bazelversion index fcdb2e109..ee74734aa 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -4.0.0 +4.1.0 diff --git a/BUILD.bazel b/BUILD.bazel index ef1ec1ca8..5bd52c6a7 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,6 +1,6 @@ # Pull buildifer.mac as an http_file, then depend on the file group to make an # executable -load("@build_bazel_rules_swift//swift/internal:feature_names.bzl", "SWIFT_FEATURE_INDEX_WHILE_BUILDING_V2") +load("@build_bazel_rules_swift//swift/internal:feature_names.bzl", "SWIFT_FEATURE_USE_GLOBAL_INDEX_STORE") sh_binary( name = "buildifier", @@ -8,8 +8,8 @@ sh_binary( ) config_setting( - name = "index_while_building_v2", + name = "use_global_index_store", values = { - "features": SWIFT_FEATURE_INDEX_WHILE_BUILDING_V2, + "features": SWIFT_FEATURE_USE_GLOBAL_INDEX_STORE, }, ) diff --git a/rules/library.bzl b/rules/library.bzl index 823f3e0cd..d8b559892 100644 --- a/rules/library.bzl +++ b/rules/library.bzl @@ -678,7 +678,7 @@ def apple_library(name, library_tools = {}, export_private_headers = True, names additional_objc_copts.append("-I.") index_while_building_objc_copts = select({ - "@build_bazel_rules_ios//:index_while_building_v2": [ + "@build_bazel_rules_ios//:use_global_index_store": [ # Note: this won't work work for remote caching yet. It uses a # _different_ global index for objc than so that the BEP grep in # rules_ios picks this up. diff --git a/rules/repositories.bzl b/rules/repositories.bzl index 72daae83c..57c927437 100644 --- a/rules/repositories.bzl +++ b/rules/repositories.bzl @@ -53,15 +53,14 @@ def rules_ios_dependencies(): sha256 = "3bbbc0ffa8aad392bc9a5032bccc366edb96723544dbdf89137d0223cf7350c1", ) - # Note: this ref is a cherry-pick of the rules_swift PR - # https://github.com/bazelbuild/rules_swift/pull/567 + _maybe( github_repo, name = "build_bazel_rules_swift", - ref = "14d26dcedf0290bd777f6fe83cde3586dc616513", + ref = "914eff948be54cbcde847ae800a2e373e61a5c56", project = "bazel-ios", repo = "rules_swift", - sha256 = "8d87afbb43fa4f12ffd02c639bbc5a80eda0141bfaf74e4028d8f570d25d032c", + sha256 = "bd887edcc1a0a1bc2fab878a1902160b48be71ea4c298b38b978016e278a3430", ) _maybe( @@ -74,41 +73,6 @@ def rules_ios_dependencies(): sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", ) - # Note: it relies on `index-import` to import indexes. Longer term this - # dependency may be added by rules_swift - # This release is a build of this PR https://github.com/lyft/index-import/pull/53 - _maybe( - http_archive, - name = "build_bazel_rules_swift_index_import", - build_file_content = """\ -load("@bazel_skylib//rules:native_binary.bzl", "native_binary") - -native_binary( - name = "index_import", - src = "index-import", - out = "index-import", - visibility = ["//visibility:public"], -) - -native_binary( - name = "validate_index", - src = "validate-index", - out = "validate-index", - visibility = ["//visibility:public"], -) - -native_binary( - name = "absolute_unit", - src = "absolute-unit", - out = "absolute-unit", - visibility = ["//visibility:public"], -) -""", - canonical_id = "index-import-5.3.2.5", - urls = ["https://github.com/bazel-ios/index-import/releases/download/5.3.2.5/index-import.zip"], - sha256 = "79e9b2cd3e988155b86668c56d95705e1a4a7c7b6d702ff5ded3a18d1291a39a", - ) - _maybe( http_archive, name = "com_github_yonaskolb_xcodegen", From 4d8cc55693551cf496b612b2bed856d678adc6ea Mon Sep 17 00:00:00 2001 From: "i@jerrmarino.com" Date: Wed, 9 Jun 2021 11:06:04 -0700 Subject: [PATCH 2/2] Buildifier --- rules/repositories.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/rules/repositories.bzl b/rules/repositories.bzl index 57c927437..2a45d270e 100644 --- a/rules/repositories.bzl +++ b/rules/repositories.bzl @@ -53,7 +53,6 @@ def rules_ios_dependencies(): sha256 = "3bbbc0ffa8aad392bc9a5032bccc366edb96723544dbdf89137d0223cf7350c1", ) - _maybe( github_repo, name = "build_bazel_rules_swift",