Add include dir from a clang module into the build args in diagnose-api-breaking-changes
command.
#8209
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.
Fixes #8073: Update include paths for clang module in
diagnose-api-breaking-changes
command.Motivation:
Swift package manager's command
diagnose-api-breaking-changes
is a wrapper on top ofswift-api-digester
. Purpose ofswift-api-digester
is to detect API incompatible changes between two revisions of code.diagnose-api-breaking-changes
makes it more convenient to use with packages and does a few things under the hood:swift-api-digester
to compare current package to the baseline commitswift-api-digester
with necessary build flags determined by toolchain, configuration and environment@PeterAdams-A reported in #8073 that
swift-api-digester
failed to build a baseline commit for a specific package with vendored C library. This PR resolves the issue.Modifications:
Turns out,
diagnose-api-breaking-changes
was missing some include paths which were necessary for the package to be built. The PR corrects that and adds a new include path for CLang targets. The build arguments are used only byswift-api-digester
and do not impact other commands. I distilled the failing scenario to a test case and added it toAPIDiff
tests.Modifications:
include
dir. When building current module then it typically works as-is, but when a module has non-standard source location, then explicit include ofinclude
is necessary.diagnose-api-breaking-changes
can check API compatibility for a package with non-default source location and include files.Result:
diagnose-api-breaking-changes
doesn't error out on such packages