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

Mono: The logic to find the RuntimeComponentManifest.json file is incorrect #56299

Closed
rolfbjarne opened this issue Jul 26, 2021 · 2 comments · Fixed by #56431
Closed

Mono: The logic to find the RuntimeComponentManifest.json file is incorrect #56299

rolfbjarne opened this issue Jul 26, 2021 · 2 comments · Fixed by #56431
Assignees
Milestone

Comments

@rolfbjarne
Copy link
Member

Description

The logic to find the RuntimeComponentManifest.json here:

<_MonoRuntimeComponentManifestJsonFilePath Condition="'$(_MonoRuntimeComponentManifestJsonFilePath)' == ''">%(ResolvedRuntimePack.PackageDirectory)\runtimes\$(RuntimeIdentifier)\build\RuntimeComponentManifest.json</_MonoRuntimeComponentManifestJsonFilePath>

does not take into account that ResolvedRuntimePack might contain more than one runtime pack.

See binlog:
msbuild.binlog.zip

Here's the ResolvedRuntimePack items:

ResolvedRuntimePack
    Microsoft.NETCore.App.Runtime.Mono.osx-x64
        FrameworkName = Microsoft.NETCore.App
        NuGetPackageVersion = 6.0.0-rc.1.21371.1
        PackageDirectory = /Users/rolf/work/maccore/dotnet-tools/xamarin-macios/tests/dotnet/packages/microsoft.netcore.app.runtime.mono.osx-x64/6.0.0-rc.1.21371.1
        RuntimeIdentifier = osx-x64
        NuGetPackageId = Microsoft.NETCore.App.Runtime.Mono.osx-x64
        IsTrimmable = 
        OriginalItemSpec = Microsoft.NETCore.App.Runtime.Mono.osx-x64
    Microsoft.AspNetCore.App.Runtime.osx-x64
        FrameworkName = Microsoft.AspNetCore.App
        NuGetPackageVersion = 6.0.0-rc.1.21371.15
        PackageDirectory = /Users/rolf/work/maccore/dotnet-tools/xamarin-macios/tests/dotnet/packages/microsoft.aspnetcore.app.runtime.osx-x64/6.0.0-rc.1.21371.15
        RuntimeIdentifier = osx-x64
        NuGetPackageId = Microsoft.AspNetCore.App.Runtime.osx-x64
        IsTrimmable = 
        OriginalItemSpec = Microsoft.AspNetCore.App.Runtime.osx-x64
    Microsoft.macOS.Runtime.osx-x64
        FrameworkName = Microsoft.macOS
        NuGetPackageVersion = 12.0.100-ci.dotnet-pinvoke-lookup.287
        PackageDirectory = /Users/rolf/work/maccore/dotnet-tools/xamarin-macios/tests/dotnet/packages/microsoft.macos.runtime.osx-x64/12.0.100-ci.dotnet-pinvoke-lookup.287
        RuntimeIdentifier = osx-x64
        NuGetPackageId = Microsoft.macOS.Runtime.osx-x64
        IsTrimmable = 
        OriginalItemSpec = Microsoft.macOS.Runtime.osx-x64

The end result is that the last one is picked, and the code fails because it expects to find RuntimeComponentManifest.json in Microsoft.macOS.Runtime.osx-x64, and not Microsoft.NETCore.App.Runtime.Mono.osx-x64.

CC @lambdageek, @steveisok

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 26, 2021
@ghost
Copy link

ghost commented Jul 26, 2021

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

The logic to find the RuntimeComponentManifest.json here:

<_MonoRuntimeComponentManifestJsonFilePath Condition="'$(_MonoRuntimeComponentManifestJsonFilePath)' == ''">%(ResolvedRuntimePack.PackageDirectory)\runtimes\$(RuntimeIdentifier)\build\RuntimeComponentManifest.json</_MonoRuntimeComponentManifestJsonFilePath>

does not take into account that ResolvedRuntimePack might contain more than one runtime pack.

See binlog:
msbuild.binlog.zip

Here's the ResolvedRuntimePack items:

ResolvedRuntimePack
    Microsoft.NETCore.App.Runtime.Mono.osx-x64
        FrameworkName = Microsoft.NETCore.App
        NuGetPackageVersion = 6.0.0-rc.1.21371.1
        PackageDirectory = /Users/rolf/work/maccore/dotnet-tools/xamarin-macios/tests/dotnet/packages/microsoft.netcore.app.runtime.mono.osx-x64/6.0.0-rc.1.21371.1
        RuntimeIdentifier = osx-x64
        NuGetPackageId = Microsoft.NETCore.App.Runtime.Mono.osx-x64
        IsTrimmable = 
        OriginalItemSpec = Microsoft.NETCore.App.Runtime.Mono.osx-x64
    Microsoft.AspNetCore.App.Runtime.osx-x64
        FrameworkName = Microsoft.AspNetCore.App
        NuGetPackageVersion = 6.0.0-rc.1.21371.15
        PackageDirectory = /Users/rolf/work/maccore/dotnet-tools/xamarin-macios/tests/dotnet/packages/microsoft.aspnetcore.app.runtime.osx-x64/6.0.0-rc.1.21371.15
        RuntimeIdentifier = osx-x64
        NuGetPackageId = Microsoft.AspNetCore.App.Runtime.osx-x64
        IsTrimmable = 
        OriginalItemSpec = Microsoft.AspNetCore.App.Runtime.osx-x64
    Microsoft.macOS.Runtime.osx-x64
        FrameworkName = Microsoft.macOS
        NuGetPackageVersion = 12.0.100-ci.dotnet-pinvoke-lookup.287
        PackageDirectory = /Users/rolf/work/maccore/dotnet-tools/xamarin-macios/tests/dotnet/packages/microsoft.macos.runtime.osx-x64/12.0.100-ci.dotnet-pinvoke-lookup.287
        RuntimeIdentifier = osx-x64
        NuGetPackageId = Microsoft.macOS.Runtime.osx-x64
        IsTrimmable = 
        OriginalItemSpec = Microsoft.macOS.Runtime.osx-x64

The end result is that the last one is picked, and the code fails because it expects to find RuntimeComponentManifest.json in Microsoft.macOS.Runtime.osx-x64, and not Microsoft.NETCore.App.Runtime.Mono.osx-x64.

CC @lambdageek, @steveisok

Author: rolfbjarne
Assignees: -
Labels:

area-Infrastructure-mono, untriaged

Milestone: -

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Jul 26, 2021
@steveisok steveisok added this to the 6.0.0 milestone Jul 26, 2021
@steveisok steveisok self-assigned this Jul 26, 2021
steveisok pushed a commit to steveisok/runtime that referenced this issue Jul 27, 2021
When trying to process what runtime components are available, we were assuming %(ResolvedRuntimePack.PackageDirectory) would
give us the correct Microsoft.NETCore.App runtime pack.  Unfortunately, the ordering was likely altered when we started
setting <KnownRuntimePack> items in the Mono workload.  Since relying on position of the items isn't reliable, we will instead use %(ResolvedFrameworkReference) to tell us which runtime pack is active and where it's located.

Fixes dotnet#56299
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 27, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 29, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants