Skip to content

Conversation

jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Jul 29, 2025

Another try at #4091

It might be related to the restore operation rather than the build.

This PR ensures AndroidTestApp.csproj is restored exactly once (even though it's built multiple times).

#skip-changelog

Another try at #4091

My theory is that it might be related to the restore operation rather than the build:
https://github.com/getsentry/sentry-dotnet/blob/25a2d578cd35766fcccf9e9fbab660d238640fdf/test/Sentry.Android.AssemblyReader.Tests/Sentry.Android.AssemblyReader.Tests.csproj#L19-L26

In CI we run the restore once, separate from the build... so this PR attempts to restore the `AndroidTestApp` in the same way (rather than as a dependency of the `BuildTestAPKs` target).

#skip-changelog
cursor[bot]

This comment was marked as outdated.

@jamescrosswell jamescrosswell marked this pull request as draft July 30, 2025 04:00
cursor[bot]

This comment was marked as outdated.

@jamescrosswell
Copy link
Collaborator Author

I tried:

<!-- Target to ensure AndroidTestApp is restored -->
<Target Name="EnsureAndroidTestAppRestored" BeforeTargets="CoreBuild;Restore" Condition="!Exists('$(MSBuildProjectDirectory)\..\AndroidTestApp\obj\project.assets.json')">
    <Message Importance="high" Text="Restoring AndroidTestApp via MSBuild task..." />
    <Exec Command="dotnet restore ../AndroidTestApp/AndroidTestApp.csproj --nologo" />
</Target>

However EnsureAndroidTestAppRestored:

  • does not get run when running dotnet restore Sentry-CI-Build-macOS.slnf -bl:build.binlog
  • does get run when running dotnet restore Sentry.Android.AssemblyReader.Tests.csproj -bl:build.binlog

So some annoying NuGet package resolution stuff kicks in an optimises it out of the picture.

@jamescrosswell jamescrosswell marked this pull request as ready for review August 1, 2025 00:24
cursor[bot]

This comment was marked as outdated.

@jamescrosswell jamescrosswell requested a review from jpnurmi August 1, 2025 09:32
@jamescrosswell jamescrosswell requested a review from jpnurmi August 4, 2025 01:01
@jamescrosswell jamescrosswell merged commit 831cd47 into main Aug 4, 2025
32 checks passed
@jamescrosswell jamescrosswell deleted the windows-ci-4091 branch August 4, 2025 06:10
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