Skip to content

Add NuGet package support

Omair Majid requested to merge omajid/diffoscope:minimal-nupkg-support into master

NuGet packages (commonly with file extension .nupkg) are used by .NET to transport libraries, similar to jar files. NuGet packages are essentially zip files with some expected contents. A mininial library looks like this:

$ unzip -l ClassLibrary.0.0.1.nupkg
Archive:  ClassLibrary.0.0.1.nupkg
  Length      Date    Time    Name
---------  ---------- -----   ----
      502  04-14-2025 18:14   _rels/.rels
      407  04-14-2025 18:14   ClassLibrary.nuspec
     3584  04-14-2025 22:14   lib/net8.0/ClassLibrary.dll
      459  04-14-2025 18:14   [Content_Types].xml
      625  04-14-2025 18:14   package/services/metadata/core-properties/b44ebb537bbf4983b9527f9e3820fda6.psmdcp
---------                     -------

Some of these content are similar to the contents of a Microsoft OOXML file, and file utility doesn't recognize this correctly. Eee https://bugs.astron.com/view.php?id=644

Support NuGet packages in diffoscope will make it easier to verify the .NET SDK and .NET libraries. It will also contribute towards making the .NET SDK itself reproducible (see https://github.com/dotnet/source-build/issues/4963).

Merge request reports

Loading