Bug 543537 - gmcs should report about lacking inner reference even when the assemblies exist
Summary: gmcs should report about lacking inner reference even when the assemblies exist
Status: RESOLVED FIXED
: 376876 (view as bug list)
Alias: None
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: All All
: P5 - None : Normal
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 411089
  Show dependency treegraph
 
Reported: 2009-10-01 15:29 UTC by Andres Aragoneses
Modified: 2011-01-12 10:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
testcase (842 bytes, application/zip)
2009-10-01 15:29 UTC, Andres Aragoneses
Details
Patch v.0.1 (3.32 KB, patch)
2009-10-03 23:26 UTC, Andres Aragoneses
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Aragoneses 2009-10-01 15:29:57 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
Comment 1 Andres Aragoneses 2009-10-02 18:53:26 UTC
I'll look at this in the weekend.
Comment 2 Andres Aragoneses 2009-10-03 23:26:26 UTC
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.
Comment 3 Andres Aragoneses 2009-10-03 23:30:35 UTC
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.)
Comment 4 Marek Safar 2009-10-04 10:14:40 UTC
#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 ?
Comment 5 Andres Aragoneses 2009-10-05 15:01:29 UTC
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
Comment 6 Marek Safar 2009-10-05 15:46:33 UTC
*** Bug 376876 has been marked as a duplicate of this bug. ***
Comment 8 Marek Safar 2011-01-12 10:24:23 UTC
Fixed in master