Skip to content

[msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll - #3007

Merged
jstedfast merged 11 commits into
masterfrom
msbuild-ilrepack
Nov 27, 2017
Merged

[msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll#3007
jstedfast merged 11 commits into
masterfrom
msbuild-ilrepack

Conversation

@jstedfast

@jstedfast jstedfast commented Nov 14, 2017

Copy link
Copy Markdown
Member

This is needed to prevent symbol conflicts with Xamarin.MacDev's
ProcessArgumentBuilder (which is functionally different from
Xamarin.MacDev.Tasks.Core's class of the same name).
@jstedfast

Copy link
Copy Markdown
Member Author

This PR replaces #2875

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

1 similar comment
@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

@spouliot
spouliot requested a review from chamons November 15, 2017 19:07
@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

@chamons chamons added run-mmp-tests Run the mmp tests run-mtouch-tests Run the mtouch tests labels Nov 15, 2017
@chamons

chamons commented Nov 15, 2017

Copy link
Copy Markdown
Contributor

build

@chamons chamons left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable at first glance. I don't grok the ilpack msbuild logic very well, but it should break very quickly if it's wrong. I added mmp/mtouch tests, at least mmp invoke msbuild a lot.

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

@jstedfast

Copy link
Copy Markdown
Member Author

Does anyone understand what is failing in the build?

@chamons

chamons commented Nov 20, 2017

Copy link
Copy Markdown
Contributor

@jstedfast

https://jenkins.mono-project.com/job/xamarin-macios-pr-builder/5603/Test_Report/

Project file: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks.sln
Platform: Configuration:
Build duration: 00:00:07.0559854
Run duration: 00:37:01.1999263
Main log
Build log
: error : Error building target CoreCompile: Microsoft.Build.BuildEngine.InvalidProjectFileException: Unable to parse condition "Exists(@(IntermediateAssembly -> '%(FullPath)')) And '$(ILRepack)' != 'false'" : Expected an item list at position 8 in condition "Exists(@(IntermediateAssembly -> '%(FullPath)')) And '$(ILRepack)' != 'false'". Missing opening parantheses after the '@'. ---> Microsoft.Build.BuildEngine.ExpressionParseException: Expected an item list at position 8 in condition "Exists(@(IntermediateAssembly -> '%(FullPath)')) And '$(ILRepack)' != 'false'". Missing opening parantheses after the '@'. ```

@jstedfast

Copy link
Copy Markdown
Member Author

Ok, that suggests that xbuild is being used instead of msbuild on the bots :(

@chamons

chamons commented Nov 20, 2017

Copy link
Copy Markdown
Contributor

@jstedfast Correct. msbuild currently does not have sufficient redirect support to build all of the tests and use the local built binaries. @radical is working on that.

However, I don't know of a reason why the msbuild/ can't be built w\ msbuild. You could look at changing that and see how it goes.

@jstedfast

Copy link
Copy Markdown
Member Author

I modified the Makefile to make it use msbuild for building the msbuild/ directory tho. :-\

@chamons

chamons commented Nov 20, 2017

Copy link
Copy Markdown
Contributor

https://jenkins.mono-project.com/job/xamarin-macios-pr-builder/5603/Test_Report/

xbuild /verbosity:diagnostic /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks.sln :(

@rolfbjarne

Copy link
Copy Markdown
Member

@jstedfast I've just pushed a fix

@chamons

chamons commented Nov 20, 2017

Copy link
Copy Markdown
Contributor

A wild @rolfbjarne to the rescue! 🎉

@jstedfast

Copy link
Copy Markdown
Member Author

thanks @rolfbjarne !

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

@rolfbjarne

Copy link
Copy Markdown
Member

This happens now:

  /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks/Xamarin.iOS.Tasks.csproj(135,5): error : INFO: IL Repack - Version 2.0.13;
  INFO: ------------- IL Repack Arguments -------------;
  /out:/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks/obj/Debug/Xamarin.iOS.Tasks.dll  /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks/obj/Debug/Xamarin.iOS.Tasks.dll /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks.Core/bin/Debug/Xamarin.iOS.Tasks.Core.dll /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/Xamarin.MacDev/Xamarin.MacDev/bin/Debug/Xamarin.MacDev.dll /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks.Core/bin/Debug/Xamarin.MacDev.Tasks.Core.dll /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks/bin/Debug/Xamarin.MacDev.Tasks.dll /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks/bin/Debug/Mono.Cecil.dll;
  -----------------------------------------------;
  INFO: Adding assembly for merge: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks/obj/Debug/Xamarin.iOS.Tasks.dll;
  INFO: Failed to load debug information for /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks/obj/Debug/Xamarin.iOS.Tasks.dll;
  INFO: Adding assembly for merge: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks.Core/bin/Debug/Xamarin.iOS.Tasks.Core.dll;
  INFO: Failed to load debug information for /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.iOS.Tasks.Core/bin/Debug/Xamarin.iOS.Tasks.Core.dll;
  INFO: Adding assembly for merge: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/Xamarin.MacDev/Xamarin.MacDev/bin/Debug/Xamarin.MacDev.dll;
  INFO: Failed to load debug information for /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/Xamarin.MacDev/Xamarin.MacDev/bin/Debug/Xamarin.MacDev.dll;
  INFO: Adding assembly for merge: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks.Core/bin/Debug/Xamarin.MacDev.Tasks.Core.dll;
  INFO: Failed to load debug information for /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks.Core/bin/Debug/Xamarin.MacDev.Tasks.Core.dll;
  INFO: Adding assembly for merge: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks/bin/Debug/Xamarin.MacDev.Tasks.dll;
  INFO: Failed to load debug information for /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks/bin/Debug/Xamarin.MacDev.Tasks.dll;
  INFO: Adding assembly for merge: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/Xamarin.MacDev.Tasks/bin/Debug/Mono.Cecil.dll;
  INFO: Processing references;
  INFO: Processing types;
  INFO: Merging <Module>;
  INFO: Merging <Module>;
  ERROR: Duplicate type Xamarin.iOS.Tasks.ACToolTaskBase;
  System.InvalidOperationException: Duplicate type Xamarin.iOS.Tasks.ACToolTaskBase from Xamarin.iOS.Tasks.Core.dll, was also present in Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;
  at ILRepacking.RepackImporter.Import (Mono.Cecil.TypeDefinition type, Mono.Collections.Generic.Collection`1[T] col, System.Boolean internalize) [0x00165] in <64e369dd574e4d42a56b1689deff9155>:0;
  at ILRepacking.Steps.TypesRepackStep.RepackTypes () [0x00142] in <64e369dd574e4d42a56b1689deff9155>:0;at ILRepacking.Steps.TypesRepackStep.Perform () [0x00000] in <64e369dd574e4d42a56b1689deff9155>:0;
  at ILRepacking.ILRepack.Repack () [0x00305] in <64e369dd574e4d42a56b1689deff9155>:0;at ILRepacking.Application.Main (System.String[] args) [0x0004a] in <64e369dd574e4d42a56b1689deff9155>:0

which seems to be a rebuild issue (if I do msbuild *.sln twice in xamarin-macios/msbuild, the error occurs the second time). Maybe the ilrepacked assembly is used as input for second build?

@jstedfast

Copy link
Copy Markdown
Member Author

Yea, that's what is happening. How do I fix this? Why is it being "re"built?

@rolfbjarne

Copy link
Copy Markdown
Member

It's first built during normal make, then the second time to (try to) build the tests.

In any case it doesn't matter why: it should be possible to build the solution multiple times.

I don't know how to fix it, maybe @kzu knows?

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

@monojenkins

Copy link
Copy Markdown
Contributor

Build success

@spouliot

Copy link
Copy Markdown
Contributor

ping @kzu / @emaf

@kzu kzu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jstedfast
jstedfast merged commit 2d4256e into master Nov 27, 2017
@jstedfast
jstedfast deleted the msbuild-ilrepack branch November 27, 2017 19:44
rolfbjarne pushed a commit to rolfbjarne/macios that referenced this pull request Nov 28, 2017
…otnet#3007)

* [msbuild] Pack all iOS MSBuild Task assemblies into a single assembly

* Fixed the build

* Renamed ProcessArgumentBuilder to CommandLineArgumentBuilder

This is needed to prevent symbol conflicts with Xamarin.MacDev's
ProcessArgumentBuilder (which is functionally different from
Xamarin.MacDev.Tasks.Core's class of the same name).

* Fixed ILRepack logic for filtering dll's to repack

* Fixed building of Xamarin.iOS.Tasks.Tests now that X.iOS.Tasks.dll contains all symbols

* Updated Makefile now that only 1 iOS Task assembly needs to be distributed

* ILRepack Xamarin.Mac.Tasks as well

* Fixed up *.targets to specify The One Assembly To Rule Them All

* [xharness] Build MSBuild tests with MSBuild.

* Touch the ilrepack stamp file *after* invoking ILRepack, not before.

* Same for Xamarin.Mac.Tasks
jstedfast added a commit that referenced this pull request Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-mmp-tests Run the mmp tests run-mtouch-tests Run the mtouch tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants