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

Lots of build warnings: Double-quoted include "SentryAttachment.h" in framework header, expected angle-bracketed instead #3972

Closed
matthewreimer opened this issue May 13, 2024 · 8 comments · Fixed by #4115 or #4298

Comments

@matthewreimer
Copy link

Platform

iOS

Environment

Production, Develop, TestFlight, Other

Installed

Swift Package Manager

Version

8.25.0

Did it work on previous versions?

8.21.0

Steps to Reproduce

Build an app that's using Sentry SDK via SPM. This might be the same issue as one you've fixed before in #1072.

Expected Result

No build warnings

Actual Result

Double-quoted include "SentryAttachment.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryBreadcrumb.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryClient.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryCrashExceptionApplication.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDebugImageProvider.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDebugMeta.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDsn.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryEnvelopeItemHeader.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryError.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryEvent.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryException.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryFrame.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryGeo.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryHttpStatusCodeRange.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryHub.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanProtocol.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanContext.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySampleDecision.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanStatus.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryMeasurementUnit.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryMechanism.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryMechanismMeta.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryMessage.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryNSError.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryOptions.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryProfilingConditionals.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryRequest.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySDK.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySampleDecision.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySamplingContext.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryScope.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanProtocol.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanContext.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanId.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanProtocol.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanStatus.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryStacktrace.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryThread.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryTraceHeader.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySampleDecision.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryTransactionContext.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySampleDecision.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySpanContext.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryUser.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryUserFeedback.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentryDefines.h" in framework header, expected angle-bracketed instead
Double-quoted include "SentrySerializable.h" in framework header, expected angle-bracketed instead

Are you willing to submit a PR?

Maybe

@philipphofmann
Copy link
Member

@matthewreimer, which Xcode version are you using?

@philipphofmann philipphofmann moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK May 14, 2024
@matthewreimer
Copy link
Author

@philipphofmann Version 15.3 (15E204a).

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 14, 2024
@matthewreimer
Copy link
Author

matthewreimer commented May 14, 2024

@philipphofmann I just tried 15.4 (15F31d) and I get the same warnings. I'm using SentrySwiftUI if that matters.

@kahest kahest moved this from Needs More Information to Backlog in Mobile & Cross Platform SDK Jun 12, 2024
@matthewreimer
Copy link
Author

More info:

While building module 'Sentry' imported from /path/to/my/project/Classes/MassiveTextView/MassiveTextView.m:24:
In file included from <module-includes>:1:
/path/to/my/deriveddata/Build/Products/Debug-iphoneos/Sentry.framework/Headers/Sentry.h:9:9: warning: double-quoted include "SentryAttachment.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#import "SentryAttachment.h"
        ^~~~~~~~~~~~~~~~~~~~
        <Sentry/SentryAttachment.h>
...

This happens when importing from Objective-C code like this:

@import Sentry;

Can Sentry.h and friends be changed from #include "SentryAttachment.h" to #include <Sentry/SentryAttachment.h>` or whatever is correct for all these? This problem floods our logs with almost 100 build warnings, which makes it harder to notice the real build warnings among all the noise.

@matthewreimer
Copy link
Author

The number of build warnings has improved with Sentry 8.32.0, but @import Sentry; still results in 54 build warnings.

The public Sentry.h is now using bracket-quoted includes (e.g. #import <Sentry/SentryAttachment.h>) but the imported file continues to use double-quotes (e.g. SentryAttachment.h has #import "SentryDefines.h"). I think all the included header files also need to be changed to use bracket quotes.

Should I file a new issue, or should this issue be reopened?

@brustolin brustolin reopened this Aug 2, 2024
@brustolin
Copy link
Contributor

We should use minimal imports and rely more on forward declarations instead.
We will tackle this, but there is no ETA as of now

@Kemberz
Copy link

Kemberz commented Aug 23, 2024

Same issue:

Error (Xcode): double-quoted include "FBLPromise+Race.h" in framework header, expected angle-bracketed instead
/Users/user/Flutterprojects/appName/ios/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromises.h:24:8

and when I try to fix it

Image

I also changed the clang_warn_quoted to 'no' everywhere

@brustolin
Copy link
Contributor

Hello @Kemberz. Your problem is not related to Sentry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
5 participants