Skip to content

Investigate consolidating ReplaceFilesWithSymbolicLinks into DeduplicateAssembliesWithLinks #52815

Open

Description

@MichaelSimons

Background

We now have two tasks that deduplicate files in the SDK layout by creating symbolic links:

ReplaceFilesWithSymbolicLinks DeduplicateAssembliesWithLinks
Input Two directories: Directory and LinkToFilesFrom Single directory: LayoutDirectory
Matching By filename (then verifies content) By content hash (filenames can differ)
Scope Links files from one known location to another Finds duplicates anywhere in the tree
Platform Unix only Cross-platform
Link type Symlinks only Hard links or symlinks
File types All files Assemblies only (.dll/.exe)

ReplaceFilesWithSymbolicLinks is used specifically to link runtime pack files to shared framework files, while DeduplicateAssembliesWithLinks is a general-purpose
deduplication task.

Proposal

Investigate whether ReplaceFilesWithSymbolicLinks can be removed in favor of DeduplicateAssembliesWithLinks, which would:

  • Simplify maintenance (one task instead of two)
  • Provide cross-platform support (including Windows)
  • Use a more robust content-hash-based approach

Investigation needed

  1. Determine what file types are actually linked by ReplaceFilesWithSymbolicLinks

    • If only assemblies (.dll/.exe), DeduplicateAssembliesWithLinks already covers this
    • If native libraries or other files are linked, DeduplicateAssembliesWithLinks would need to be extended
  2. Verify primary selection works correctly

    • DeduplicateAssembliesWithLinks selects the primary by depth (shallowest) then alphabetically
    • Shared framework files should be selected over runtime pack files (they're at a shallower depth)
  3. Consider extending DeduplicateAssembliesWithLinks to handle native libraries (.so, .dylib) if needed

Related

  • ReplaceFilesWithSymbolicLinks: src/Tasks/sdk-tasks/ReplaceFilesWithSymbolicLinks.cs
  • DeduplicateAssembliesWithLinks: src/Tasks/sdk-tasks/DeduplicateAssembliesWithLinks.cs
  • Usage in GenerateInstallerLayout.targets

Activity

  1. added
    untriaged
    on Feb 3, 2026
  2. dotnet-policy-service commented on Feb 3, 2026

    @dotnet-policy-service
    Contributor

    @dotnet/illink a new issue has been filed in the ILLink area, please triage

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ILLinkuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions