xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.46k stars 511 forks source link

[Windows build perf] ExpandNativeReferences should consume .NET assemblies from the Mac installation #19513

Open emaf opened 11 months ago

emaf commented 11 months ago

This is the same as https://github.com/xamarin/xamarin-macios/issues/19511. As ExpandNativeReferences runs after UnpackLibraryResources, it does not copy the .NET assemblies to the Mac, but it still runs checks on those ~150 files unnecesarily to assess if they need to be copied, and that adds ~500ms to each build.

image

Build Logs

Binlogs.zip

rolfbjarne commented 10 months ago

This task must execute on a Mac (because native references can contain symlinks), but I believe it should be possible to filter out any assemblies that don't have any native references on Windows, so that we only copy assemblies with native references.

emaf commented 10 months ago

Yeah, that's a good one, but we still should avoid analyzing/copying "SDK files", since those should already exist on the Mac's SDK installation image

rolfbjarne commented 10 months ago

Yes, my point is that no SDK assembly will have native references, so by filtering to assemblies with native references (on Windows) we'll indirectly also exclude all SDK assemblies.