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

Wrong timestamp when build from source tarball #1689

Open
lupin-de-mid opened this issue Jul 29, 2020 · 2 comments
Open

Wrong timestamp when build from source tarball #1689

lupin-de-mid opened this issue Jul 29, 2020 · 2 comments
Labels
area-build Improvements in source-build's own build process up-for-grabs

Comments

@lupin-de-mid
Copy link

I try to build from source-tarball v3.1.105 generated by me on Astra Linux 1.6 (it is derivative from debian 9)
And has this error

[17:05:28.55] Packing reference-only packages.
  Created '/home/user/github/tr4/packages/reference/packages/MicroBuild.Core.Sentinel.1.0.0.nupkg'
  Created '/home/user/github/tr4/packages/reference/packages/MicroBuild.Core.0.2.0.nupkg'                                                                    
  Created '/home/user/github/tr4/packages/reference/packages/MicroBuild.Core.0.3.0.nupkg'                                                                    
/home/user/github/tr4/tools-local/init-build.proj(119,5): error : Error when creating nuget lib package from /home/user/github/tr4/packages/reference/staging/microsoft.aspnetcore.app.ref/3.1.3/microsoft.aspnetcore.app.ref.nuspec. System.ArgumentOutOfRangeException: The DateTimeOffset specified cannot be converted into a Zip file timestamp. (Parameter 'value')                                                                                                              
/home/user/github/tr4/tools-local/init-build.proj(119,5): error :    at System.IO.Compression.ZipArchiveEntry.set_LastWriteTime(DateTimeOffset value)        
/home/user/github/tr4/tools-local/init-build.proj(119,5): error :    at NuGet.Packaging.PackageBuilder.CreatePackageFileEntry(ZipArchive package, String entryName, DateTimeOffset timeOffset, CompressionLevel compressionLevel)                                                                                         
/home/user/github/tr4/tools-local/init-build.proj(119,5): error :    at NuGet.Packaging.PackageBuilder.CreatePart(ZipArchive package, String path, Stream sourceStream, DateTimeOffset lastWriteTime)                                                                                                                     
/home/user/github/tr4/tools-local/init-build.proj(119,5): error :    at NuGet.Packaging.PackageBuilder.WriteFiles(ZipArchive package, HashSet`1 filesWithoutExtensions)                                                                                                                                                   
/home/user/github/tr4/tools-local/init-build.proj(119,5): error :    at NuGet.Packaging.PackageBuilder.Save(Stream stream)                                   
/home/user/github/tr4/tools-local/init-build.proj(119,5): error :    at Microsoft.DotNet.Build.Tasks.Packaging.NuGetPack.Pack(String nuspecPath, String nupkgPath, Manifest manifest, Boolean packSymbols) in /home/user/github/tr4/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/NuGetPack.cs:line 297      
Done Building Project "/home/user/github/tr4/tools-local/init-build.proj" (BuildReferenceAssemblies target(s)) -- FAILED.

Caused by timestamp of files. Probably related to NuGet/Home#7001

As workaround I use find . -type f -exec touch {} +

@dagood
Copy link
Member

dagood commented Jul 29, 2020

I think another thing that contributes is that we didn't have the microsoft.aspnetcore.app.ref/3.1.3 package properly building in dotnet/source-build-reference-packages quite yet in v3.1.105:

https://github.com/dotnet/source-build/blob/v3.1.105-SDK/eng/Version.Details.xml#L8-L10

https://github.com/dotnet/source-build-reference-packages/tree/f3db8b2a4a7c12ac44283b516dac8cda12a5edeb/src/targetPacks/ILsrc/microsoft.aspnetcore.app.ref

It looks like not having this package included caused the automatic unpack/disassemble -> assemble/repack infrastructure to handle this package, and I think that may be more susceptible to NuGet/Home#7001.

Having this package in dotnet/source-build-reference-packages may be waiting on #1672. (Although that's just a way to avoid the problem, as far as I understand this so far.)

We could also consider having the tarball generation script automatically run a timestamp workaround.

/cc @dseefeld @crummel

@dseefeld dseefeld added area-build Improvements in source-build's own build process triaged up-for-grabs labels Jul 30, 2020
@dseefeld
Copy link
Contributor

Marking as up-for-grabs to implement the suggested workaround. Note that this shouldn't repro in v3.1.106+, although the underlying issue may surface in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-build Improvements in source-build's own build process up-for-grabs
Projects
Status: Backlog
Development

No branches or pull requests

4 participants