{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/1298","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/1298/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/1298/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/1298/events","html_url":"https://github.com/dotnet/corefx/issues/1298","id":65491520,"number":1298,"title":"System.IO.Compression test asset and native dependency proposal","user":{"login":"FiveTimesTheFun","id":6598317,"avatar_url":"https://avatars.githubusercontent.com/u/6598317?v=3","gravatar_id":"","url":"https://api.github.com/users/FiveTimesTheFun","html_url":"https://github.com/FiveTimesTheFun","followers_url":"https://api.github.com/users/FiveTimesTheFun/followers","following_url":"https://api.github.com/users/FiveTimesTheFun/following{/other_user}","gists_url":"https://api.github.com/users/FiveTimesTheFun/gists{/gist_id}","starred_url":"https://api.github.com/users/FiveTimesTheFun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FiveTimesTheFun/subscriptions","organizations_url":"https://api.github.com/users/FiveTimesTheFun/orgs","repos_url":"https://api.github.com/users/FiveTimesTheFun/repos","events_url":"https://api.github.com/users/FiveTimesTheFun/events{/privacy}","received_events_url":"https://api.github.com/users/FiveTimesTheFun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-31T16:26:17Z","updated_at":"2015-03-31T16:26:17Z","closed_at":null,"body":"System.IO.Compression provides an API to compress and decompress files.  It supports the ZIP and gzip archive formats and the Deflate compression algorithm.  \r\n\r\n***Testing***\r\n\r\nSystem.IO.Compression has existing test assets that fit three categories:\r\n1.\tRound trip data through compression and verify it remains intact\r\n2.\tExtract and verify data compressed through other compatible compression libraries\r\n3.\tVerify behavior when attempting to decompress invalid or edge case archives\r\nThe existing assets include archives, as well as decompressed binary files both for use as source material, and an oracle to verify decompression.  Altogether, the binary assets weigh in at about 40MB.  \r\n\r\n**Problem:** these test assets need to exist at test run time.  Placing them in our corefx git repository is problematic because binary assets do not compress well and will bloat the size of our repository.\r\n\r\n**Proposal:** Binary test assets are packaged in to a nuget package per test assembly to be deployed at test run time.  The binary assets to generate these nuget package are persisted in a single separate Git repository.\r\n\r\nGit repository structure:\r\ncorefx-testdata\\\r\ncorefx-testdata\\System.IO.Compression.TestData.nuspec\r\ncorefx-testdata\\System.IO.Compression.TestData\\<binary assets>\r\n\r\nNupkg structure:\r\ncontent\\<binary assets>\r\n\r\nTest asset nuget packages are depended on by the test assembly’s packages.config\r\n<packages>\r\n  <package id=\"System.IO.Compression.TestData\" version=\"1.0.0-prerelease\" />\r\n\r\nCurrently, nuget is designed to deploy at package reference time (ie. when a package is referenced in Visual Studio) rather than runtime.  In Dev14 this is changing.  Until then, we’ll include a target in the test assembly’s csproj to copy the assets from the downloaded nuget package to the test’s working directory.\r\n\r\nIn addition to System.IO.Compression, metadata reader uses binary test assets, but as they are only 100KB combined and are not a practical problem.  System.IO.Packaging has 60GB of test assets.\r\n\r\n**Proposal:** System.IO.Packaging split their test assets in to tiers, with a single nuget package per tier.  The inner loop tests should be no more than some number of megabytes.  \r\n\r\n***Native Dependencies***\r\n\r\nIn the desktop .NET Framework, although we have a purely managed implementation of the deflate algorithm, customers have reported that the popular cross-platform open-source zlib library is faster and performs high quality compression.  In response we include zlib, which we wrap and delegate to.  We build it from source using the unmodified 1.2.3 version of the sources in the FX partition, and name the resulting output “clrcompression.dll.”  \r\nOn Windows, to fit with .NET Core’s app-local, side-by-side model, if we include zlib, we should deploy a copy of the native assembly alongside the managed System.IO.Compression.dll assembly included with an application.  zlib distributes both sources and official binaries.  While we could redistribute the official zlib binary, unfortunately they only release a 32-bit version and we are currently distributing a 64-bit version of coreclr.\r\nWhile zlib has a permissive license, it is not the MIT license, and including it in the corefx repository would mean the corefx repository no longer only contained code under a single license.\r\n\r\n**Proposal:** Continue building clrcompression.dll from the FX repository.  Publish the 64-bit version of clrcompression.dll in a nuget package System.IO.Compression.clrcompression-x64.nupkg.  Make System.IO.Compression.clrcompression-x64 a dependency of the System.IO.Compression package.\r\n\r\n**X-Plat todo:** Linux has a strong history of deploying applications and their dependencies through package managers.  Packagers bundle the application binaries and metadata describing dependencies in to packages, and publish those on package manager repositories.  We are planning to declare other framework and runtime dependencies through package managers where appropriate, and System.IO.Compression’s zlib dependency should be consistent.\r\n"}}