Xcode7-beta4 (7A165t): App fails to build with error: Include of non-modular header inside framework module 'ObjectiveGit'

Originator:benchatelain
Number:rdar://22044453 Date Originated:28-Jul-2015 08:22 PM
Status:Dup of 16346423 Resolved:
Product:Developer Tools Product Version:Xcode7-beta4 (7A165t)
Classification:Other Bug Reproducible:Always
 
Summary:
The ObjectiveGit (https://github.com/libgit2/objective-git) project builds frameworks for both Mac and iOS platforms. This framework is an interface for the libgit2 static library whose headers are exposed through the ObjectiveGit module, but inside libgit2, all #imports use the local project style:
#import “git2/filter.h

This works well enough for the ObjectiveGit frameworks to build. The problem manifests when building an app that links against ObjectiveGit.framework:

…ObjectiveGit.framework/Headers/git2/sys/filter.h:10:10: Include of non-modular header inside framework module 'ObjectiveGit'
#include "git2/filter.h"
         ^

These errors do not go away when the application sets CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES to YES, even after purging the ModuleCache, DerivedData, restarting Xcode and sacrificing a few gummy bears.

If this is to be an error, it should be an error in the framework build, not the application that is consuming it.

Steps to Reproduce:
1. Create a Mac or iOS application project using Swift
2. Add ObjectiveGit.framework to the project (linker and embed frameworks phase)
3. import ObjectiveGit in at least one swift file
4. Set CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES to YES in the app target
5. Build the app target

Expected Results:
The app target build will succeed.

Actual Results:
The app target build fails with numerous messages like the following
   error: include of non-modular header inside framework module 'ObjectiveGit'

Regression:
In Xcode 6 it was possible to work around this issue by setting 
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES to YES in the application target. In Xcode 7 beta 4 this no longer works.

Notes:
I’m aware that the framework’s module map (https://github.com/libgit2/objective-git/blob/master/ObjectiveGit.modulemap) is not correct and these libgit2 headers would actually need to be imported like so:
#import <ObjectiveGit/git2/filter.h>

Comments

Still broken in Xcode 7 beta 6

By benchatelain at Aug. 25, 2015, 5:28 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!