fix: Clean repo builds no longer fail when building native#4366
Merged
bitsandfoxes merged 7 commits intomainfrom Jul 18, 2025
Merged
fix: Clean repo builds no longer fail when building native#4366bitsandfoxes merged 7 commits intomainfrom
bitsandfoxes merged 7 commits intomainfrom
Conversation
bitsandfoxes
commented
Jul 17, 2025
| <!-- We want to build the sentry-native only once, BEFORE building TFM specific verions of the SDK --> | ||
| <!-- How to run a target exactly once: https://learn.microsoft.com/visualstudio/msbuild/run-target-exactly-once--> | ||
| <Target Name="_BuildSentryNativeSDKBeforeOuterBuild" | ||
| Condition="'$(_SentryIsNet8OrGreater)' == 'true' and '$(CI)' != 'true'" |
Contributor
Author
There was a problem hiding this comment.
We have to keep the condition on the "outer" target as the TF gets removed on line 108
bitsandfoxes
commented
Jul 17, 2025
| <!-- Build the Sentry Native SDK (this only runs on local machines because in CI we expect the SDK to be | ||
| built already on each native platform and fetched for the final .net build. --> | ||
| <Target Name="_BuildSentryNativeSDK" | ||
| BeforeTargets="DispatchToInnerBuilds;BeforeBuild" |
Contributor
Author
There was a problem hiding this comment.
The "when" now gets resolved by this target being "clamped" by the two new ones.
bitsandfoxes
commented
Jul 17, 2025
| built already on each native platform and fetched for the final .net build. --> | ||
| <Target Name="_BuildSentryNativeSDK" | ||
| BeforeTargets="DispatchToInnerBuilds;BeforeBuild" | ||
| Condition="'$(_SentryIsNet8OrGreater)' == 'true' and '$(CI)' != 'true'" |
Contributor
Author
There was a problem hiding this comment.
The condition needs to be added to the new one's as '$(_SentryIsNet8OrGreater)' == 'true' does not resolve due to TF being removed.
vaind
approved these changes
Jul 17, 2025
Contributor
vaind
left a comment
There was a problem hiding this comment.
I'm flabbergasted how the target change helps at all... but if it does... 🤷
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building the SDK I keep having the build break on me with.
Digging through it I run into this
looks like building
Sentrycauses the build native target to run in parallel, corrupting the build output and failing.So instead, we make use of this article explaining how to run a target really only once.
While debugging, the resolving the path to the build script kept breaking. So instead of
../..we can go with$(MSBuildThisFileDirectory)_and then relative path from here_.#skip-changelog