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

Add NetCoreAppCurrent rid agnostic tfm to libs #64518

Merged
merged 2 commits into from
Feb 1, 2022

Commits on Jan 31, 2022

  1. Add NetCoreAppCurrent rid agnostic tfm to libs

    This change adds a NetCoreAppCurrent rid-less configuration which throws
    a PNSE to the following libraries:
    - System.Console
    - System.IO.Compression.ZipFile
    - System.IO.Compression
    - System.IO.FileSystem.DriveInfo
    - System.IO.MemoryMappedFiles
    - System.Net.Http
    - System.Net.Mail
    - System.Net.NameResolution
    - System.Net.Primitives
    - System.Net.Requests
    - System.Net.WebSockets
    
    System.Private.Runtime.InteropServices.JavaScript is excluded from that
    list as it doesn't have a contract and hence can't generate a PNSE
    assembly. Also it's currently a private assembly.
    
    These are the only libraries that were missing a RID agnostic tfm.
    
    Adding rid-less configurations, even if they just throw PNSEs helps with:
    - Platform enablement, i.e. a new "base" platforms like "Browser" usually
      require libraries that are RID specific to support them. By offering a
      RID agnostic PNSE tfm, projects can gradually support new platforms.
    - Making it possible to have ProjectReferences between libraries, i.e.
      imagine an microsoft.build.notargets / microsoft.build.traversal
      project with a `$(NetCoreAppCurrent)-$(TargetOS)` tfm which P2Ps all
      source projects. NuGet can't know that a $(NetCoreAppCurrent)-Linux
      tfm can reference a project with a $(NetCoreAppCurrent)-Unix tfm and
      will throw during restore, more precisely during the compatibility
      check. Ideally NuGet or the SDK would support targeting platforms from
      the runtime.json RID graph, including its compatiblity matrix but
      that isn't the case today.
    
    Even though the added tfms add to the build, I have other changes
    in the pipeline which depend on this one which will make the build
    noticeably faster.
    ViktorHofer committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    75281ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4783bee View commit details
    Browse the repository at this point in the history