Skip to content

Commit d8cc3ea

Browse files
DavidGoldmanbrentleyjones
authored andcommitted
Don't use an absolute path for index unit names
After recent IndexStoreDB changes, relative paths are supported using the explicit unit list. PiperOrigin-RevId: 486725675 (cherry picked from commit 5b728e6) Signed-off-by: Brentley Jones <[email protected]>
1 parent b94f378 commit d8cc3ea

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

swift/internal/compiling.bzl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ def _precompile_clang_module(
10061006
"{}.swift.pcm.indexstore".format(target_name),
10071007
)
10081008
outputs.append(indexstore_directory)
1009-
index_unit_output_path = _index_unit_output_path(precompiled_module)
1009+
index_unit_output_path = precompiled_module.path
10101010
else:
10111011
indexstore_directory = None
10121012
index_unit_output_path = None
@@ -1409,14 +1409,6 @@ def _intermediate_frontend_file_path(target_name, src):
14091409

14101410
return paths.join(objs_dir, paths.dirname(owner_rel_path)), safe_name
14111411

1412-
def _index_unit_output_path(output_file):
1413-
"""Returns the hermetic index unit output path for indexing.
1414-
1415-
We use an absolute path since IndexStoreDB can't properly handle relative
1416-
paths.
1417-
"""
1418-
return "/BAZEL_EXECUTION_ROOT/{}".format(output_file.path)
1419-
14201412
def _declare_per_source_ast_file(*, actions, target_name, src):
14211413
"""Declares a file for an ast file during compilation.
14221414
@@ -1600,7 +1592,7 @@ def _declare_multiple_outputs_and_write_output_file_map(
16001592
src_output_map["object"] = obj.path
16011593

16021594
if include_index_unit_paths:
1603-
src_output_map["index-unit-output-path"] = _index_unit_output_path(obj)
1595+
src_output_map["index-unit-output-path"] = obj.path
16041596

16051597
ast = _declare_per_source_ast_file(
16061598
actions = actions,

0 commit comments

Comments
 (0)