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

dotnet store command: Long delay based on manifest location and unhelpful error message #8632

Closed
guardrex opened this issue Aug 20, 2017 · 15 comments
Labels
Milestone

Comments

@guardrex
Copy link
Contributor

Steps to reproduce

Create a package store manifest (for this example, I create it at the root of my drive for easy access), e.g., in a file named packages.csproj ...

<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
    <PackageReference Include="Moq" Version="4.7.63" />
  </ItemGroup>
</Project>

Run the dotnet store command to provision the package store ...

dotnet store --manifest c:\packages.csproj --runtime win10-x64 --framework netstandard2.0 --framework-version 2.0.0

Expected behavior

Provisions the package store and produces the target manifest in the .dotnet/store subdirectory of the user's profile ...

<StoreArtifacts>
   <Package Id="castle.core"  Version ="4.1.0"/>
   <Package Id="moq"  Version ="4.7.63"/>
   <Package Id="newtonsoft.json"  Version ="10.0.3"/>
</StoreArtifacts>

(Note: Bad spacing and lowercase package names were addressed in #1487).

Actual behavior

It hangs. Running with -v detailed, it runs for a while and stops at ...

Property reassignment: $(GenerateNuspecDependsOn)="Build;_LoadPackInputItems; _WalkEachTargetPerFramework; _GetPackageFiles; " (previous value: "_LoadPackInputItems; _WalkEachTargetPerFramework; _GetPackageFiles; ") at C:\Program Files\dotnet\sdk\2.0.0\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets (43,5)

Environment data

.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

... and also occurs with latest 2.0.1-servicing-006933

@dasMulli
Copy link
Contributor

when you place a csproj In C:\, msbuild will scan the entire volume, which could take quite a few minutes..

@guardrex
Copy link
Contributor Author

guardrex commented Aug 20, 2017

Placing the file in the Documents folder has the same result ...

dotnet store --manifest c:\users\<USER>\documents\packages.csproj --runtime win10-x64 --framework netstandard2.0 --framework-version 2.0.0

Logged the output (-v detailed) to a file as well. It stops at the same spot ...

Property reassignment: $(GenerateNuspecDependsOn)="Build;_LoadPackInputItems; _WalkEachTargetPerFramework; _GetPackageFiles; " (previous value: "_LoadPackInputItems; _WalkEachTargetPerFramework; _GetPackageFiles; ") at C:\Program Files\dotnet\sdk\2.0.0\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets (43,5)

@dasMulli
Copy link
Contributor

My documents folder is also large enough to slow it down.. it works great from a new empty folder. An alternative would be to add /p:EnableDefaultItems=false to the parameters.

Next problem is you are passing netstandard2.0 as a framework to store from, which is invalid - it should be netcoreapp2.0.

@guardrex
Copy link
Contributor Author

ah! The instructions I started with for the topic were written by another author. It's also possible that a typo (cut-and-paste) error along the why threw me off. I'll see now.

However if the difference here is passing the wrong framework, a hang is a lot worse UE than a proper error message.

@dasMulli
Copy link
Contributor

Agreed, the "error message" for a wrong / unsupported framework (or even runtime) is:

C:\Program Files\dotnet\sdk\2.0.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.CrossGen.targets(48,5): error : Unable to find resolved path for 'coreclr'. 

Which isn't very helpful if you just tried to use netstandard* or net* with dotnet store.

@guardrex
Copy link
Contributor Author

guardrex commented Aug 20, 2017

@dasMulli ty ... good news here as u predicted! 🎉 🎈

Yes, it did run from an empty folder in Documents. Yes, that error message isn't very helpful.

I'm going to leave this open but go back over to the topic issue now and make some changes over there to fix/surface these issues in the documentation. (We're waiting to see how [@]mairaw wants to play it.) I guess they'll consider here ...

  • We can say in the topic 'use an empty folder somewhere to hold your package manifests,' but a hang insanely long delay just because the file is at the root of the drive or in the Documents folder seems like a bad UE to me. You just know devs are going to get into this situation no matter what the topic states.
  • Of course ... the message ... it would be great if it said the framework (or runtime) provided isn't acceptable.

@guardrex guardrex changed the title dotnet store broken? ... or possibly just a delta needed for using it dotnet store command: Long delay based on manifest location and unhelpful error message Aug 20, 2017
@eerhardt
Copy link
Member

when you place a csproj In C:, msbuild will scan the entire volume, which could take quite a few minutes..

This is because of the implicit globbing support in the new SDK. It will happen for any command when you use a new "SDK" csproj, not just dotnet store. Put a "HelloWorld.csproj" in C:\ and dotnet build or even msbuild it and you will see the same behavior.

/cc @rainersigwald @nguerrera @dsplaisted

For the error message - agreed, we should fix it. In reality, the dotnet store command only supports .NET Core App TFMs. It doesn't support desktop, netstandard, or any other TFM.

@rainersigwald
Copy link
Member

Since store uses nonstandard projects, should it pass EnableDefaultItems=false to msbuild? Otherwise, there's no way for MSBuild to know that you don't want to compile every *.cs file on your entire disk and it has to search for them.

@guardrex
Copy link
Contributor Author

guardrex commented Aug 22, 2017

EnableDefaultItems=false

Yes, please, because this soooooo looks like a hang when it happens, and there's no reason to think that devs will grok it was merely the result of where they placed their manifest file. Simply placing it in the Documents folder (with many projects in there) leads to this problem.

the dotnet store command only supports .NET Core App TFMs. It doesn't support desktop, netstandard, or any other TFM.

Why have both the --framework and --framework-version options? ... Why not only have the --framework-version option if no other TFM is supported. Is the --framework option for the future?

@eerhardt
Copy link
Member

Why have both the --framework and --framework-version options?

--framework specifies the TFM - netcoreapp2.0, netcoreapp2.1, etc.
--framework-version specifies the version of Microsoft.NETCore.App package - 2.0.0, 2.0.1, 2.1.0-preview2-12345.

These two options map to the MSBuild properties TargetFramework and RuntimeFrameworkVersion respectively.

@eerhardt
Copy link
Member

Honestly - I'll be the first to tell you that we need some UX work on the dotnet store command. I had logged a few bugs in the 2.0 time frame that didn't meet the priority bar. The reasoning is that dotnet store is a fringe command that not many developers should/will use.

@guardrex
Copy link
Contributor Author

It conflates them then a little bit. The word "framework" used in both places but not meaning the same thing ... "target" framework ... "runtime" framework.

I wonder if the options should be --target-framework-version with only a value 2.0, 2.1, etc. and then --runtime-framework-version with values 2.0.0, 2.0.1, etc.

@dasMulli
Copy link
Contributor

What about a dedicated .storeproj extension? .csproj isn't really appropriate since you don't intend to build a c# based output and only need "a thing" to get dependency resolution and msbuild support.

This would then allow for smarter defaults (=> no default items, current framework + runtime version etc.)

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the Backlog milestone Jan 31, 2020
Copy link
Contributor

Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label.

@github-actions github-actions bot added the stale label Apr 25, 2024
Copy link
Contributor

This issue will now be closed since it has been labeled 'stale' without activity for 30 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants