Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-2896] Private modulemaps do no work properly #45490

Open
swift-ci opened this issue Oct 8, 2016 · 0 comments
Open

[SR-2896] Private modulemaps do no work properly #45490

swift-ci opened this issue Oct 8, 2016 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Oct 8, 2016

Previous ID SR-2896
Radar None
Original Reporter stephan (JIRA User)
Type Bug

Attachment: Download

Environment

Tested with Xcode 8.1 beta (8T46g).

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: e69248e066e0d6cc0a96c839158559a8

Issue Description:

I'm writing a Swift framework library that internally uses some private C and Objective-C functions and classes. For this purpose I'm defining a "private" modulemap for an explicit nested clang module that exposes the private headers. However, it seems that the Swift compiler (or the Swift language support in Xcode) does not properly handle the import and re-export of this explicit nested module.

The attached example Xcode workspace demonstrates the following three problems:

  1. The private `PrivateClass` is available in TestFramework/File2.swift although `TestFramework.Private` is not imported in that file. It seems that the import in File1.swift also improperly affects File2.swift.

  2. Similarly, TestProject/ViewController.swift can use `PrivateClass` even though the nested module `TestFramework.Private` wasn't imported in that project at all. This seems again to be a side-effect of TestFramework/File1.swift importing the nested module.

  3. If the "Install Objective-C Compatibility Header" build setting for the framework is set to Yes, the build fails with the unhelpful error message "No such module 'TestFramework.Private'".

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant