-
Notifications
You must be signed in to change notification settings - Fork 561
[build] Sanitize Microsoft.Build projects #3995
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grendello
approved these changes
Dec 5, 2019
|
There's a macOS specific issue in Xamarin.Android.Build.Tests that I'm looking at now. |
26fb7f7 to
0eb3222
Compare
Updates the shared `MSBuildReferences.projitems` file to instead include NuGet references to the required Microsoft.Build.* assemblies. The Mono.Posix.NETStandard, Xamarin.Build.AsyncTask, and Xamarin.LibZipSharp NuGet references have also been moved into this file to make it easier to update versions as needed. All projects which reference `MSBuildReferences.projitems` have been converted from the old `packages.config` to the new `PackageReference` NuGet reference style.
NuGet restore will be skipped if any issues occur when calculating the
dependency graph for the solution or project that it is operating on.
A lot of our sources attempt to import props/targets/projitems files
that are generated by the build, and these should be conditionally
imported so that NuGet restore attempts can succeed before these files
are generated.
Example NuGet restore error:
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets(8,3): error MSB4019: The imported project "bin/BuildRelease/ProfileAssemblies.projitems" was not found. Confirm that the expression in the Import declaration "../../bin/BuildRelease/ProfileAssemblies.projitems" is correct, and that the file exists on disk.
/var/folders/pp/x88nqyvd0h18ttl996vv2c3w0000gn/T/NuGetScratch/ok90j1ok.3t3.nugetrestore.targets(266,5): warning : Skipping restore for project 'src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj'. The project file may be invalid or missing targets required for restore.
This partially reverts commit a4c8e09.
0eb3222 to
f7d125a
Compare
jonathanpeppers
approved these changes
Dec 12, 2019
jonpryor
reviewed
Dec 12, 2019
`NuGet.exe` throws on macOS when it is invoked from the same folder as
`Xunit.NetCore.Extensions.dll`:
mono bin/TestRelease/NuGet.exe
VTable setup of type Xunit.NetCore.Extensions.SkippedTestCase failed
System.TypeLoadException: VTable setup of type Xunit.NetCore.Extensions.SkippedTestCase failed
at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType)
at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.RuntimeType+MemberListType listType, System.RuntimeType reflectedType) [0x0001b] in <7d0bc631cadd4a07bf74717847e90cfa>:0
at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in <7d0bc631cadd4a07bf74717847e90cfa>:0
at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in <7d0bc631cadd4a07bf74717847e90cfa>:0
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo+<GetExportMembers>d__32.MoveNext () [0x000eb] in <5e20d4aa8c6c44a89bf1aeb3c06f166c>:0
at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00015] in <e22351e395f44d7b8c4860fca2dcee71>:0
...
Move the copy of `NuGet.exe`into it's own folder to avoid this wierd
behavior when executing `Xamarin.Android.Build.Tests.dll` on macOS.
393650e to
61a4f06
Compare
11b37ee to
db45c8d
Compare
db45c8d to
46640f2
Compare
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Dec 17, 2019
Attempting to use `@(PackageReference)` for `Mono.Linq.Expressions` continues to fail, even after PR dotnet#3995. Looking at the `msbuild Xamarin.Android /t:Prepare` output [^0], I see that there is a `nuget restore Xamarin.Android-Tests.sln`, and it does not always, and it restores numerous NuGet packages...but not Mono.Linq.Expressions. In the interest of any form of progress, use the "legacy" `packages.config`-style nuget reference, and see if that changes anything. [^0]: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3318737&view=logs&j=cac0e8d3-0ef5-5d2b-b57e-e8fde7204df3&t=b0ec5c6c-f5a1-5ebf-2068-57a5c78a6a85
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Dec 20, 2019
Attempting to use `@(PackageReference)` for `Mono.Linq.Expressions` continues to fail, even after PR dotnet#3995. Looking at the `msbuild Xamarin.Android /t:Prepare` output [^0], I see that there is a `nuget restore Xamarin.Android-Tests.sln`, and it does not always, and it restores numerous NuGet packages...but not Mono.Linq.Expressions. In the interest of any form of progress, use the "legacy" `packages.config`-style nuget reference, and see if that changes anything. [^0]: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3318737&view=logs&j=cac0e8d3-0ef5-5d2b-b57e-e8fde7204df3&t=b0ec5c6c-f5a1-5ebf-2068-57a5c78a6a85
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #3928
Context: https://github.com/xamarin/monodroid/pull/1048
Attempts to clean up and modernize various projects to help break up the
scope of change required to convert them to .NET Standard libraries.
Updates the shared
MSBuildReferences.projitemsfile to instead includeNuGet references to the required Microsoft.Build.* assemblies. The
Mono.Posix.NETStandard, Xamarin.Build.AsyncTask, and Xamarin.LibZipSharp
NuGet references have also been moved into this file to make it easier
to update versions in one place as needed. We're only using the compile
time assets from the MSBuild NuGet packages, which ensures that their
content is not copied to the output directory. An additional
ItemGrouphas been added to this file to copy the required assemblies from the system
to the output directory so that
Xamarin.Android.Build.Testscan run againstthem. These changes are required because the MSBuild assemblies coming
from NuGet do not yet fully support running on Mono.
All projects which reference
MSBuildReferences.projitemshave beenconverted from the old
packages.configto the newPackageReferenceNuGet reference style.
The Azure Pipeline build job has been updated to completely build
Xamarin.Android-Tests.slnwith xabuild, rather than only building selectprojects. This was done to mirror our Jenkins build and to ensure that
make all-testscontinues to work moving forward..NET Core and
NuGetCommandtasks have been bumped to bringin a newer version of NuGet with better PackageReference support.
NuGet restore will be skipped if any issues occur when calculating the
dependency graph for the solution or project that it is operating on.
A lot of our sources attempt to import props/targets/projitems files
that are generated by the build, and these should be conditionally
imported so that NuGet restore attempts can succeed before these files
are generated. This should also help when loading these projects in
VS or VS Mac.
Example NuGet restore error:
I've also moved the
NuGet.exethat is copied and used by tests into it's ownfolder to avoid a crash on macOS which would occur when
NuGet.exeisinvoked from the same folder as
Xunit.NetCore.Extensions.dll: