Skip to content

Conversation

bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Oct 7, 2025

Building the repo on Windows straight up does not work. I.e. exec cp does not exist. The contributing docs are out of date as well. So this fixes it.

#skip-changelog

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.


<Target Name="PrintVersions" BeforeTargets="BeforeResolveReferences" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'">
<Message Text="Building the Unity SDK with:%0a UnityVersion: $(UnityVersion)%0a TargetFramework: $(TargetFramework)" Importance="High" />
<Message Text="Building the Unity SDK with:%0a UnityVersion: $(UnityVersion)%0a TargetFramework: $(TargetFramework)" Importance="High" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This just indents it properly on the console.

Comment on lines +1 to +2
m_EditorVersion: 2021.3.45f2
m_EditorVersionWithRevision: 2021.3.45f2 (88f88f591b2e)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the latest generally available version with the f2 security patch.

<Message Importance="High" Text="Building Sentry Android SDK." />

<Exec WorkingDirectory="$(SentryAndroidRoot)" EnvironmentVariables="JAVA_HOME=$(JAVA_HOME_17_X64)" Command="./gradlew -PsentryAndroidSdkName=sentry.native.android.unity :sentry-android-core:assembleRelease :sentry-android-ndk:assembleRelease :sentry:jar --no-daemon --stacktrace --warning-mode none" />
<Exec WorkingDirectory="$(SentryAndroidRoot)" Command="./gradlew -PsentryAndroidSdkName=sentry.native.android.unity :sentry-android-core:assembleRelease :sentry-android-ndk:assembleRelease :sentry:jar --no-daemon --stacktrace --warning-mode none" />
Copy link
Contributor Author

@bitsandfoxes bitsandfoxes Oct 8, 2025

Choose a reason for hiding this comment

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

We had to set JAVA_HOME to JAVA_HOME_17_X64 due to 17 not being the default on GH runners at the time. But the fact that we're hardcoded overwriting this during the build is 1. no longer required and 2. messing with local dev environments.

<_UnityPathProp>%(_UnityPathsFoundReversed.Identity)</_UnityPathProp>
</PropertyGroup>

<Message
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While setting up the dev environment on Windows, this message would have saved me all the headaches in the world.

cursor[bot]

This comment was marked as outdated.

@bitsandfoxes bitsandfoxes changed the title chore: Updated CONTRIBUTING.md chore: Make repo compatible to be built on Windows Oct 8, 2025
<Target Name="BuildAndroidSDK"
DependsOnTargets="DownloadCLI"
Condition="'$(MSBuildProjectName)' == 'Sentry.Unity' And !Exists('$(SentryAndroidArtifactsDestination)')"
Condition="'$(MSBuildProjectName)' == 'Sentry.Unity' And (!Exists('$(SentryAndroidArtifactsDestination)') Or (Exists('$(SentryAndroidArtifactsDestination)') And $([System.IO.Directory]::GetFiles('$(SentryAndroidArtifactsDestination)').Length) != 4))"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Soft-checking for the content: Otherwise, if the target half succeeds and create the directory, subsequent runs will skip this target, assuming it is done and cached.

@bitsandfoxes bitsandfoxes requested review from mujacica and vaind October 8, 2025 14:22
Comment on lines 311 to +312
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="strip -s build/libsentry.so -w -K sentry_[^_]* -o $(SentryLinuxArtifactsDestination)libsentry.so" />
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cp build/libsentry.so $(SentryLinuxArtifactsDestination)libsentry.dbg.so" />
<Copy SourceFiles="$(SentryNativeRoot)build/libsentry.so" DestinationFiles="$(SentryLinuxArtifactsDestination)libsentry.dbg.so" />
Copy link
Collaborator

@vaind vaind Oct 9, 2025

Choose a reason for hiding this comment

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

This is a linux build so not expected to run on windows. The previous or following command would fail anyway.

@bitsandfoxes bitsandfoxes merged commit 5ac9e44 into main Oct 9, 2025
51 of 55 checks passed
@bitsandfoxes bitsandfoxes deleted the fix/contrib branch October 9, 2025 09:12
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