Skip to content

ILLinker should special case facade assemblies #90469

Closed

Description

@Youssef1313

Description

See #82169

There are known assemblies that has some reference assemblies that may not be existing. The case I was seeing is System.Runtime.Serialization -> System.Runtime.Serialization.Schema.

When not using --skip-unresolved flag of the linker, it reports IL1009 error since it couldn't resolve System.Runtime.Serialization.Schema.

Reproduction Steps

I don't have an isolated repro right now. But the case was exactly that System.Runtime.Serialization.Schema can't be resolved.

Expected behavior

As #82169 (comment) outlines:

Basically, those specific handful of libraries should be treated as special and not resolved for dependency analysis.

Actual behavior

IL1009

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. ghost added
    needs-area-label
    on Aug 12, 2023
  2. ghost added
    untriaged
    on Aug 12, 2023
  3. added
    area-Tools-ILLink
    on Aug 12, 2023
  4. removed
    needs-area-label
    on Aug 12, 2023
  5. vitek-karas commented on Aug 14, 2023

    @vitek-karas
    Member

    This is exactly what the --skip-unresolved flag is for. There are lot of assemblies which has references to code which may not be part of the app - both in the framework but also in nugets and everywhere else. Special casing some assemblies would not really solve the problem. In the framework this most frequently happens with facade assemblies, but outside of framework facade assemblies are very rare, but the same issue still exists. I don't know of a good way to detect assemblies like that- other than they have unresolvable reference.

    I think a better argument would be to make --skip-unresolved the default behavior even on the command line - it already is the default when running the trimmer from the SDK. But since SDK already does this, the priority of changing the command line behavior is pretty low.

    Curious: are you running illink outside of the SDK? What is the scenario for that?

  6. added this to the Future milestone on Aug 14, 2023
  7. ghost removed
    untriaged
    on Aug 14, 2023
  8. Youssef1313 commented on Aug 14, 2023

    @Youssef1313
    MemberAuthor

    Yes, running outside of the SDK. I'll try to get more info for "what is the scenario for that" question as I don't have enough context on it.

  9. Youssef1313 commented on Aug 14, 2023

    @Youssef1313
    MemberAuthor

    Assuming it's not a priority but a PR would be accepted, I opened #90512

  10. sbomer commented on Aug 16, 2023

    @sbomer
    Member

    Eventually I would like to explore getting rid of --skip-unresolved entirely. We could either use the --skip-unresolved true behavior and get rid of the option to log warnings inside of AssemblyResolver, or we could go with the --skip-unresolved false behavior, and special-case the few places that need to be resistant to resolution failures with custom resolution logic that doesn't go through cecil and then our AssemblyResolver. I think this is mostly limited to forwarders.

  11. ghost locked as resolved and limited conversation to collaborators on Oct 2, 2023
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-Tools-ILLink

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions