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

NuGet packages produced with 3.0 SDK cannot be used by 2.2 SDK users...depending on your timezone #8603

Closed
natemcmaster opened this issue Sep 18, 2019 · 5 comments

Comments

@natemcmaster
Copy link

Packages produced with a 3.0 .NET Core SDK cannot be consumed by 2.2 or 2.1 SDK users under the following conditions:

The producer:

  • Build and released a package with a .NET Core 3.0 SDK

The consumer:

  • The consumer is on a computer with the timezone set to GMT > 0 (e.g. Europe, Asia)
  • The consumer is attempting to produce their own package which contains the content from the 3.0 package. Example: PackAsTool projects, which re-distribute all dependencies in a new package.

Real world example: natemcmaster/CommandLineUtils#277

Details about Problem

NuGet product used: dotnet.exe
dotnet.exe --version: 3.0 RC1 / 2.2 (any)

Minimal repro

  1. Install both .NET Core 2.2 and 3.0 SDKs
  2. Switch computer timezone to UTC+1
  3. Run these steps
# Produce
echo '{"sdk":{"version": "3.0.100-rc1-014190" } }' > global.json
dotnet new classlib -o ClassLib12345
dotnet pack ClassLib12345 --output "$(pwd)/nupkg"

# Consume
echo '{"sdk":{"version": "2.2.300" } }' > global.json
dotnet new console -o MyConsoleTool
dotnet add MyConsoleTool/ package ClassLib12345 --source "$(pwd)/nupkg"
dotnet pack MyConsoleTool/ /p:PackAsTool=true

Result

dotnet pack fails due to #7395.

C:\Program Files\dotnet\sdk\2.2.300\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(199,5): error : The DateTimeOffset specified cannot be converted into a Zip file timestamp. [C:\tmp\MyConsoleTool\MyConsoleTool.csproj]
C:\Program Files\dotnet\sdk\2.2.300\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(199,5): error : Parameter name: value [C:\tmp\MyConsoleTool\MyConsoleTool.csproj]

This appears to be a byproduct of the 3.0 "deterministic pack" feature.

@nkolev92
Copy link
Member

Thanks for bringing this to our attention @natemcmaster

This is addressed by the revert of the feature in 5.3 / .NET Core 3.0 in NuGet/NuGet.Client#3058.

The long term plan is tracked in #8601 and will account for this scenario.

@nkolev92
Copy link
Member

Closing this per my above comment, we'll certainly account for this in our future work for deterministic.

@ViktorHofer
Copy link

ViktorHofer commented Sep 20, 2019

I'm unsure that this is really fixed. I'm still hitting this with SDK 3.0.100-rc2-014269 and the ingestion commit b75150f2f4127a77a166c9552845e86fb24a3282 (dotnet/sdk@3d4cfe6).

@ViktorHofer
Copy link

cc @rrelyea @ericstj

@ViktorHofer
Copy link

Ok, sorry for the confusion. In arcade we haven't received the new version therefore in one of our packages where we depend on nuget libs we are carrying the older 5658 version around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants