sentry-cocoa: Compilation warnings and errors when using Xcode 15 Beta

Platform

iOS

Installed

Swift Package Manager

Version

8.8.0

Steps to Reproduce

When compiling on device (compilation on simulator works fine), there are a bunch of new warnings, and with specific project configuration, compilation error when using Sentry.

Update: Compilation error is fixed in Xcode 15 Beta 3.

Warnings can be reproduced by doing the following:

  1. Create new project
  2. Add Sentry via SPM
  3. Build for device

Observe following warnings:

Ignoring duplicate library '-lc++'

Duplicate -rpath '/Users/denystelezhkin/Library/Developer/Xcode/DerivedData/Sentry-Xcode15-acagjnxhvucyzkbtgzttahdkqjvl/Build/Products/Debug-iphoneos/PackageFrameworks' ignored

Could not associate debug note to atom l_OBJC_LABEL_PROTOCOL_$__TtP13SentryPrivate23SentryMXManagerDelegate_
Could not associate debug note to atom l_OBJC_LABEL_PROTOCOL_$_MXMetricManagerSubscriber
Could not associate debug note to atom l_OBJC_LABEL_PROTOCOL_$_NSObject
Could not associate debug note to atom l_OBJC_PROTOCOL_REFERENCE_$__TtP13SentryPrivate23SentryMXManagerDelegate_
Could not associate debug note to atom l_OBJC_PROTOCOL_REFERENCE_$_MXMetricManagerSubscriber
Could not associate debug note to atom l_OBJC_PROTOCOL_REFERENCE_$_NSObject

However, if project setup is as follows: App -> Framework -> Sentry, warnings are the same, but there is now a compile error:

Assertion failed: ((targetAddr % extras.instrArm64.scale) == 0), function applyFixup, file Fixup.cpp, line 850.

This is probably an Xcode beta issue, and may be mitigated in future betas of Xcode 15, however as this is reproducible in two beta releases already, I wanted to file this issue for visibility, as there might be something i’m missing here.

Expected Result

Compilation succeeds

Actual Result

Compliation failed.

Are you willing to submit a PR?

Currently no, as I’m not certain how this issue can be fixed (and if this is a Sentry issue at all)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 24 (11 by maintainers)

Most upvoted comments

@soucolline this was fixed in #3312 and will be available in our next release.

Xcode Beta Build Errors

These are the Sentry build errors I am seeing when trying to build a project in Xcode 15 Beta 4. It builds fine to the simulator, then fails when trying to build and install on a physical device. It might get resolved in a later beta. Just wanted to note it here.

I could not reproduce Ignoring duplicate library '-lz' but I did get rid of Ignoring duplicate library '-lc++' by removing the following lines from Package.swift:

            linkerSettings: [
                .linkedLibrary("z"),
                .linkedLibrary("c++")
            ]

And I believe this will also solve the -lz duplication

Well, actually on Xcode 15 beta 5 much of the warnings have disappeared. There are only two warnings left:

Ignoring duplicate library '-lc++'
Ignoring duplicate library '-lz'

They appear in every binary Sentry is imported into.

Warnings are still there for Xcode 15 Beta 4.

@mezhevikin and @waydabber, do you get warnings or build errors?

We are aware that they are warnings, but as pointed out in https://github.com/getsentry/sentry-cocoa/issues/3122#issuecomment-1623703806 and https://github.com/getsentry/sentry-cocoa/issues/3122#issuecomment-1623533547, we assume the warnings could be bugs from Apple, and they might be resolved in future Xcode releases.

I have a suspicion that I can’t test right now. Apple added C++ interoperability with Swift, which I think means they are adding C++ lib as default during compilation. We also add C++ lib in our Package.swift, and maybe this is what’s causing the duplication.

You may try to remove this from the package to see if it works. I would call this an Apple bug, they definitely should check for duplicity.