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

Self-contained apps should include RID fallback graph in .deps.json #3361

Closed
vitek-karas opened this issue Jun 27, 2019 · 2 comments
Closed
Milestone

Comments

@vitek-karas
Copy link
Member

vitek-karas commented Jun 27, 2019

With the introduction of AssemblyDependencyResolver in 3.0 we're making it relatively easy to dynamically load components with their entire dependency trees. Such components can be portable in the sense that they include RID specific assets (for example different asset for Windows and Linux).

In order to correctly resolve dependencies of such component, the AssemblyDependencyResolver must have a RID fallback graph to follow (so that when we're running on win10-x64, we know that we should also look for assets which are win-x64 or even win). The component itself should not carry the RID fallback graph with it (it would need to have the graph of all the RIDs there are and it would need to be updated with every addition).

Just like framework dependent apps which rely on the framework to provide the RID fallback graph, the component should rely on the host app to provide the RID fallback graph.

So if the host app is a framework dependent app, the RID fallback graph comes from the core framework Microsoft.NETCore.App. In this case everything works fine.

If the host app is a self-contained app, it in itself doesn't need a RID fallback graph since it's been built/published for one specific RID and thus it only carries assets which are necessary for that RID. But if a portable component is about to be loaded into such app, the RID fallback graph is necessary.

The proposal is to modify the SDK to include the RID fallback graph in self-contained app's .deps.json. It should be the graph filtered by the RID the app is targeting (just like what we do for the shared framework).

The problem is also discussed in https://github.com/dotnet/core-setup/issues/6960

@livarcocc livarcocc added this to the Backlog milestone Jun 27, 2019
@vitek-karas
Copy link
Member Author

Can we consider doing this in the 3.0/3.1 timeframe? See https://github.com/dotnet/coreclr/issues/25516 which is a customer hitting this issue.

@vitek-karas
Copy link
Member Author

The RID graph generation for Microsoft.NETCore.App is done in https://github.com/dotnet/core-setup/blob/78ceba2f4147bb8976fb1858aa50f7da50166b54/tools-local/tasks/ProcessSharedFrameworkDeps.cs#L56. It uses NuGet to process the various runtime.json files involved and then it filters the graph to RIDs for the current platform (windows, linux, ...).

Ideally we would share the code somehow between SDK and the tools in core-setup, but the amount of code which does this is relatively small, so maybe just a copy would work as well.

swaroop-sridhar added a commit to swaroop-sridhar/sdk that referenced this issue Oct 23, 2019
swaroop-sridhar added a commit to swaroop-sridhar/sdk that referenced this issue Oct 23, 2019
swaroop-sridhar added a commit to swaroop-sridhar/sdk that referenced this issue Oct 23, 2019
swaroop-sridhar added a commit to swaroop-sridhar/sdk that referenced this issue Oct 24, 2019
swaroop-sridhar added a commit to swaroop-sridhar/sdk that referenced this issue Oct 24, 2019
swaroop-sridhar added a commit to swaroop-sridhar/sdk that referenced this issue Oct 28, 2019
swaroop-sridhar added a commit to swaroop-sridhar/sdk that referenced this issue Oct 29, 2019
In order to support loading components with RID-specific assets, the AssemblyDependencyResolver requires a RID fallback graph.
The component itself should not carry the RID fallback graph with it (it would need to have the graph of all the RIDs there are and it would need to be updated with every addition).
For framework dependent apps, the RID fallback graph comes from the core framework Microsoft.NETCore.App, so there is no need to write it into the app.
If self-contained apps, the (applicable subset of) RID fallback graph needs to be written to the deps.json manifest.

Fixes dotnet#3361
@wli3 wli3 closed this as completed in 1435292 Jan 11, 2020
dsplaisted pushed a commit to dsplaisted/sdk that referenced this issue Feb 19, 2020
…0191029.2 (dotnet#3361)

- Microsoft.NETCore.App.Ref - 3.1.0-preview2.19529.2
- Microsoft.NETCore.App.Runtime.win-x64 - 3.1.0-preview2.19529.2

Dependency coherency updates

- Microsoft.NET.Sdk.WindowsDesktop - 3.1.0-preview2.19529.5 (parent: Microsoft.NETCore.App.Runtime.win-x64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants