Capture macro expansions in an output group named macro_expansions
during debug builds
#1355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
LLDB wants these files to be present on the file system to step into macro expansions, because their file paths are recorded in debug info. The compiler uses
TMPDIR
(if set) as the location for those files, so we can have the worker setTMPDIR
to a target-specific location before spawningswiftc
. If this location is workspace-relative, then those file paths are also remapped via-debug-prefix-map
—an added bonus.The
macro_expansions
group will contain a tree (directory) artifact that contains aswift-generated-sources
subdirectory (the compiler forces that name), which contains one or more.swift
files representing the expanded macro buffers.PiperOrigin-RevId: 549932429
(cherry picked from commit 69349ee)
Cherry-pick notes: We already included most of this in c9d1f5f. This just restricts
_macro_expansion_configurator
to debug builds.