Skip to content

Stop emitting .swiftsourceinfo if not explicitly requested - #1895

Merged
adincebic merged 1 commit into
mainfrom
adin/stop-emiting-swiftsourceinfo
Sep 9, 2026
Merged

Stop emitting .swiftsourceinfo if not explicitly requested#1895
adincebic merged 1 commit into
mainfrom
adin/stop-emiting-swiftsourceinfo

Conversation

@adincebic

@adincebic adincebic commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Up until this point the feature swift.emit_swiftsourceinfo was only controlling whether Bazel should track the file as its output. This meant that .swiftsourceinfo was produced but not tracked by Bazel. Now we make sure that swiftc does not produce .swiftsourceinfo if not explicitly requested.

I also deleted the code which made sure that .swiftsourceinfo was part of the incremental compilation since that is not true today.

The .swiftsourceinfo handling was originally added in PR #698 (#698) so Swift could skip the merge-module job. Source compilation was already being skipped, but module merging still had to run because the declared .swiftsourceinfo output was missing. At the time source info was always emitted, so keeping it around made sense.

Now that source info is optional, both cases are handled:

  • When enabled, .swiftsourceinfo is still declared, emitted, and preserved.
  • When disabled, we pass -avoid-emit-module-source-info and don't expect .swiftsourceinfo from the merge-module job, so that job can still be skipped.

This also lines up with what the Swift driver does:

Relevant Slack thread: https://bazelbuild.slack.com/archives/C096TL199U0/p1788956785964199

@adincebic
adincebic force-pushed the adin/stop-emiting-swiftsourceinfo branch from 810608f to 311176b Compare September 6, 2026 12:35
@adincebic
adincebic merged commit dd10a24 into main Sep 9, 2026
16 checks passed
@adincebic
adincebic deleted the adin/stop-emiting-swiftsourceinfo branch September 9, 2026 13:21
@adincebic

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants