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-changescommand.Motivation:
Swift package manager's command
diagnose-api-breaking-changesis a wrapper on top ofswift-api-digester. Purpose ofswift-api-digesteris to detect API incompatible changes between two revisions of code.diagnose-api-breaking-changesmakes it more convenient to use with packages and does a few things under the hood:swift-api-digesterto compare current package to the baseline commitswift-api-digesterwith necessary build flags determined by toolchain, configuration and environment@PeterAdams-A reported in #8073 that
swift-api-digesterfailed to build a baseline commit for a specific package with vendored C library. This PR resolves the issue.Modifications:
Turns out,
diagnose-api-breaking-changeswas 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-digesterand do not impact other commands. I distilled the failing scenario to a test case and added it toAPIDifftests.Modifications:
includedir. When building current module then it typically works as-is, but when a module has non-standard source location, then explicit include ofincludeis necessary.diagnose-api-breaking-changescan check API compatibility for a package with non-default source location and include files.Result:
diagnose-api-breaking-changesdoesn't error out on such packages