CoreHost should take only the RID-specific asset OR the RID-less asset for a particular asset type
For each asset type (runtime, native), we should only take the RID-less assets if there are no RID-specific assets. Today we merge: https://github.com/dotnet/cli/blob/rel/1.0.0/src/corehost/cli/deps_format.cpp#L233 - (It's my and @pakrym 's fault, we explicitly asked for merging, but it turns out we were wrong! After discussing with @ericstj we realized the logic should match the NuGet behavior).
We realized that our original intention with the logic was inaccurate here and we need to match the NuGet resolution logic.
This is for RC2, but is not immediately blocking, so other corehost fixes are a higher priority. /cc @gkhanna79 @schellap @davidfowl
This should be working now?
I think it is. /cc @pakrym
It was blocking ASP.NET scenarios that are now working, so I would assume so :). Will close and we can re-open if needed.
we should only take the RID-less assets if there are no RID-specific assets
The algorithm should do a hit-testing / probing type approach same as NuGet.
- First consider the most specific RID and fallback to less specific RIDs in order.
- For each matching RID, then consider TFM and fallback to less specific/compatible TFMs in order. Stop at any point if a folder is found (with asset, or with placeholder).
- If no asset or placeholder has been found, consider RID-less assets.
Thanks for that clarification. TFM resolution has already been done in this case (deps files are always for a single TFM), this adjustment should bring the behavior in line with that algorithm
Do you preserve the placeholders and halt when one is encountered?
I believe so, but @pakrym and @schellap would know for sure. We certainly should be preserving them and corehost should consider them a "successful" match, but with no actual assets provided.
No as impleme
What is a placeholder? Just a folder with no assets?
Yes, it manifests as an asset named _._ within a folder (because ZIP files can't have empty folders, they need a file there to "create" the folder). I'll do some checking today
This shows up in the lock file?
Yes, in circumstances where a package provides one
@ericstj Do you have an example of a package that has one I can try out? I could make one but if you've got a simple example that would speed things along :)
We don't have any for netstandardapp, but we use this type of structure for netcore50. Have a look at https://dotnet.myget.org/F/dotnet-core/api/v2/package/System.Diagnostics.Process/4.1.0-rc3-23921 for example.
Not sure how much we'd actually do this in corefx packages, but I could imagine folks doing it in 3rd party.
@schellap What are the next steps for this?
Moving to RTM since this doesn't impact mainline scenario.
We look at placeholders in the deps file and do the right thing here. The only issue is we also probe for _._ which is being tracked for RTM in dotnet/cli#2351