swift icon indicating copy to clipboard operation
swift copied to clipboard

[ExplictModule] Bridgingheader chaining mode

Open cachemeifyoucan opened this issue 1 year ago • 3 comments

Add a new experimental flag for better bridging header handling from a binary module dependency. The new mode requries the users of such binary module to provide bridging header that chains the bridging header from the dependencies, otherwise it will result in an scanning error.

While this requires users of the module explicitly add bridging headers from the dependencies, it has the benefits:

  • Cheaper dependency scanning as bridging header will only need to be scanned once for all bridging headers discovered.
  • Avoid hard to understand header import errors when importing bridging headers.
  • Some compiler directives like #pragma once will function correctly only when bridging headers are chained together.
  • Easy to be supported in swift caching mode as swift-frontend will not import clang headers that lack complete dependencies.

cachemeifyoucan avatar Jul 11 '24 18:07 cachemeifyoucan

Alternatively, we can go one step further to generate the chained bridging header but I don't have a good model for how that should work between swift-driver and frontend.

cachemeifyoucan avatar Jul 11 '24 18:07 cachemeifyoucan

@swift-ci please test

cachemeifyoucan avatar Jul 11 '24 18:07 cachemeifyoucan

@swift-ci please smoke test

cachemeifyoucan avatar Jul 11 '24 19:07 cachemeifyoucan