Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from Nov 27, 2017

Conversation

jstedfast
Copy link
Member

@jstedfast jstedfast commented Nov 14, 2017

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
Member Author

This PR replaces #2875

@monojenkins
Copy link
Collaborator

Build failure

1 similar comment
@monojenkins
Copy link
Collaborator

Build failure

@monojenkins
Copy link
Collaborator

Build failure

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

chamons commented Nov 15, 2017

build

Copy link
Contributor

@chamons chamons left a comment

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
Collaborator

Build failure

@monojenkins
Copy link
Collaborator

Build failure

@jstedfast
Copy link
Member Author

Does anyone understand what is failing in the build?

@chamons
Copy link
Contributor

chamons commented Nov 20, 2017

@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
Member Author

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

@chamons
Copy link
Contributor

chamons commented Nov 20, 2017

@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
Member Author

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

@chamons
Copy link
Contributor

chamons commented Nov 20, 2017

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
Member

@jstedfast I've just pushed a fix

@chamons
Copy link
Contributor

chamons commented Nov 20, 2017

A wild @rolfbjarne to the rescue! 🎉

@jstedfast
Copy link
Member Author

thanks @rolfbjarne !

@monojenkins
Copy link
Collaborator

Build failure

@rolfbjarne
Copy link
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
Member Author

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

@rolfbjarne
Copy link
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
Collaborator

Build failure

@monojenkins
Copy link
Collaborator

Build success

@spouliot
Copy link
Contributor

ping @kzu / @emaf

Copy link
Contributor

@kzu kzu left a comment

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/xamarin-macios that referenced this pull request Nov 28, 2017
…amarin#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.

None yet

8 participants