Skip to content

Commit

Permalink
Address yet more feedback
Browse files Browse the repository at this point in the history
* deleted explicit modules examples + tests until it can be
  reimplemented for aspect_hints
* reworked suppress_hint tests around `//swift:no_module`
* added docs for Bazel 6 and `--experimental_enable_aspect_hints`
  • Loading branch information
aaronsky authored and brentleyjones committed Apr 5, 2024
1 parent 57d25f1 commit b40d59a
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 179 deletions.
5 changes: 5 additions & 0 deletions doc/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ swift_interop_hint(<a href="#swift_interop_hint-name">name</a>, <a href="#swift_
Defines an aspect hint that associates non-Swift BUILD targets with additional
information required for them to be imported by Swift.

> [!NOTE]
> Bazel 6 users must set the `--experimental_enable_aspect_hints` flag to utilize
> this rule. In addition, downstream consumers of rules that utilize this rule
> must also set the flag. The flag is enabled by default in Bazel 7.
Some build rules, such as `objc_library`, support interoperability with Swift
simply by depending on them; a module map is generated automatically. This is
for convenience, because the common case is that most `objc_library` targets
Expand Down
18 changes: 0 additions & 18 deletions examples/apple/swift_explicit_modules/BUILD

This file was deleted.

1 change: 0 additions & 1 deletion examples/apple/swift_explicit_modules/main.swift

This file was deleted.

5 changes: 5 additions & 0 deletions swift/internal/swift_interop_hint.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ generate.
Defines an aspect hint that associates non-Swift BUILD targets with additional
information required for them to be imported by Swift.
> [!NOTE]
> Bazel 6 users must set the `--experimental_enable_aspect_hints` flag to utilize
> this rule. In addition, downstream consumers of rules that utilize this rule
> must also set the flag. The flag is enabled by default in Bazel 7.
Some build rules, such as `objc_library`, support interoperability with Swift
simply by depending on them; a module map is generated automatically. This is
for convenience, because the common case is that most `objc_library` targets
Expand Down
5 changes: 1 addition & 4 deletions test/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(":ast_file_tests.bzl", "ast_file_test_suite")
load(":bzl_test.bzl", "bzl_test")
load(":cc_library_tests.bzl", "cc_library_test_suite")
load(":compiler_arguments_tests.bzl", "compiler_arguments_test_suite")
load(":coverage_settings_tests.bzl", "coverage_settings_test_suite")
load(":cc_library_tests.bzl", "cc_library_test_suite")
load(":debug_settings_tests.bzl", "debug_settings_test_suite")
load(":explicit_modules_test.bzl", "explicit_modules_test_suite")
load(":features_tests.bzl", "features_test_suite")
load(":generated_header_tests.bzl", "generated_header_test_suite")
load(":imported_framework_tests.bzl", "imported_framework_test_suite")
Expand Down Expand Up @@ -60,8 +59,6 @@ pch_output_dir_test_suite(name = "pch_output_dir_settings")

private_swiftinterface_test_suite(name = "private_swiftinterface")

explicit_modules_test_suite(name = "explicit_modules")

xctest_runner_test_suite(name = "xctest_runner")

utils_test_suite(name = "utils")
Expand Down
105 changes: 0 additions & 105 deletions test/explicit_modules_test.bzl

This file was deleted.

42 changes: 0 additions & 42 deletions test/fixtures/explicit_modules/BUILD

This file was deleted.

1 change: 0 additions & 1 deletion test/fixtures/explicit_modules/Empty.swift

This file was deleted.

10 changes: 2 additions & 8 deletions test/fixtures/interop_hints/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ forward_swift_info_from_swift_clang_module_aspect(
objc_library(
name = "objc_library_suppressed_lib",
hdrs = ["header1.h"],
aspect_hints = [":suppress_hint"],
aspect_hints = ["//swift:no_module"],
tags = FIXTURE_TAGS,
target_compatible_with = ["@platforms//os:macos"],
)
Expand All @@ -110,7 +110,7 @@ forward_swift_info_from_swift_clang_module_aspect(
objc_library(
name = "objc_library_with_swift_dep_suppressed_lib",
hdrs = ["header1.h"],
aspect_hints = [":suppress_hint"],
aspect_hints = ["//swift:no_module"],
tags = FIXTURE_TAGS,
target_compatible_with = ["@platforms//os:macos"],
deps = [":empty_lib"],
Expand All @@ -121,9 +121,3 @@ swift_library(
srcs = ["Empty.swift"],
tags = FIXTURE_TAGS,
)

swift_interop_hint(
name = "suppress_hint",
suppressed = True,
tags = FIXTURE_TAGS,
)

0 comments on commit b40d59a

Please sign in to comment.