bugsnag / bugsnag-cocoa

BugSnag error monitoring & exception reporter for iOS, macOS, tvOS and watchOS
https://docs.bugsnag.com/platforms/ios
MIT License
236 stars 129 forks source link

watchos testing fixes #1605

Closed kstenerud closed 12 months ago

kstenerud commented 12 months ago

Goal

Fixes to get watchOS tests working again.

These are cherry-picked out of https://github.com/bugsnag/bugsnag-cocoa/pull/1588 and will be rebased back in once we have a working baseline.

Commit 2769b60 makes sure that the mach headers list is initialized before any other code runs. This code is called by BSGCrashSentryInstall() in BugsnagClient.m, but by then it's already too late because BSGRunContextInit() will have already tried to fetch the info from it. Reversing the call order of BSGCrashSentryInstalland BSGRunContextInit won't work either, as they have reciprocal dependencies, so swapping them will just break other things. This is the least invasive way to reconcile it since bsg_mach_headers_initialize() is idempotent. A full solution would move to a phased startup architecture like in bugsnag-cocoa-performance: init, configure, start - but that would be a biiiig project!

Incidentally, this last commit should also fix the mach-o UUID issue (it was failing because the mach headers list was not initialized yet), but I haven't tested that extensively to be 100% sure it fixes everything.

github-actions[bot] commented 12 months ago

Bugsnag.framework binary size did not change - 713,248 bytes

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +4  +0.0%      +4    __TEXT,__text
  -0.0%      -4  -0.0%      -4    [__TEXT]
  [ = ]       0  [ = ]       0    TOTAL

Generated by :no_entry_sign: Danger