Closed wli3 closed 6 years ago
@muratg @natemcmaster
cc: @livarcocc
@emgarten @nkolev92 do you know what is the layout for packages in fallbackfolder as feed? I tried to move the nupkg to the root of fallbackfolder, but end up "cannot find Microsoft.NETCore.Platforms" (although Platforms is there as "restored" layout). In order to make it discover-able by nuget I have to run a restore on this nupkg, and copied the result of restore output to fallbackfolder
NuGet supports 2 different layouts for local folders.
One is a flat list(V2), the other one is the style(V3) like in the global packages folder.
The fallback folder is a V3 style folder, because it's equivalent to the global packages folder.
So something like: Root\PackageName\PackageVersion\ nupkg
You can look at the DG spec, to make sure that NuGet is picking up the right folder:
NUGET_PERSIST_DG=true
NUGET_PERSIST_DG_PATH=c:\tmp\output.dg (optional)
When you run a restore, it will write a spec that tells you what NuGet will use to restore.
So the fallback folder appears to be following the V3 layout. We have $Root/dotnet-watch/2.1.0-preview1-28181/dotnet-watch.2.1.0-preview1-28181.nupkg
on disk. Are we missing something else? Do I also need the nuspec extracted next to the nupkg?
Also, @wli3 when dotnet-install-tool generates the csproj file used to restore a tools package, what property are you generating that points to C:\Program Files\dotnet\sdk\NuGetFallbackFolder\
? Is it RestoreSources
, RestoreProjectAdditionalSources
, etc?
@natemcmaster Not of the top of my head. Extraction only matters if it's used as a fallback folder.
And that's exactly what I'm wondering, how does the fallback folder get added to nuget. The dependency graph spec should help us understand that.
by this
<RestoreAdditionalProjectSources>C:\Program Files\dotnet\sdk\NuGetFallbackFolder</RestoreAdditionalProjectSources>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RestorePackagesPath>C:\Users\wul\.dotnet\toolspkgs\dotnet-watch\2.1.0-preview1-28181</RestorePackagesPath>
<RestoreProjectStyle>DotnetToolReference</RestoreProjectStyle>
<RestoreRootConfigDirectory>C:\Program Files\dotnet</RestoreRootConfigDirectory>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<RestoreFallbackFolders>clear</RestoreFallbackFolders>
<RestoreAdditionalProjectSources>C:\Program Files\dotnet\sdk\NuGetFallbackFolder</RestoreAdditionalProjectSources>
<RestoreAdditionalProjectFallbackFolders></RestoreAdditionalProjectFallbackFolders>
<RestoreAdditionalProjectFallbackFoldersExcludes></RestoreAdditionalProjectFallbackFoldersExcludes>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="dotnet-watch" Version="2.1.0-preview1-28181" />
</ItemGroup>
</Project>
@wli3 Can you please try what I suggested above and paste the dg spec here?
I found it. @nkolev92 not sure if this a known bug or not, but apparently for NuGet to treat the nested folder layout as a v3 feed, you also need the .nuspec and .nupkg.sha512 files extracted next to the nupkg.
That's the minimal i find... and ya, you are right @natemcmaster
cc @muratg assigning this to 2.1.0-preview1. Seems like a vital scenario we fix for this release. I think making this change in the LZMA generation is trivial, so I can take it on.
@nkolev92 here is dg spec of only nupkg under packageid/packageversion
{
"format": 1,
"restore": {
"C:\\Users\\wul\\AppData\\Local\\Temp\\ce5wusmn.hb4\\ohlbuegj.ksa.csproj": {}
},
"projects": {
"C:\\Users\\wul\\AppData\\Local\\Temp\\ce5wusmn.hb4\\ohlbuegj.ksa.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\wul\\AppData\\Local\\Temp\\ce5wusmn.hb4\\ohlbuegj.ksa.csproj",
"projectName": "ohlbuegj.ksa",
"projectPath": "C:\\Users\\wul\\AppData\\Local\\Temp\\ce5wusmn.hb4\\ohlbuegj.ksa.csproj",
"packagesPath": "C:\\Users\\wul\\.dotnet\\toolspkgs\\dotnet-watch\\2.1.0-preview1-28181",
"outputPath": "C:\\Users\\wul\\.dotnet\\toolspkgs\\dotnet-watch\\2.1.0-preview1-28181",
"projectStyle": "DotnetToolReference",
"configFilePaths": [
"C:\\Users\\wul\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"netcoreapp2.1"
],
"sources": {
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"frameworks": {
"netcoreapp2.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp2.1": {
"dependencies": {
"dotnet-watch": {
"target": "Package",
"version": "[2.1.0-preview1-28181, )"
}
},
"imports": [
"net461"
],
"assetTargetFallback": true,
"warn": true
}
},
"runtimes": {
"win10-x64": {
"#import": []
}
}
}
}
}
@natemcmaster Yeah that's it.
@wli3 That looks good.
I think you guys got to the bottom of this.
@natemcmaster agreed that this should go in preview1. Though could you start an internal thread with Damian and Eilon for ask-mode approval?
@muratg got approval.
This should be resolved https://github.com/aspnet/Universe/pull/829. @wli3 this should be in the next prodcon build of dotnet/cli.
Leaving open until we verify this in a build of dotnet/cli
@natemcmaster Will do. There should be one build tomorrow? Or just 5 hours from now?
As soon as tomorrow, but could be longer. Hard to say because builds are so unstable right now.
Checked several times today, no new build. I will keep checking
Hopefully we'll have a new build today. We have a 2.1 build of aspnetcore. We just need the CLI build to pass with our new bits
Fixed in CLI 2.1.300-preview1-008019.
Repo in preview 1 build - https://github.com/dotnet/versions/tree/master/build-info/dotnet/product/cli/release/2.1
Due to dotnet-watch, dotnet-user-secrets etc are not extracted with "restored format" in NuGetFallbackFolder
Actual
Result of dotnet install
Expected