-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[quick_actions]remove custom modulemap and private headers #6229
[quick_actions]remove custom modulemap and private headers #6229
Conversation
'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', | ||
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hit similar issues in flutter/flutter#16049 (comment). But I don't think you'll need this once you add your first Swift file to the framework, right? Instead of making this modulemap change now can you instead do it when you add the first Swift file so we don't need this frankly sketch workaround?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed swift related updates since we don't have swift files yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of making this modulemap changes a standalone PR can you instead include it in the PR that actually adds a Swift file? It doesn't seem worth a version bump, and I can't check it out and play with it with the Swift tests you write to see what else can be done instead.
Since I can't change the source branch in GitHub in the same PR, I will close this PR in favor of a new one. |
What branch were you trying to update to? You can rebase or whatever you need to in this PR. |
@jmagman Because the original branch name |
Oh, the branch name changed on your fork. |
@jmagman Yep, i know it is a weird obsession to keep things organized |
I do not like this solution since it makes private headers public. However, I wasn't able to find a better solution after lots of research on this topic.
Below is a summary of what I found so far, in case it's useful searching for a better solution in the future:
This limitation is the culprit of everything. If we could use a custom modulemap, we could easily define a submodule (aka we are currently doing) or use a private modulemap to map the private headers, like this.
Adding
use_frameworks!
to thePodfile
also works, but we can't force developers to choose frameworks and not static libraries.There seems to be some effort fixing this problem in Cocoapods (this and this), but there isn't much update since then.
What about removing clang modules at all? In pure ObjC it's fine, but Swift cannot directly import headers - it can only interact with modules.
The auto-generated default modulemap simply exports everything from the umbrella header. It defines a submodule for each of the header import, and re-export them to the main module. Only public headers are allowed in this process. Something like this:
This is only a temporary workaround during migration, but the bad state could last a long time for larger plugins. Though on the bright side, consider that private headers aren't that "private" at all - they can be imported by clients just like public headers. it's only that they are put under a separate directory named "PrivateHeaders" to warn the clients that it's risky to import them, but nothing can technically stop them from doing so.
List which issues are fixed by this PR. You must list at least one issue.
flutter/flutter#108750
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.