You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ILLinker should special case facade assemblies #90469
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.
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?
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.
Activity
vitek-karas commentedon Aug 14, 2023
This is exactly what the
--skip-unresolvedflag 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-unresolvedthe 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
illinkoutside of the SDK? What is the scenario for that?Youssef1313 commentedon Aug 14, 2023
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.
Youssef1313 commentedon Aug 14, 2023
Assuming it's not a priority but a PR would be accepted, I opened #90512
sbomer commentedon Aug 16, 2023
Eventually I would like to explore getting rid of
--skip-unresolvedentirely. We could either use the--skip-unresolved truebehavior and get rid of the option to log warnings inside of AssemblyResolver, or we could go with the--skip-unresolved falsebehavior, 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.