Bug 59697 - iOS Library projects fail CompileEntitlements when Analysis is enabled
Summary: iOS Library projects fail CompileEntitlements when Analysis is enabled
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: XI 11.0 (xcode9)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Vincent Dondain [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-09-22 14:28 UTC by Tomasz Cielecki
Modified: 2017-12-05 21:44 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: No
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:
RESOLVED FIXED

Description Tomasz Cielecki 2017-09-22 14:28:14 UTC
We have added SonarQube to our build script, which does something with MSBuild that might be what is triggering some issues. Prior to enabling SonarQube everything seems to build fine.

What SonarQube seems to do is to enable analysis of the solution, which triggers that Xamarin.Analysis.targets come into the picture.

With SonarQube enabled our build fails on a iOS Class Library project, which does not have any Entitlements and only has the Platform configuration AnyCPU. Even so, the build fails with the "CompileEntitlements" task failing due to a whole bunch for properties not being set. I have attached the build log, which includes the Diagnostics output from MSBuild to this report.

It appears to me that the CompileEntitlements task is run, because somewhere during the build it changes the Platform from AnyCPU to iPhone, which then triggers it. I believe this shouldn't happen, because no native code is created here and no entitlements need to be compiled.
Comment 3 Vincent Dondain [MSFT] 2017-10-06 20:17:42 UTC
I could confirm this issue, it seems indeed to come from the fact that SonarQube does a `RunCodeAnalysis` which triggers Xamarin.Analysis which seem to have an issue with iOS libraries.

An easy way to reproduce this is to create a brand new Xamarin.iOS library (New Project > iOS > Library > Class library) and do Project > Run Code Analysis on Solution (menu bar).

We then get: `/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1381,3): error MSB4044: The "CompileEntitlements" task was not given a value for the required parameter "AppBundleDir".`

Full build output: https://gist.github.com/VincentDondain/d1072c74c6a38cb8f88c2e5d6d445aa4

Version information: https://gist.github.com/VincentDondain/53390dbaca03c15a2e50a28a2da86e5c
Comment 4 Jeffrey Stedfast 2017-10-09 18:56:55 UTC
Want me to handle this one? I think I have an idea for a fix (I just noticed you assigned this to yourself a few seconds ago)
Comment 5 Vincent Dondain [MSFT] 2017-12-05 17:52:51 UTC
Pending PR: https://github.com/xamarin/xamarin-macios/pull/3084