Repository navigation
[msbuild/mac] Skip reference assemblies passed to mmp - #3991
Conversation
- Similar to issue dotnet#3199: Could not AOT the assembly System.Runtime.CompilerServices.Unsafe.dll (MT3001) (dotnet#3199) - Test case: https://www.dropbox.com/s/49jxl8iftmlymes/Issue3199Test3.zip?dl=0 Problem ======= Given a Nuget Package added via the "package reference" mechanism and the said package having netstandard `lib` **and** `ref` folders; `mmp`, if given `--aot:all` was getting reference assemblies and couldn't AOT them as those assemblies are only facades. Solution ======== Skipping the assemblies that have `/ref/` in their path seems like the simplest and yet most functional solution to the problem. As it turn out, there is some logic already in place that copies the `lib` assemblies to the destination folder. It seems equivalent to marking them as "Local Copy". What this does is that it makes those assemblies available to msbuild via `@(ReferenceCopyLocalPaths)`. This gives us the opportunity to safely remove the `ref` assemblies from `@(ReferencePath)`. *Note: `mmp` is getting the assemblies to reference via a combination of `@(ReferencePath)` and `@(ReferenceCopyLocalPaths)`.*
|
@spouliot mmh it's too late to get anything into d15-7 anymore isn't it? |
|
Also it's important to point out that I believe this is not as big of an issue on the Mac side of the house given that it's only an option to AOT compile as opposed to a requirement on iOS. The likelihood of users running into this is therefore lower. |
chamons
left a comment
There was a problem hiding this comment.
I really want a test for this in https://github.com/xamarin/xamarin-macios/tree/master/tests/mmptest
You can file an issue and punt it to me, specially if we are trying to hit 15.7 timetable, but this should have tests.
Build failure
|
|
@VincentDondain yes, much too late for d15.7. If it turns out to be a problem (has not so far for XM) we can re-evaluate for a service release (there's still the old workaround that can be used). |
chamons
left a comment
There was a problem hiding this comment.
Beautiful. An issue is all I ask.
Build success
|
(Could not AOT the assembly System.Runtime.CompilerServices.Unsafe.dll (MT3001) #3199)
Problem
Given a Nuget Package added via the "package reference" mechanism and the said package having netstandard
libandreffolders;mmp, if given--aot:allwas getting reference assemblies and couldn't AOT them as those assemblies are only facades.Solution
Skipping the assemblies that have
/ref/in their path seems like the simplest and yet most functional solution to the problem.As it turn out, there is some logic already in place that copies the
libassemblies to the destination folder. It seems equivalent to marking them as "Local Copy".What this does is that it makes those assemblies available to msbuild via
@(ReferenceCopyLocalPaths). This gives us the opportunity to safely remove therefassemblies from@(ReferencePath).Note:
mmpis getting the assemblies to reference via a combination of@(ReferencePath)and@(ReferenceCopyLocalPaths).