Bugzilla – Bug 543537
gmcs should report about lacking inner reference even when the assemblies exist
Last modified: 2011-01-12 10:24:23 UTC
Created attachment 320682 [details] testcase User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.9.0.14) Gecko/2009090900 SUSE/3.0.14-0.1.2 Firefox/3.0.14 Unzip the testcase in a dir, and type make. Current results: Satisfactory compilation. Expected results: csc says "The type 'NSA.ClassA' is defined in an assembly that is not referenced. You must add a reference to assembly 'a, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'" Reproducible: Always
I'll look at this in the weekend.
Created attachment 320944 [details] Patch v.0.1 First version of the patch. This fixes the issue for me (it achieves the expected results). However, it needs some work yet.
Hey Marek. This patch fixes the issue, but: - It still lacks a diff for the Makefiles to make mono compile after the patch. - It's not a perfect fix because the information given is not as accurate as the one csc gives, but I think it's better than nothing (we could open a new bug to improve that). What do you think so far? Thanks (I'll keep working to finish it.)
#1: You cannot use string mscorlib_name = core_lib_name + ", Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; #2: Environment.Exit cannot be used Why do you need modify Makefile ?
Hey Marek, thanks for your comments! See inline: (In reply to comment #2) > ... > However, it needs some work yet. Forgot to say, that the patch also lacks a unit test. I'll work on that too. (In reply to comment #4) > #1: You cannot use > string mscorlib_name = core_lib_name + ", Version=2.0.0.0, Culture=neutral, > PublicKeyToken=b77a5c561934e089"; Why? How should I identify and white list this kind of system assemblies? > #2: Environment.Exit cannot be used Why? I see that it's used in other places. Let me guess: you say that because you prefer gmcs to still parse the sources and give other errors besides these ones? > Why do you need modify Makefile ? Well, if we commit this fix, the build of mono will fail as gmcs is now more strict. For example, one of the changes I had to do: Index: trunk/mcs/tools/gacutil/Makefile =================================================================== --- trunk/mcs/tools/gacutil/Makefile (revisión: 143331) +++ trunk/mcs/tools/gacutil/Makefile (copia de trabajo) @@ -2,7 +2,7 @@ SUBDIRS = include ../../build/rules.make -LOCAL_MCS_FLAGS = -r:Mono.Security.dll +LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll PROGRAM = $(topdir)/class/lib/$(PROFILE)/gacutil.exe Index: trunk/mcs/tools/security/Makefile =================================================================== --- trunk/mcs/tools/security/Makefile (revisión: 143331) +++ trunk/mcs/tools/security/Makefile (copia de trabajo) @@ -3,7 +3,7 @@ DIST_ONLY_SUBDIRS = certview include ../../build/rules.make -LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll +LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll -r:System.dll SECURITY_PROGRAMS = secutil.exe cert2spc.exe sn.exe makecert.exe chktrust.exe \ signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe
*** Bug 376876 has been marked as a duplicate of this bug. ***
Fixed in master