Skip to content

Conversation

jamescrosswell
Copy link
Collaborator

Workaround for #4292:

Warning

We should publish a pre-release from this branch and validate this resolves the problem before merging into main... this is quite a major change.

Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.36%. Comparing base (4581417) to head (4e0a857).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4533      +/-   ##
==========================================
- Coverage   73.36%   73.36%   -0.01%     
==========================================
  Files         479      479              
  Lines       17505    17505              
  Branches     3445     3445              
==========================================
- Hits        12843    12842       -1     
- Misses       3782     3784       +2     
+ Partials      880      879       -1     

☔ 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.

BeforeTargets="ResolveNativeReferences"
Condition="$([MSBuild]::IsOSPlatform('OSX')) and Exists('$(SentryCocoaFramework)')">
<Message Importance="High" Text="Sanitizing $(SentryCocoaFramework): removing dSYMs, Headers, Modules, PrivateHeaders (including symlinks)." />
<Exec Command="bash -c 'find &quot;$(SentryCocoaFramework)&quot; -depth \( -name dSYMs -o -name Headers -o -name Modules -o -name PrivateHeaders \) -exec echo Removing {} \; -exec rm -rf {} + 2&gt;/dev/null || true'" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this executes for multiple target frameworks in parallel. Might be the reason you had to ignore errors because the two commands race and conflict?

What if this was already done at the end of _SetupCocoaSDK, which is guarded to run only once? If we need to ignore errors regardless, we could get away without bash with <Exec IgnoreExitCode="true" ... />

Copy link
Collaborator

Choose a reason for hiding this comment

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

P.S. rm has verbose mode (-v) with quite similar output

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think the Android Device test failures had anything to do with these changes to the Cocoa Bindings project... they appear to be flaky on other unrelated branches as well:

Given that, I think we can create a pre-release from this branch that some of our SDK users can test before we consider merging it into main.

Copy link
Collaborator

@jpnurmi jpnurmi Sep 22, 2025

Choose a reason for hiding this comment

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

The same find $(SentryCocoaFramework) ... -exec rm {} command runs in parallel for net8.0-ios17.0 and net8.0-maccatalyst17.0 even if both operate on the same modules/sentry-cocoa/Sentry-8.56.0.xcframework directory.

Instead of ignoring errors caused by the race between those two commands running in the same directory, could we move the Exec-task to _SetupCocoaSDK, which is executed exactly once? That way, we could simplify the command to:

Suggested change
<Exec Command="bash -c 'find &quot;$(SentryCocoaFramework)&quot; -depth \( -name dSYMs -o -name Headers -o -name Modules -o -name PrivateHeaders \) -exec echo Removing {} \; -exec rm -rf {} + 2&gt;/dev/null || true'" />
<Exec Command="find &quot;$(SentryCocoaFramework)&quot; -depth \( -name dSYMs -o -name Headers -o -name Modules -o -name PrivateHeaders \) -exec rm -rfv {} +" />

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.

3 participants