Module 'InstallerPlugins' is incompatible with feature 'swift'

I cant' use InstallerPlugins framework with Swift because /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/InstallerPlugins.framework/Versions/A/Modules/module.modulemap contains a line

"requires !swift"

If I remove this line I'm able to compile my plugin. Can I override this setting somehow or workaround it.


Adding #import <InstallerPlugins/InstallerPlugins.h> to the ..-Bridging-Header.h doesn't help.
Here is similar issue: https://forums.developer.apple.com/thread/9541


I have this issue with Xcode 8 and Xcode 9 beta


Thanks,
Artem

Answered by DTS Engineer in 251578022

Are you trying to write an installer plug-in in Swift? If so, that’s not supported. It’s not safe to write a traditional plug-in in Swift because multiple plug-ins can get loaded into the same process, and the plug-ins might have conflicting versions of the Swift runtime.

Note Modern plug-ins are implemented as app extensions, and it is safe to write an app extension in Swift because each app extension run in its own process.

This problem will go away once we have ABI compatibility (roll on Swift 5!) but, for the moment, you’ll have to write such plug-ins in Objective-C.

Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

Are you trying to write an installer plug-in in Swift? If so, that’s not supported. It’s not safe to write a traditional plug-in in Swift because multiple plug-ins can get loaded into the same process, and the plug-ins might have conflicting versions of the Swift runtime.

Note Modern plug-ins are implemented as app extensions, and it is safe to write an app extension in Swift because each app extension run in its own process.

This problem will go away once we have ABI compatibility (roll on Swift 5!) but, for the moment, you’ll have to write such plug-ins in Objective-C.

Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

@eskimo Has anything changed yet? There is literally no good modern information on installer plugins. Is there a Swift API yet and can we compile, debug a plugin as a Swift package SPM?

@DTS Engineer Would it be possible to revisit the swift API? I removed the explicit disallowal from the modulemap, and was able to get a swift installer plug-in building and working perfectly.

I uploaded the code to this repo, based on the original authorization plugin sample code: https://github.com/SoCuul/SwiftInstallerPluginSample