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

Remove unused headers from umbrella header directory #1474

Merged

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Aug 17, 2022

This is a very similar fix to ably/delta-codec-cocoa#23. It fixes a warning along the lines of Umbrella header for module 'Ably' does not include header 'ARTPushActivationEvent.h' that occurs when importing this library as an SPM package. I've also changed the build settings for our example SPM package that imports this library, to catch future errors like this.

@lawrence-forooghian lawrence-forooghian force-pushed the remove-unused-headers-from-umbrella-header-directory branch 2 times, most recently from 078a216 to 2ab348a Compare August 17, 2022 23:38
@github-actions github-actions bot temporarily deployed to staging/pull/1474/jazzydoc August 17, 2022 23:48 Inactive
@lawrence-forooghian
Copy link
Collaborator Author

CI on this one won't pass until:

  1. Remove unused config.h header from umbrella header directory delta-codec-cocoa#23 is merged
  2. we do a new release of delta-codec-cocoa
  3. we bump the version of AblyDeltaCodec in this library
  4. I rebase this PR

@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review August 18, 2022 00:07
Copy link
Collaborator

@maratal maratal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

This commit message is pretty much a copy-and-paste of that of commit
7822a33 in ably/delta-codec-cocoa.

The file Source/include/Ably.modulemap contains an umbrella header
declaration:

> umbrella header "Ably/Ably.h"

According to Clang’s modules documentation
(https://clang.llvm.org/docs/Modules.html):

> An umbrella header includes all of the headers within its directory

> Use the -Wincomplete-umbrella warning option to ask Clang to complain
> about headers not covered by the umbrella header or the module map.

-Wincomplete-umbrella is enabled by default
(https://clang.llvm.org/docs/DiagnosticsReference.html#wincomplete-umbrella).

Source/include/Ably/Ably.h doesn’t contain an import of its neighbouring
files ARTPushActivationEvent.h, ARTPushActivationState.h and
ARTPushActivationStateMachine.h (symlinks to headers used internally),
which hence triggers the above warning ("umbrella header for module
'Ably' does not include header 'ARTPushActivationEvent.h'" etc) in apps
importing the Ably module, i.e. apps importing the Ably SPM package.

Those ARTPushActivationEvent.h etc symlinks are _correctly_ not included
in the umbrella header since they’re not part of the public interface of
this module. Hence the correct thing to do is to delete them.
This would have caught the errors fixed in commit 312be56 of this repo
and in commit 7822a33 of ably/delta-codec-cocoa.

I followed
https://michael-kiley.medium.com/treat-warnings-as-errors-in-a-swift-package-e4429609ec2d.
@lawrence-forooghian lawrence-forooghian force-pushed the remove-unused-headers-from-umbrella-header-directory branch from 2ab348a to dd9e462 Compare August 18, 2022 12:32
@lawrence-forooghian lawrence-forooghian merged commit 597bb6f into main Aug 18, 2022
@lawrence-forooghian lawrence-forooghian deleted the remove-unused-headers-from-umbrella-header-directory branch August 18, 2022 13:41
lawrence-forooghian added a commit that referenced this pull request Aug 18, 2022
This is generated by the mysterious github_changelog_generator, plus I
added a line about the fix in #1474.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants