Skip to content

dotnetup: Support tar.gz archives on Windows to enable hard link deduplication #54403

@MichaelSimons

Description

@MichaelSimons

Summary

dotnetup on Windows currently only downloads and extracts .zip archives. This means Windows users installing via dotnetup cannot benefit from the hard link-based deduplication work in #52182, which relies on tar archives to preserve hard links.

Background

The SDK deduplication effort (#52182) achieves ~28% size reduction on disk by using hard links to eliminate duplicate files. Tar archives natively preserve hard links, so Linux/macOS users get this benefit automatically. However, the .zip format does not support hard links — extracting a zip results in fully materialized duplicate files.

Current Behavior

In DotnetupUtilities.GetArchiveFileExtensionForPlatform():

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
    return ".zip";
else
    return ".tar.gz";

And in DotnetArchiveExtractor.ExtractArchiveDirectlyToTarget():

if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
    ExtractTarArchive(...);
else
    ExtractZipArchive(...);

The format decision is purely OS-based with no fallback or user option.

Proposed Change

Support downloading and extracting .tar.gz archives on Windows when available. This would:

  1. Allow Windows users to benefit from the ~28% on-disk size reduction from hard link deduplication
  2. Reduce download size (tar.gz is smaller than zip for SDK payloads — 208 MB vs 289 MB per Eliminate Duplicate SDK Files #52182)
  3. Preserve hard links during extraction using System.Formats.Tar (which already works cross-platform)

Considerations

  • NTFS supports hard links, so the extraction logic should work on Windows
  • The existing ExtractTarArchive code uses System.Formats.Tar which is cross-platform
  • May want to prefer tar.gz when available but fall back to zip if the tar.gz artifact is not published for a given release
  • Need to verify symlink/hardlink extraction works correctly with Windows filesystem semantics and permissions

Related

Metadata

Metadata

Assignees

Labels

dotnetupWork items around the proposed `dotnetup` bootstrapper/toolchain management tool and libraryuntriagedRequest triage from a team member

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions