iabudiab / HTMLKit

An Objective-C framework for your everyday HTML needs.
MIT License
239 stars 27 forks source link

Redefinition of module 'HTMLKit' Xcode 8.3 #12

Closed aimalygin closed 7 years ago

aimalygin commented 7 years ago

There was such error after updating Xcode.

2017-04-04 14 10 40

In the Source/include project folder is the file module.modulemap. After the removal of this file, the project is built without errors.

iabudiab commented 7 years ago

@aimalygin This seems to be a known issue with Xcode itself. See the Xcode 8.3 release note, especially the Known Issues:

When building a framework that has module maps in both the source and the install directories that define the same module, the compiler will show a redefinition message. (28638816)

Workaround: Rename the module map file in the source directory to a non-default name (the default name is module.modulemap or module.map), and set the Module Map File build setting to the renamed module map.

The thing is, we cannot just remove or rename the module.modulemap file because it is needed for a correct build with SwiftPM. I'll have to investigate some more.

iabudiab commented 7 years ago

@aimalygin Hey there, the workaround is on the develop branch but the issue is still open, because I want to verify that everything is working correctly with Xcode 8.3.1 and SwiftPM.

tali commented 7 years ago

Now I get lots of warnings when trying to use the HTMLKit package.

warning: umbrella header for module 'HTMLKit' does not include header 'CSSCodePoints.h'
[...]
iabudiab commented 7 years ago

@tali For now this is unfortunately the lesser of two evils. If we do not rename the modulemap file then HTMLKit wont compile with Xcode 8.3.x. However, with this workaround it compiles with Xcode but throws lots of warnings with SwiftPM, since a default umbrella header is generated that exports all files, i.e. no private headers are defined.

Until Xcode fixes this bug I would leave it as it is. I'll be releasing a new version soon with this workaround. Hopefully the issue is resolved soon on Xcode's side.

iabudiab commented 7 years ago

@aimalygin @tali I've released v2.0.5 with this workaround. Unfortunately we'll have to live with warnings for now until Xcode fixes this.

I'll close this issue and open a new one for the rollback of this workaround.