Skip to content

Fix includes attribute resolution in apple_static_xcframework_import#2869

Open
olbapmar wants to merge 1 commit intobazelbuild:mainfrom
olbapmar:includes_static_framework_import
Open

Fix includes attribute resolution in apple_static_xcframework_import#2869
olbapmar wants to merge 1 commit intobazelbuild:mainfrom
olbapmar:includes_static_framework_import

Conversation

@olbapmar
Copy link

@olbapmar olbapmar commented Jan 22, 2026

The documentation states that the includes attribute paths are interpreted relative to the single platform directory inside the XCFramework. However, the previous implementation simply concatenated user-specified includes with The xcframework library includes, without properly resolving them relative to the platform directory.

This change fixes the path resolution for the includes attribute:

  • For library-style XCFrameworks: the binary is directly in the platform directory, so includes are resolved relative to binary.dirname.
  • For framework-style XCFrameworks: the binary is inside the .framework bundle, so we go up one level (using binary.dirname's dirname) to reach the platform directory before joining with the user-specified include path.

This pull request also adds tests verifying the right behavior of include paths handling.

@olbapmar olbapmar force-pushed the includes_static_framework_import branch from 714bd9b to fad30c9 Compare January 22, 2026 16:33
The documentation states that the `includes` attribute paths are interpreted
relative to the single platform directory inside the XCFramework. However, the
previous implementation simply concatenated user-specified includes with The
xcframework library includes, without properly resolving them relative to the
platform directory.

This change fixes the path resolution for the `includes` attribute:

- For library-style XCFrameworks: the binary is directly in the platform
directory, so includes are resolved relative to binary.dirname.
- For framework-style XCFrameworks: the binary is inside the .framework bundle,
so we go up one level (using binary.dirname's dirname) to reach the platform
directory before joining with the user-specified include path.
@olbapmar olbapmar force-pushed the includes_static_framework_import branch from fad30c9 to a948995 Compare January 22, 2026 16:35
@olbapmar olbapmar marked this pull request as ready for review January 23, 2026 09:10
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.

1 participant