Skip to content

[d16-2] Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)#6361

Merged
rolfbjarne merged 3 commits intodotnet:d16-2from
rolfbjarne:backport-6279
Jun 19, 2019
Merged

[d16-2] Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)#6361
rolfbjarne merged 3 commits intodotnet:d16-2from
rolfbjarne:backport-6279

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

@rolfbjarne rolfbjarne commented Jun 19, 2019

  • Bump VSMac to 8.1.0.2742 to fix msbuild issues

This is required to get the support for the msbuild ToolsVersion
change from 15.0 to Current.

  • [tests][msbuild] Fix Binding resources test with updated msbuild

Test failure with updated msbuild and vsmac 8.1:

Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
     Binding project build did not create package?
  Expected: True
  But was:  False

at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0

The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target _CreateBindingResourcePackage
doesn't depend on that project file. So, add that to the target inputs.

  • [nuget] Use xibuild to run nuget

Fix errors seen during nuget restore for tests:

Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"

This is a backport of #6068, #6202 and #6279.

* Bump VSMac to 8.1.0.2742 to fix msbuild issues

This is required to get the support for the msbuild `ToolsVersion`
change from `15.0` to `Current`.

* [tests][msbuild] Fix Binding resources test with updated msbuild

Test failure with updated msbuild and vsmac 8.1:

```
Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
     Binding project build did not create package?
  Expected: True
  But was:  False

at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0
```

The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target `_CreateBindingResourcePackage`
doesn't depend on that project file. So, add that to the target inputs.

* [nuget] Use xibuild to run nuget

Fix errors seen during `nuget restore` for tests:

```
Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"
```
@rolfbjarne rolfbjarne added this to the d16-2 milestone Jun 19, 2019
@rolfbjarne rolfbjarne added the requires-approval-before-merge The pull request requires special approval before it can be merged label Jun 19, 2019
@rolfbjarne
Copy link
Copy Markdown
Member Author

The only change we're shipping is the change in msbuild/Xamarin.Shared/Xamarin.Shared.targets: https://github.com/xamarin/xamarin-macios/pull/6361/files#diff-ad5752725ad1047f45870f74256ad98cL40, which should be very safe (it's adding an additional file to the list of files that causes a target to re-run, which fixes a rebuild issue that shows up in a test).

Also note that that 8.1.0.2742 is the d16-1 stable version of VSfM.

@monojenkins

This comment has been minimized.

radical added 2 commits June 19, 2019 08:36
* [xibuild] Fix incorrect mscorlib.dll being used

The `GuiUnit_NET_4_5` project, when built with `xibuild` uses the wrong `mscorlib.dll`.

From dotnet#5760 (comment) :

```
- mscorlib.dll is being used from mono/4.5 and the other system assemblies are from mono/4.5-api
- GuiNet* project is built with xibuild

What is happening here is:

	xibuild sets[1] `SetToolsetProperty ("TargetFrameworkRootPath", FrameworksDirectory + Path.DirectorySeparatorChar);`
	which points to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks`.
	This causes $(FrameworkPathOverride) to be set[2] to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETFramework/v4.5`,
	but that doesn't have a mscorlib.dll, so it gets reset[3] to /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5/.

	If we don't set TargetFrameworkRoothPath, then we get `FrameworkPathOverride = /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api`,
	causing `_ExplicitReference=/Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api/mscorlib.dll`(correct one) to be used.
```

Fixes dotnet#5760

1. https://github.com/xamarin/xamarin-macios/blob/master/tools/xibuild/Main.cs#L209
2. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L79
3. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L84

* Revert "Workaround dotnet#5760 in generator csproj"

This reverts commit 9bd927b.

The previous commit for xibuild removes the need for this.
)

msbuild property names are case insensitive. While generating the custom
app.config, in `SetToolsetProperty(..)` we try to update the property if
it already exists. But the name lookup was case sensitive, thus causing
the lookup to fail, resulting in two entries for the same property name
differing only in case. Eg. `MSBuildSDKsPath` vs `MSBuildSdksPath`.

Fixed to ignore case.

Fixes mono/mono#14765 .
@monojenkins
Copy link
Copy Markdown
Contributor

Build failure
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Test run failed 🔥

Test results

3 tests failed, 96 tests passed.

Failed tests

  • Xtro/Mac: Failed (Test run failed.)
  • mmptest/macOS/NonSystem: Failed (Execution failed with exit code 1)
  • MTouch tests/NUnit: Failed (Execution failed with exit code 2)

@rolfbjarne
Copy link
Copy Markdown
Member Author

This PR is becoming a bit more important, since without this pretty much every test is failing to build.

Copy link
Copy Markdown
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.

This is approved to land and but will not go out until Preview 4.

@rolfbjarne rolfbjarne merged commit 14cac96 into dotnet:d16-2 Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-approval-before-merge The pull request requires special approval before it can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants