Repository navigation
Add tests cover using statement difference between mcs and csc. - #399
marek-safar merged 1 commit into
Conversation
|
This looks to me like csc bug (will report that to get the consensus though). |
|
@marek-safar looks like the roslyn issue was closed as |
|
@mrvoorhe please do |
|
I took a brief look at trying to detect the The scenario where this was causing us problems has gone away due to some other unrelated changes. So as long as w/e the linker does results in references that exist on disk everything is fine. It looks like SweepStep will already remove all references to assemblies that are deleted, regardless of what the assembly action was. I will update the expected behavior when |
Add new [KeptReferencesInAssembly] attribute for asserting the expected references in an assembly
c524601 to
ad0cdf6
Compare
|
@marek-safar PR is ready for review. It's now a test only change as the current behavior of the linker is correct |
@marek-safar I could use your opinion on whether or not you think this is a bug in the linker.
This PR contains just tests to reproduce what I think is a bug. I did not implement a fix yet. I wanted to confirm whether or not you think it is a bug before I spend time on a fix.
AssemblyOnlyUsedByUsingWithCscis the test that currently fails and I think it should pass.What it does is
Compile an assembly called
library.dllCompile an assembly called
copied.dllthat makes use oflibrary.dllwith only the following codeAnd
copied.dllis setup to haveAssemblyAction.CopyAnd most importantly, compile
copied.dllwithcscNote that
cscwill include a reference tolibrary.dllincopied.dllwhere asmcswill not.AssemblyOnlyUsedByUsingWithCscfails because I have an assert expecting thatlibrary.dllsurvives stripping. I think this is a valid assertion given thatcopied.dllreferenceslibrary.dllandcopied.dllhadAssemblyAction.Copy.It seems to me that there is a bug in that references of an assembly with AssemblyAction.Copy should always exist after stripping, even if they've been stripped down to empty assemblies. Would you agree? What are your thoughts?
Note that I added the test
AssemblyOnlyUsedByUsingWithMcsjust to show what happens withmcs. This test passes.