When cancelling a Build, the Temporary-Build folder and its link.xml and meta files remain. This is because BuildHelper.cs PackagesLinkXmlExtractor.OnPostprocessBuild is not called.
Could you try to implement this? It looks like checking the build result is not that easy, so instead of clearing files in some extra event only if build was cancelled, maybe just move the content of OnPostprocessBuild to the custom cleanup method called in the finally block, as to centralize cleanup.
When cancelling a Build, the Temporary-Build folder and its link.xml and meta files remain. This is because BuildHelper.cs PackagesLinkXmlExtractor.OnPostprocessBuild is not called.
I found a way to plug build cancel events on https://answers.unity.com/questions/1724656/how-to-get-a-callback-when-build-was-canceled.html
Could you try to implement this? It looks like checking the build result is not that easy, so instead of clearing files in some extra event only if build was cancelled, maybe just move the content of OnPostprocessBuild to the custom cleanup method called in the
finally
block, as to centralize cleanup.