sdk icon indicating copy to clipboard operation
sdk copied to clipboard

CoreHost should take only the RID-specific asset OR the RID-less asset for a particular asset type

Open analogrelay opened this issue 10 years ago • 16 comments

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

analogrelay avatar Mar 16 '16 21:03 analogrelay

This should be working now?

schellap avatar Mar 18 '16 01:03 schellap

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.

analogrelay avatar Mar 18 '16 18:03 analogrelay

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.

  1. First consider the most specific RID and fallback to less specific RIDs in order.
  2. 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).
  3. If no asset or placeholder has been found, consider RID-less assets.

ericstj avatar Mar 19 '16 16:03 ericstj

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

analogrelay avatar Mar 21 '16 02:03 analogrelay

Do you preserve the placeholders and halt when one is encountered?

ericstj avatar Mar 21 '16 04:03 ericstj

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.

analogrelay avatar Mar 21 '16 15:03 analogrelay

No as impleme

schellap avatar Mar 21 '16 17:03 schellap

What is a placeholder? Just a folder with no assets?

schellap avatar Mar 21 '16 17:03 schellap

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

analogrelay avatar Mar 21 '16 18:03 analogrelay

This shows up in the lock file?

schellap avatar Mar 21 '16 18:03 schellap

Yes, in circumstances where a package provides one

analogrelay avatar Mar 21 '16 18:03 analogrelay

@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 :)

analogrelay avatar Mar 21 '16 18:03 analogrelay

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.

ericstj avatar Mar 21 '16 19:03 ericstj

@schellap What are the next steps for this?

gkhanna79 avatar Mar 28 '16 16:03 gkhanna79

Moving to RTM since this doesn't impact mainline scenario.

schellap avatar Apr 01 '16 17:04 schellap

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

schellap avatar Apr 28 '16 07:04 schellap