What is the expected behavior when a reference is missing?#90261
Conversation
|
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas Issue DetailsI've been fighting with some tests in our UnityLinker suite that verify our behavior when a reference is missing. What I need to know to get unblocked is what the design intend is of illink. I've had a hard time figuring out what the excepted behavior is. The Here are the two tests.
|
|
In practice we always pass The reason we want to tolerate resolution errors is that often apps include the We probably have quite inconsistent use of |
😂 That is the exact issue giving me grief in some of ours tests.
I didn't realize that. That's good to know.
That definitely works. And if it were not for
Which is why I wasn't sure on the expected behavior. |
I was trying to figure out the intent as well. if there is a desire to tolerate unresolved references in unused code paths, then I see the value of having |
|
I'm going to polish off the tests in this PR to assert the current behavior. I'll leave it to you guys to figure out whether or not the current behavior is the desired behavior. |
4e4219f to
79d4a53
Compare
|
I updated the failing test to assert the current behavior. If CI is green the PR is ready to merge. |
I've been fighting with some tests in our UnityLinker suite that verify our behavior when a reference is missing. What I need to know to get unblocked is what the design intend is of illink. I've had a hard time figuring out what the excepted behavior is. The
TryResolvecalls andprobinglogic inAssemblyResolverlead me to believe there are times when an unresolved assembly shouldn't be treated as an error. However, after porting some of our tests to ilink's suite I see that an unresolved reference is fatal regardless of whether or not it's in a used code path.Here are the two tests.
MissingReferenceInUsedCodePath- This test passes as expected. An exit code of 1 is returned.MissingReferenceInUnusedCodePath- This test is where I'm unclear what the expected behavior is. Should the linker fail or pass in this case? Currently it fails.DiscoverDynamicCastableImplementationInterfacestriggers a resolve failure which leads to the linker failing.SweepAssemblyReferencesalso leads to a resolve failure.@vitek-karas @marek-safar ?