Skip to content

Conversation

cachemeifyoucan
Copy link
Contributor

Adjust the rule for how bridging header chaining is performed to increase compatibilities with existing project configuration.

Previously in #84442, bridging header chaining was done via content concatenation, rather than #include via absolute path, to enable prefix mapping to drop references to absolute path. This triggers an incompatibility since the directory of the header file is also considered as part of the search path when resolve the include directives in the file. Simple concatenation will result in some #include can no longer be resolved.

Now relax the rule to do header content concatenation only when prefix map is used. This will keep the breakage minimal, and the breakage can always be fixed by additional include paths when turning on prefix mapping.

In the future, we should move towards internal bridging header implementation to avoid the need of chaining completely.

rdar://161854282

Adjust the rule for how bridging header chaining is performed to
increase compatibilities with existing project configuration.

Previously in swiftlang#84442, bridging header chaining was done via content
concatenation, rather than `#include` via absolute path, to enable prefix
mapping to drop references to absolute path. This triggers an
incompatibility since the directory of the header file is also
considered as part of the search path when resolve the include
directives in the file. Simple concatenation will result in some
`#include` can no longer be resolved.

Now relax the rule to do header content concatenation only when prefix
map is used. This will keep the breakage minimal, and the breakage can
always be fixed by additional include paths when turning on prefix
mapping.

In the future, we should move towards internal bridging header
implementation to avoid the need of chaining completely.

rdar://161854282
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan cachemeifyoucan merged commit 79ffee8 into swiftlang:main Oct 6, 2025
3 checks passed
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