Skip to content

Commit

Permalink
[Hold] bump rules_swift latest rev of IWBV2
Browse files Browse the repository at this point in the history
Now it works without worker.

- Add the updated flag for IWBV2
- Remove index-import as it's now baked in

Note: please hold until the PR at rules_swift merges
bazelbuild/rules_swift#567
  • Loading branch information
jerrymarino committed Jun 2, 2021
1 parent bb19379 commit 20148fe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 44 deletions.
5 changes: 3 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.1.0
6 changes: 3 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# 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",
srcs = ["@buildifier.mac//file"],
)

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,
},
)
2 changes: 1 addition & 1 deletion rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
39 changes: 2 additions & 37 deletions rules/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def rules_ios_dependencies():
_maybe(
github_repo,
name = "build_bazel_rules_swift",
ref = "14d26dcedf0290bd777f6fe83cde3586dc616513",
ref = "542a8bd2d70bb7b6a844a8602636e235e8343406",
project = "bazel-ios",
repo = "rules_swift",
sha256 = "8d87afbb43fa4f12ffd02c639bbc5a80eda0141bfaf74e4028d8f570d25d032c",
sha256 = "ce1ba86de697b74380b0735ea623757150a74f99adcdd6af7deeb0083ce00d62",
)

_maybe(
Expand All @@ -74,41 +74,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",
Expand Down

0 comments on commit 20148fe

Please sign in to comment.