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

Incorrect publish output for netcoreapp1.1 on linux-x64 targets #1464

Closed
sbomer opened this issue Aug 1, 2017 · 12 comments
Closed

Incorrect publish output for netcoreapp1.1 on linux-x64 targets #1464

sbomer opened this issue Aug 1, 2017 · 12 comments
Assignees
Milestone

Comments

@sbomer
Copy link
Member

sbomer commented Aug 1, 2017

Repro steps

  • Install preview2 SDK
  • dotnet new console
  • change TFM to netcoreapp1.1
  • dotnet restore
  • dotnet publish -r linux-x64 -c Release -o out

Expected behavior:
Either this works and the output has the required runtime assets (host, System.Private.CoreLib.dll), or this is not a supported scenario, and I get an error message.

Actual behavior:
Publish seems to succeed, but the published app contains no host or System.Private.CoreLib.dll. If I understand correctly, the linux-x64 rid isn't supported for netcoreapp1.1 targets, so the SDK should detect this and emit an error message.

@richlander @russellhadley

@livarcocc
Copy link
Contributor

The SDK does not own the mapping of TFMs and RIDs. I believe that is between NuGet and the Microsoft.NetCore.Platforms target.

I am going to move the issue to NuGet initially, if that's not the appropriate location, please comment and tag me and I can follow up with the runtime team to see what else can be done. But in my mind, this should fail at restore time.

@livarcocc
Copy link
Contributor

This issue was moved to NuGet/Home#6458

@livarcocc livarcocc reopened this Jan 25, 2018
@livarcocc
Copy link
Contributor

Re-activating as this is not something that is enforced by NuGet. The RID compatibility. However, I don't believe the SDK is the right place to contain this information either.

@ericstj @nguerrera @dsplaisted do you guys have any idea on how the SDK could prevent publishing for a RID not supported in a particular TFM?

@livarcocc livarcocc added this to the Discussion milestone Jan 25, 2018
@ericstj
Copy link
Member

ericstj commented Jan 25, 2018

We already do this in the NETCoreApp2.0 package, which @nguerrera had to move into the SDK.
We do plan to enforce this in future versions of the NETCoreApp package. I think the SDK can go back and add the enforcement to the old versions by making @nguerrera's check apply to more TFMs.

@nguerrera
Copy link
Contributor

nguerrera commented Jan 25, 2018

My check will work for any .NETCoreApp version ~~~and it actually fixes the example here for .NETCoreApp 1.1. :)~~~

(EDIT: I was wrong about it fixing this specific case.)

@nguerrera nguerrera modified the milestones: Discussion, 2.2.0 Jan 25, 2018
@nguerrera
Copy link
Contributor

Will be fixed by #1857

@livarcocc
Copy link
Contributor

@nguerrera I just tried this and this seems to be working for 2.0 apps, but did not work for 1.1. At least I was expecting the scenario above to fail with a error message and publish succeeded.

@nguerrera
Copy link
Contributor

I'll take a look

@ericstj
Copy link
Member

ericstj commented Mar 31, 2018

My guess: in 1.x we had a more granular runtime.json. Using Linux-x64 is enough to get all the IL and get past Nick’s check, but it won’t get you the native bits (host, coreclr, shims, etc)

@nguerrera
Copy link
Contributor

@ericstj's guess is correct. The check is sufficient to catch dotnet publish -r completely-invalid but not linux-x64 for 1.1. We are firing in more cases than before and there were no false positives introduced, but there are still false negatives for 1.x.

We would have to refine the check to look for specific RID-specific assets. It is currently based on the heuristic that there is at least one RID-specific package pulled in, but that's not sufficient to catch everything for 1.x.

@nguerrera nguerrera modified the milestones: 2.1.3xx, 2.1.4xx Apr 2, 2018
@nguerrera
Copy link
Contributor

Do we think it is worth refining the check for 1.x or can we say that flagging all invalid RIDs for 2.x+ and most for 1.x+ is good enough?

Changing milestone because it was chosen based on an incorrect assumption that it would be fixed for free with #1857.

@livarcocc
Copy link
Contributor

I am going to close this issue as I believe the checks we have in place and the remaining life time for 1.x are enough.

GangWang01 pushed a commit to GangWang01/sdk that referenced this issue Jun 7, 2022
Merge Master into release/2.1
GangWang01 pushed a commit to GangWang01/sdk that referenced this issue Jul 11, 2022
Merge Master into release/2.1
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

4 participants