Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass compilation context via swift info in hmap creation due to rules_swift 2.1.1 #906

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions rules/hmap.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,28 @@ def _make_headermap_impl(ctx):
namespace = ctx.attr.namespace,
hdrs_lists = hdrs_lists,
)

compilation_context = cc_common.create_compilation_context(
headers = depset([headermap]),
)
cc_info_provider = CcInfo(
compilation_context = cc_common.create_compilation_context(
headers = depset([headermap]),
),
compilation_context = compilation_context,
)
swift_info_provider = swift_common.create_swift_info(
modules = [swift_common.create_module(
name = ctx.attr.name,
clang = swift_common.create_clang_module(
compilation_context = compilation_context,
module_map = None,
),
)],
)

providers = [
DefaultInfo(
files = depset([headermap]),
),
apple_common.new_objc_provider(),
cc_info_provider,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is cc_info_provider still necessary for rules_swift 1.18.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.18 def. need it
not sure about 2.1.1, so far it seems that the logic depends on it if it is not a swift file to compile?
based on the commit i think it is apple_common.new_objc_provider() we will remove soon as latest bazel don't have Objc provider under apple_common anymore: https://bazel.build/rules/lib/toplevel/apple_common (7.3 still has it)

swift_common.create_swift_info(),
swift_info_provider,
]

hdrs_lists = [l for l in hdrs_lists if l]
Expand Down
Loading