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.44k stars 510 forks source link

watchOS project unexpected rebuild with no changes #3755

Open VincentDondain opened 6 years ago

VincentDondain commented 6 years ago

Steps to Reproduce

  1. Create a watchOS project.
  2. Deploy on device
  3. Just re-run and see that the project is rebuilt which forces a new device installation

Expected Behavior

Avoid rebuilding and redeploying when no changes were made (re-deploy is long).

Actual Behavior

Unexpected rebuild / redeploy.

Environment

=== Visual Studio Enterprise 2017 for Mac ===

Version 7.4 (build 1033)
Installation UUID: 00d602ef-271b-479b-9054-0433b5797215
Runtime:
    Mono 5.10.0.147 (2017-12/e1ff8413292) (64-bit)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 510000147

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    2.0.5
    2.0.0-preview2-25407-01
    1.1.2
    1.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
    2.1.4
    2.0.0-preview2-006497
    1.0.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.2
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.2 (13772)
Build 9C40b

=== Xamarin.Mac ===

Version: 4.4.0.14 (Visual Studio Enterprise)

=== Xamarin.iOS ===

Version: 11.11.0.126 (Visual Studio Enterprise)
Hash: 1e1fdf1d
Branch: master
Build date: 2018-03-15 07:46:09-0400

=== Xamarin.Android ===

Version: 8.2.0.15 (Visual Studio Enterprise)
Android SDK: /Users/vidondai/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        4.3 (API level 18)
        6.0 (API level 23)
        7.1 (API level 25)
        8.0 (API level 26)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 704001033
Git revision: 053991068f3c88497d3e5cc52fe7fdf57c28b62f
Build date: 2018-02-28 05:02:28-05
Xamarin addins: cc3283953e0af0b8bfab1bdfdf847d9e403c4606
Build lane: monodevelop-lion-d15-6

=== Operating System ===

Mac OS X 10.13.3
Darwin 17.4.0 Darwin Kernel Version 17.4.0
    Sun Dec 17 09:19:54 PST 2017
    root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

AddinMaker 1.4.2
MSBuild Editor 2.0.1
NuGet Package Explorer 0.2
Internet of Things (IoT) development (Preview) 7.1

Build Logs

2nd build logs: https://gist.github.com/VincentDondain/c9e83d18e299bfe8245538129927bdcc

A rebuild shouldn't have happened the 2nd time as nothing changed.

VincentDondain commented 6 years ago

Important this only happens for watchOS projects. Just tried and iOS projects are not being rebuilt with no changes, we don't re-install the app, we simply launch it.

spouliot commented 6 years ago

That might be the same sub-second issue in mono that's affecting other parts of the build, c.c. @rolfbjarne

VincentDondain commented 6 years ago

aka https://github.com/xamarin/xamarin-macios/pull/3743?

VincentDondain commented 6 years ago

Not sure why it wouldn't happen for iOS project and only happen for watchOS projects though.

rolfbjarne commented 6 years ago

I can reproduce this on Sierra, so it's not the sub-second issue affecting other parts of the build.

From a quick look at the build logs my guess is that it's just missing MSBuild logic to detect already signed libraries.

VincentDondain commented 5 years ago

This is still happening with: https://gist.github.com/VincentDondain/794775d0286baaba13bd66f565c1cd1b

rolfbjarne commented 5 years ago

https://github.com/xamarin/xamarin-macios/blob/b1feb2fd75a2e4b61e2e6d82fb4b3b7e74334292/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/CodesignAppBundle.cs#L109-L115 😒