Skip to content

Commit

Permalink
Use relative paths in index stores built by clang
Browse files Browse the repository at this point in the history
Summary:
We added `remap_cwd` in D60678938 and enabled it for `minimal_xcode`.

However, for index stores, we always want to use relative paths, so use `remap_cwd` when building the index store.

This diff applies to clang. We made the equivalent change for swiftc in D67061257.

Reviewed By: milend

Differential Revision: D68236609

fbshipit-source-id: 9145b2e59981c6b4003d3a79ae995f09742eab4a
  • Loading branch information
Wilfred authored and facebook-github-bot committed Jan 16, 2025
1 parent ec45dd0 commit da7f4b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prelude/apple/apple_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ def _compile_index_store(ctx: AnalysisContext, src_compile_cmd: CxxSrcCompileCom
if src_compile_cmd.src.extension in AsmExtensions.values():
return None

cmd = compile_cmd.copy()
# Use remap_cwd.py to set -ffile-prefix-map, so we have paths relative to the
# working directory.
cmd = cmd_args(toolchain.internal_tools.remap_cwd)
cmd.add(compile_cmd)

# We use `-fsyntax-only` flag, so output will be not generated.
# The output here is used for the identifier of the index unit file
Expand Down

0 comments on commit da7f4b9

Please sign in to comment.