sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dotnet [build|publish] not persisting serviceable attribute for packages in deps file

Open schellap opened this issue 10 years ago • 13 comments

Tasks

  • [ ] Fix bug
  • [x] Undo dotnet/cli#2491 EDIT was never merged, so nothing to undo.
  • [ ] Verify and Close issue

Steps to reproduce

dotnet new dotnet restore dotnet publish

Expected behavior

CoreCLR and other assemblies are marked serviceable in the libraries section in the project.lock.json

Actual behavior

CoreCLR package and other serviceable assembly packages are marked as "serviceable": false

Environment data

dotnet --info output: 1.0.0-rc2-002374

schellap avatar Apr 15 '16 07:04 schellap

Following up on PR dotnet/cli#2491, Assigning to @anurse, feel free to reassign to the right person. This is a NuGet restore issue.

Cc @piotrpMSFT @gkhanna79 @ericstj @yishaigalatzer

schellap avatar Apr 15 '16 07:04 schellap

Filed https://github.com/NuGet/Home/issues/2556. It's up to @yishaigalatzer to triage and figure out what to do. Then we take a NuGet build when there's a fix.

analogrelay avatar Apr 15 '16 16:04 analogrelay

As mentioned in the NuGet issue: We should do this when generating the deps file instead to avoid opening assemblies during restore.

analogrelay avatar Apr 15 '16 17:04 analogrelay

I'll look at this after my current task (#2511)

analogrelay avatar Apr 15 '16 17:04 analogrelay

Is publish the only concern here? Do we need to have the same for build?

brthor avatar Apr 19 '16 23:04 brthor

We've solved this issue for RC2 by simply always writing the serviceable attribute to the deps file. Post RC2 we are going to look at the right solution for specifying this value.

analogrelay avatar Apr 20 '16 18:04 analogrelay

@brthor, edited the title, whoever produces deps file should be consistent. In this case yes, build needs to be fixed as well.

schellap avatar Apr 20 '16 19:04 schellap

@anurse, can this be looked into now? Have you given some thought around how the packages should be tagged or marked serviceable? /Cc @ericstj

I've marked this for Preview 2 when the runtime packages are going to be RTM.

schellap avatar May 13 '16 01:05 schellap

There are a lot of moving parts to get figured out here so I don't have any immediate plans. I'm not exactly sure who's driving this functionality post RC2.

analogrelay avatar May 16 '16 22:05 analogrelay

Chatted with @glennc and @leecow and they confirmed driving this ahead. Assigned to @leecow to do so.

gkhanna79 avatar May 26 '16 16:05 gkhanna79

The current state of this issue:

  • The host respects whatever "serviceable" value is written into the deps.json file.
  • NuGet does not currently write the "serviceable" value into the project.lock.json file: https://github.com/NuGet/Home/issues/2556
  • Since the CLI doesn't know which value it should use for "serviceable", it always writes "serviceable = true" in the deps.json file for NuGet packages for preview2: https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.DotNet.ProjectModel/DependencyContextBuilder.cs#L118-L120

When NuGet's bug is fixed, the CLI can take the "serviceable" value from the project.lock.json file and put the correct value into the deps.json file.

Moving this bug to preview3 since NuGet's bug will not be fixed in time for preview2.

Update: the NuGet bug is now being tracked as https://github.com/NuGet/Home/issues/2923

eerhardt avatar Jun 07 '16 23:06 eerhardt

Moving out of RTM as the NuGet issue is still open.

TheRealPiotrP avatar Jan 20 '17 07:01 TheRealPiotrP

Closing this issue as it is obviously not going to happen any time soon. We can re-open it if the underlying NuGet change ever makes it into the product.

eerhardt avatar Jul 28 '20 20:07 eerhardt