This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 52381 - Projects are not always rebuilt after Xamarin.iOS upgrade
Summary: Projects are not always rebuilt after Xamarin.iOS upgrade
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General (show other bugs)
Version: XI 10.4 (C9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 15.1
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
: 53331 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-08 14:10 UTC by Gabor Furedi
Modified: 2017-03-23 09:51 UTC (History)
6 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
build output and csproj file (99.99 KB, application/zip)
2017-02-08 14:10 UTC, Gabor Furedi
Details
Logs (12.02 KB, application/zip)
2017-03-21 11:09 UTC, Alok Kulkarni
Details
Bug 52381 Logs, Build Output and Screenshots (653.44 KB, application/x-zip-compressed)
2017-03-23 09:51 UTC, Mohak Barokar
Details

Description Gabor Furedi 2017-02-08 14:10:34 UTC
Created attachment 19757 [details]
build output and csproj file

I've just updated to the latest beta XS et' al, and now one of my projects doesn't build, just gives me the following error:

"/Users/gable/Documents/Dev/Xamarin/ArabMoji/Arabmoji.iOS/MTOUCH: Error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com (MT0000) (Arabmoji.iOS)"

In the build output I have seen the 'could not find a part of the path' error message which I have attached, along with the project's csproj file if it helps.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2017-02-08 14:18:57 UTC
Can you try cleaning your entire solution and see if that helps?
Comment 2 Gabor Furedi 2017-02-08 14:25:22 UTC
Sure I've done that and also removed the obj and bin but that didn't help.

However, if you look at the build output, this is the missing path:

/Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.97/SDKs/MonoTouch.iphonesimulator.sdk/Frameworks/Mono.framework/Mono

I went into /Library/Frameworks/Xamarin.iOS.framework/Versions and indeed there's no 10.4.0.97:

cd /Library/Frameworks/Xamarin.iOS.framework/Versions/
ls -la
total 8
drwxr-xr-x   4 gable  staff  136 Feb  8 12:39 .
drwxr-xr-x   3 gable  staff  102 Sep 23 21:34 ..
drwxr-xr-x  12 gable  staff  408 Feb  3 22:07 10.4.0.114
lrwxr-xr-x   1 gable  staff   10 Feb  8 12:39 Current -> 10.4.0.114

So just to try I've created a symlink:

ln -s 10.4.0.114/  10.4.0.97
ls -la
total 16
drwxr-xr-x   5 gable  staff  170 Feb  8 15:08 .
drwxr-xr-x   3 gable  staff  102 Sep 23 21:34 ..
drwxr-xr-x  12 gable  staff  408 Feb  3 22:07 10.4.0.114
lrwxr-xr-x   1 gable  staff   11 Feb  8 15:08 10.4.0.97 -> 10.4.0.114/
lrwxr-xr-x   1 gable  staff   10 Feb  8 12:39 Current -> 10.4.0.114

And now the build proceeded!

Where does the build script get its pathing from?
Comment 3 Rolf Bjarne Kvinge [MSFT] 2017-02-08 14:28:25 UTC
(In reply to Gabor Furedi from comment #2)
> Where does the build script get its pathing from?

That's the mysterious part...

Can you check if you have this file, and if it's there, post the contents:

    /Users/gable/Documents/Dev/Xamarin/ArabMoji/Arabmoji.KeyboardExtension/bin/iPhoneSimulator/Debug/frameworks.txt
Comment 4 Gabor Furedi 2017-02-08 15:19:37 UTC
You are correct, that contains the old path:

/Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.97/SDKs/MonoTouch.iphonesimulator.sdk/Frameworks/Mono.framework

Although I did a clean and I removed the obj+bin from the ArabMoji.iOS, I didnt remove the folders from the extension's path.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2017-02-08 15:20:53 UTC
@Gabor, can you confirm the build works once you delete that file?
Comment 6 Gabor Furedi 2017-02-08 15:29:52 UTC
Indeed the build works now. However, clean all did not remove the file, i had to remove it manually.
Comment 7 Rolf Bjarne Kvinge [MSFT] 2017-02-08 15:30:46 UTC
Thanks, I'll have a look at fixing this.
Comment 8 Gabor Furedi 2017-02-08 15:31:18 UTC
Thanks!
Comment 9 Rolf Bjarne Kvinge [MSFT] 2017-02-09 10:09:52 UTC
@Gabor, did you ever try to clean the Arabmoji.KeyboardExtension project?

From the code and logs it looks like that would have fixed the problem as well, so I'd like to know if you had tried that.
Comment 10 Gabor Furedi 2017-02-09 14:54:49 UTC
No, I just did a clean all, I didn't specifically clean the extension project.
Comment 11 Rolf Bjarne Kvinge [MSFT] 2017-02-13 08:55:21 UTC
So this happens because the MSBuild tasks do not take into account that a new Xamarin.iOS package has been installed when determining whether a project should be rebuilt or not.

This particular bug goes like this:

* Extension project is built. mtouch stores the full path to the Mono.framework from the XI install location on disk.
* Container project is built, and reads the full path to the Mono.framework which was previously stored on disk. This works fine now.
* XI is upgraded.
* Extension project is built, but mtouch is not called again, since nothing in the extension project changed.
* Container project is built, and mtouch is called, because something in the container project changed. mtouch reads the full path to the Mono.framework which was previously stored to disk, but this path is now out-of-date.

Note that this particular problem won't be an issue after PR #1680 [1] is merged, because we won't store the frameworks on disk anymore.

The underlying problem is that the time stamps of the installed files is from when these files were built, not installed. One potential fix is to touch all the files in the package when we install them (in a postinstall command), and in that case the extension project in the example above would be rebuilt correctly (because the timestamps of the system assemblies changed).

@Sebastien: since we're fairly late in the C9 cycle my suggestion would be to add this as a known issue for C9 (since there's a simple workaround: clean your solution after upgrading XI), and then fix this for the next release.

[1] https://github.com/xamarin/xamarin-macios/pull/1680
Comment 12 Sebastien Pouliot 2017-02-13 13:51:35 UTC
@Rolf agreed. Added to release notes in f483622ab97835ade26eb56513dee96bcb6d8f40
Comment 13 Rolf Bjarne Kvinge [MSFT] 2017-02-21 12:25:42 UTC
master: https://github.com/xamarin/maccore/pull/554
Comment 14 Sebastien Pouliot 2017-02-21 21:19:33 UTC
This was merged in master https://github.com/xamarin/maccore/commit/d82c07f5f80afff2abc5afba65fdc97601e60468
Comment 15 Rolf Bjarne Kvinge [MSFT] 2017-03-15 09:24:45 UTC
*** Bug 53331 has been marked as a duplicate of this bug. ***
Comment 16 Alok Kulkarni 2017-03-21 11:09:34 UTC
Created attachment 20498 [details]
Logs

Verified on 15.1 XI 10.8.26, will mark resolved after verifying this on master build.
Comment 17 Alok Kulkarni 2017-03-21 11:14:55 UTC
(In reply to Alok Kulkarni from comment #16)
> Created attachment 20498 [details]
> Logs
> 
> Verified on 15.1 XI 10.8.26, will mark resolved after verifying this on
> master build.
Corrected comment :
Verified on 15.1 XI 10.8.26, will mark VERIFIED after verifying this on master build.
Comment 18 Mohak Barokar 2017-03-23 09:51:37 UTC
Created attachment 20720 [details]
Bug 52381 Logs, Build Output and Screenshots

Verified this bug with Xamarin.iOS Version: 10.8.0.10 Upgrading to Xamarin.iOS Version: 10.9.0.73

Build config for Verification :
=== Visual Studio for Mac Preview ===

Version Preview 5 (7.0 build 1753)
Installation UUID: 75832a91-50e0-4e8a-b81c-d47ea74f859c
Runtime:
 Mono 4.9.4.31 (master/fe3454a) (64-bit)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 409040031

=== NuGet ===

Version: 4.0.0.2323

=== Xamarin.Profiler ===

'/Applications/Xamarin Profiler.app' not found

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.iOS ===

Version: 10.9.0.73 (Visual Studio Enterprise)
Hash: 818c20b
Branch: master
Build date: 2017-03-21 12:28:31-0400

=== Xamarin.Mac ===

Version: 3.3.0.73 (Visual Studio Enterprise)

=== Build Information ===

Release ID: 700001753
Git revision: b4c75c942570caad8ef060d04fcda1ee1417b701
Build date: 2017-03-16 09:19:34-04
Xamarin addins: a9d66d0a40dbb79c2038c4fbb4772847b69895fd
Build lane: monodevelop-lion-master

=== Operating System ===

Mac OS X 10.12.3

hence marking this bug as verified.

Note You need to log in before you can comment on or make changes to this bug.