Skip to content

fix: MSB4006 circular dependency involving target "SetupCocoaSDK"#4956

Open
jamescrosswell wants to merge 2 commits intomainfrom
cocoa-circular-dependency
Open

fix: MSB4006 circular dependency involving target "SetupCocoaSDK"#4956
jamescrosswell wants to merge 2 commits intomainfrom
cocoa-circular-dependency

Conversation

@jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Feb 25, 2026

Resolves #4955:

Explanation

Me and Claude spent a bit of time looking at this. I think we now have a solution that is OK.

What the original code did

The recursive MSBuild call with RemoveProperties="TargetFramework" meant that during an inner build, instead of running _SetupCocoaSDK directly, it spawned a separate MSBuild process on the same project with no TargetFramework set. That separate process ran _SetupCocoaSDK once in isolation. So across both inner TFM builds, the actual work happened in one subprocess — not in the inner builds themselves.

What the new code does

_SetupCocoaSDK now runs once per inner build (once for net9.0-ios18.0, once for net9.0-maccatalyst18.0).

However, every sub-target of _SetupCocoaSDK is idempotent and has checks to make sure we're not double handling:

  • _DownloadCocoaSDK — has Condition="... And !Exists('$(SentryCocoaFramework)')", so ,skips if already downloaded
  • _BuildCocoaSDK — has Inputs/Outputs incremental build guards, skips if up-to-date
  • _GenerateSentryCocoaBindings — has Inputs/Outputs, skips if up-to-date
  • SanitizeSentryCocoaFramework — has "!Exists('$(SentryCocoaFramework).sanitized.stamp"

@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Features ✨

  • feat: Network calls for Session Replay on Android by jamescrosswell in #4860

Fixes 🐛

  • fix: MSB4006 circular dependency involving target "SetupCocoaSDK" by jamescrosswell in #4956
  • fix: Log Warning instead of Error when ratelimited by bitsandfoxes in #4927

Dependencies ⬆️

Deps

  • chore(deps): update Cocoa SDK to v9.5.0 by github-actions in #4944
  • chore(deps): update Native SDK to v0.13.0 by github-actions in #4941
  • chore(deps): update CLI to v3.2.2 by github-actions in #4943
  • chore(deps): update Java SDK to v8.33.0 by github-actions in #4933
  • chore(deps): update CLI to v3.2.0 by github-actions in #4805
    • NOTE: Sentry CLI v3 removed support for the legacy API key authentication method. Sentry CLI now only supports authenticating with Auth Tokens. If you are using API key authentication via SentryApiKey, you need to generate an Auth Token and use SentryAuthToken, instead.
  • chore(deps): update Cocoa SDK to v9.4.1 by github-actions in #4928
  • chore(deps): update Native SDK to v0.12.8 by github-actions in #4929
  • Apps built using the Sentry SDK for .NET must now target iOS version 15 or higher. Previously only version 13 or higher was required. (#4781) by github-actions in #4781
  • Bump Cocoa SDK from v8.57.3 to v9.2.0 (#4781) by github-actions in #4781
  • chore(deps): update Native SDK to v0.12.7 by github-actions in #4920

Other

  • test(blazor): Add Playwright E2E tests for navigation breadcrumbs by bruno-garcia in #4908
  • test(android): Use volatile to produce SIGSEGV in native crash test by jpnurmi in #4919

🤖 This preview updates automatically when you update the PR.

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.89%. Comparing base (c8c4b00) to head (46b325a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4956   +/-   ##
=======================================
  Coverage   73.89%   73.89%           
=======================================
  Files         496      496           
  Lines       17951    17951           
  Branches     3516     3516           
=======================================
  Hits        13265    13265           
  Misses       3825     3825           
  Partials      861      861           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell jamescrosswell marked this pull request as ready for review February 25, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSB4006: Circular dependency involving "SetupCocoaSDK"

1 participant