Absolute paths in `.swiftsourceinfo`

I know folks here have dedicated considerable effort to enhancing the cacheability of Swift build artifacts, which is very import for us and others using build systems like Bazel. Truly appreciated it!!

During a recent investigation, we discovered that the .swiftsourceinfo file still contains absolute file paths, which are hardcoded. We've learned that this file is used for diagnostics and indexing. To address this issue, we've developed a tool to remap remote paths to local paths. Without this tool, the local development experience is impacted.

Since .swiftsourceinfo is considered an implementation detail of the compiler, documentation on its usage is limited. Therefore, I have two questions:

  • How are .swiftsourceinfo files used? Apart from diagnostics and indexing, are they used in other contexts, such as lldb?
  • How challenging would it be to make .swiftsourceinfo also respect the -file-prefix-map flag? I assume this would require modifications wherever this file is consumed, which relates to the first question.

Thanks!

1 Like