Bug 46508 - Some mmp build errors can disappear when building again and result in a "successful" build with no executable in the app bundle.
Summary: Some mmp build errors can disappear when building again and result in a "succ...
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: mmp ()
Version: Master
Hardware: PC Mac OS
: Normal normal
Target Milestone: (C9)
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2016-11-04 18:39 UTC by Timothy Risi
Modified: 2016-12-05 18:30 UTC (History)
5 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Timothy Risi 2016-11-04 18:39:39 UTC
Steps to reproduce:

1.  Create a new XM project
2.  Add an additional mmp argument to a non-existent resource, eg: --resource=~/Foo.bar
3.  Build and observe build error
4.  Select 'Build' again without cleaning or rebuilding

Expected Result:
App fails to build again with the same build error

Actual Result:
App builds "successfully" with no error, but can't be run.  If you inspect the .app bundle, the MacOS folder is empty, with no exectuable file.  The Compile-to-native step of the build process gives "Skipping target "_CompileToNative" because its outputs are up-to-date."

Environment Info

Xamarin Studio Enterprise
Version 6.1.1 (build 17)
Installation UUID: 867dab2a-5981-4fcb-a66d-6f0df3f97a4a
Runtime:
	Mono 4.8.0 (mono-4.8.0-branch/e51aa0a) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000269

NuGet
Version: 3.4.3.0

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

Xamarin.Android
Version: 7.0.1.3 (Visual Studio Enterprise)
Android SDK: /Users/Tim/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
		7.0   (API level 24)

SDK Tools Version: 25.1.7
SDK Platform Tools Version: 24.0.2
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

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

Xamarin Android Player
Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

Apple Developer Tools
Xcode 8.1 (11544)
Build 8B62

Xamarin.Mac
Version: 3.0.0.297 (Visual Studio Enterprise)

Xamarin.iOS
Version: 10.5.0.18 (Visual Studio Enterprise)
Hash: 738a33a
Branch: master
Build date: 2016-11-03 16:56:43-0800

Build Information
Release ID: 601010017
Git revision: 44d481a9be9cf2bf7c01bfb99c59b77dfa08e712
Build date: 2016-10-25 14:27:24-04
Xamarin addins: 19cdb28081bf28d9688698030abb96e04e391f69
Build lane: monodevelop-lion-cycle8-sr0

Operating System
Mac OS X 10.12.1
Darwin Timothys-MacBook-Pro.local 16.1.0 Darwin Kernel Version 16.1.0
    Wed Oct 19 20:31:56 PDT 2016
    root:xnu-3789.21.4~4/RELEASE_X86_64 x86_64
Comment 1 Chris Hamons 2016-11-09 23:01:55 UTC
https://github.com/xamarin/xamarin-macios/pull/1149
Comment 2 Timothy Risi 2016-11-18 00:44:33 UTC
PR has been merged
Comment 3 Saurabh 2016-11-21 08:47:02 UTC
I have checked this Issue with stable builds (X.Mac 2.10.0.113) and latest master build (X.Mac 3.1.0.52). I am getting build error everytime when build project.

This is the build output for the same: https://gist.github.com/saurabh360/7e9d0206a3465ba283bf8e89d628af70

@Chris, Could you please let me know how can I reproduce this Issue so that I can re verify it with master and Cycle 9 builds?
Comment 4 Chris Hamons 2016-11-22 15:26:34 UTC
System.IO.FileNotFoundException: ~/Foo.bar does not exist
File name: '~/Foo.bar'
  at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x001bd] in /private/tmp/source-mono-master/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.IO/File.cs:109 
  at Xamarin.Bundler.Driver.CopyResources () [0x00029] in <6108b931997a41e8b7f6c6e720571671>:0 
  at Xamarin.Bundler.Driver.Pack (System.Collections.Generic.IList`1[T] unprocessed) [0x003bc] in <6108b931997a41e8b7f6c6e720571671>:0 
  at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00ce8] in <6108b931997a41e8b7f6c6e720571671>:0 
  at Xamarin.Bundler.Driver.Main (System.String[] args) [0x0000c] in <6108b931997a41e8b7f6c6e720571671>:0 


So Tim's steps to reproduce were missing a step.

They should be:

1.  Create a new XM project
2.  Add an additional mmp argument to a non-existent resource, eg: --resource=~/Foo.bar
3.  Build and observe build error
3-1. Remove the additional mmp argument that points to the non-existent resource.
4.  Select 'Build' again without cleaning or rebuilding
5. The application should notice the issue and build / run successfully.
Comment 5 Danish Akhtar 2016-12-02 11:45:59 UTC
@Chris: I have checked this issue with latest C9 X.mac 3.0.0.303 and master X.mac 3.1.0.109, after following the steps mentioned in Comment 4 and observed that we are still getting this issue.

The application is build successfully, when we remove resource=~/Foo.bar from mmp argument and Select 'Build' again without cleaning or rebuilding. Here is the screencast for the same: http://www.screencast.com/t/xNUjq6rBoJTj

Hence Reopening this issue.

Env info and ide logs: https://gist.github.com/danish360/0fceb01727f0713eb8862e0bf3a01a9e
Comment 6 Chris Hamons 2016-12-02 17:06:01 UTC
Ok, I believe there is a problem with this reopening. Let me more clearly describe the behavior I'm expecting (and as QA to take another pass):

- We first setup the problem to fail to build inside mmp
1.  Create a new XM project
2.  Add an additional mmp argument to a non-existent resource, eg: --resource=~/Foo.bar
3.  Build and observe build error

- Now we remove that problem and hit run
3-1. Remove the additional mmp argument that points to the non-existent resource.
4.  Select 'Run' again without cleaning or rebuilding

- Ok. There is a failure case and a working case here.
FAIL - Xamarin Studio prompts about missing executable or the application fails to launch
PASS - We successfully detect that we need to run mmp, generate the launcher, and it starts.

It is hard from the video to determine where we are on that part. Please retest, and feel free to Slack me w\ questions.