xamarin / Xamarin.PropertyEditing

MIT License
24 stars 16 forks source link

Reduce Redundant MicroBuild Signing #801

Closed thsparks closed 2 years ago

thsparks commented 2 years ago

When MicroBuild signing is enabled, the SignFiles task will run every time a project is built, even if it's already been compiled once before. In this scenario, the dlls have already been created and signed once (in the initial build), so MSBuild will skip the compilation step, but SignFiles will run again and unnecessarily submit the already-signed dlls for signing again. Since signing can be quite expensive, this redundant signing adds a significant amount of time to builds.

To prevent it from happening, we can disable signing at the start of the build, then only re-enable it if Compile runs. If Compile is skipped, signing will remain disabled, and we will not sign anything unnecessarily.

I've validated this works through builds in the UITools pipeline, i.e. https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5892501&view=results