Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions cc/private/compile/cc_compilation_helper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ _ModuleMapInfo = provider(
"module_map",
"public_headers",
"private_headers",
"public_textual_headers",
"dependency_module_maps",
"additional_exported_headers",
"separate_module_headers",
Expand Down Expand Up @@ -261,6 +262,12 @@ def _module_map_struct_to_module_map_content(parameters, tree_expander):
add_header(path = header.path, visibility = "", can_compile = False)
added_paths.add(header.path)

for header in parameters.public_textual_headers:
if header.path in added_paths:
continue
add_header(path = header.path, visibility = "", can_compile = False)
added_paths.add(header.path)

Copy link
Member Author

Choose a reason for hiding this comment

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

note that the core difference is below the paths are already strings, where here we are processing file objects in a context where their paths can be stripped by bazel

for path in parameters.additional_exported_headers:
if path in added_paths:
continue
Expand Down Expand Up @@ -303,6 +310,7 @@ def _create_module_map_action(
module_map,
private_headers,
public_headers,
public_textual_headers,
dependency_module_maps,
additional_exported_headers,
separate_module_headers,
Expand All @@ -316,13 +324,15 @@ def _create_module_map_action(
leading_periods = "" if module_map_home_is_cwd else "../" * segments_to_exec_path
public_headers = _cc_internal.freeze(public_headers)
private_headers = _cc_internal.freeze(private_headers)
public_textual_headers = _cc_internal.freeze(public_textual_headers)
dependency_module_maps = _cc_internal.freeze(dependency_module_maps)
additional_exported_headers = _cc_internal.freeze(additional_exported_headers)
separate_module_headers = _cc_internal.freeze(separate_module_headers)
data_struct = _ModuleMapInfo(
module_map = module_map,
public_headers = public_headers,
private_headers = private_headers,
public_textual_headers = public_textual_headers,
dependency_module_maps = dependency_module_maps,
additional_exported_headers = additional_exported_headers,
separate_module_headers = separate_module_headers,
Expand Down Expand Up @@ -499,6 +509,7 @@ def _init_cc_compilation_context(
actions = actions,
module_map = module_map,
public_headers = public_headers_for_module_map_action,
public_textual_headers = public_textual_headers,
separate_module_headers = separate_public_headers.module_map_headers,
dependency_module_maps = dependency_module_maps,
private_headers = private_headers_for_module_map_action,
Expand Down
3 changes: 1 addition & 2 deletions cc/private/compile/compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ def compile(
generate_pic_action = generate_pic_action,
generate_no_pic_action = generate_no_pic_action,
module_map = module_map,
additional_exported_headers =
additional_exported_hdrs + [h.path for h in textual_hdrs_list] if textual_hdrs_list else additional_exported_hdrs,
additional_exported_headers = additional_exported_hdrs,
deps = compilation_contexts,
implementation_deps = implementation_compilation_contexts,
additional_cpp_module_maps = additional_module_maps,
Expand Down