[Moonlight-list] [PATCH] Removal of MOON_A11Y_INTERNAL_HACK (was: Re: changes committed to the 2.0 branch)

Sebastien Pouliot sebastien.pouliot at gmail.com
Tue Nov 24 21:58:43 EST 2009


Hello,

The only extra thing worth mentioning is that today MoonAtkBridge works
only with the XPI (i.e. it won't be considered platform code otherwise,
so it just won't be able to work). Now that's likely not a big issue for
most users - at least until some distro begin to ship their own
packages. 

Except it also means that no moonlight developers will be using it "day
to day", like when running most of the tests. Which in turns means that
any breaking change will go unnoticed... until someone in a11y
finds/report the issue. But that's a limitation I have no problem living
with ;-)

Some comments on the patch itself...

On Tue, 2009-11-24 at 20:55 -0500, "Andrés G. Aragoneses" wrote:
> Index: class/corlib/Assembly/AssemblyInfo.cs
> ===================================================================
> --- class/corlib/Assembly/AssemblyInfo.cs       (revisión: 146453)
> +++ class/corlib/Assembly/AssemblyInfo.cs       (copia de trabajo)
> @@ -94,13 +94,7 @@
>         [assembly: InternalsVisibleTo ("System.Windows.Browser,
> PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
>         [assembly: InternalsVisibleTo ("System.Net,
> PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
>         [assembly: InternalsVisibleTo ("System.Runtime.Serialization,
> PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
> -
> -// this hack will be dropped once we get this working:
> -//
> http://www.mono-project.com/Moonlight/SecurityStatus#Assembly_Loading
> -#if MOON_A11Y_INTERNAL_HACK
>         [assembly: InternalsVisibleTo ("MoonAtkBridge,
> PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")]
> -#endif
> -
>         [assembly: InternalsVisibleTo ("System.ServiceModel,
> PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]
>         [assembly: InternalsVisibleTo ("System.ServiceModel.Web,
> PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
>         [assembly: InternalsVisibleTo ("System.Xml,
> PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
> 
> 
> 
> 
> 
> 
> 
> differences
> between files
> attachment
> (moon_hack_removal.diff)
> 
> Index: src/security.c
> ===================================================================
> --- src/security.c      (revisión: 146453)
> +++ src/security.c      (copia de trabajo)
> @@ -17,7 +17,6 @@
>  
>  static struct stat platform_stat;
>  
> -#if MOON_A11Y_INTERNAL_HACK_ENABLED
>  static struct stat platform_a11y_stat;
>  
>  void
> @@ -40,7 +39,6 @@
>         }
>  }
>  
> -#endif
>  
>  const static char* platform_code_assemblies [] = {
>         "mscorlib.dll",
> @@ -86,12 +84,10 @@
>                 return FALSE;
>         }
>         
> -#if MOON_A11Y_INTERNAL_HACK_ENABLED
>         if (g_ascii_strcasecmp (name, "MoonAtkBridge.dll") == 0) {
>                 the_platform_stat = platform_a11y_stat;
>                 a11y = TRUE;
>         }
> -#endif
>  
>         /* we avoid comparing strings, e.g. /opt/mono/lib/moon
> versus /opt/mono//lib/moon */
>         if ((the_platform_stat.st_mode != info.st_mode) ||
> @@ -135,9 +131,7 @@
>  
>                 if (stat (platform_dir, &platform_stat) == 0) {
>  
> -#if MOON_A11Y_INTERNAL_HACK_ENABLED
>                         a11y_stat_init (platform_dir);
> -#endif
>  
>                         mono_security_enable_core_clr ();
>                         mono_security_set_core_clr_platform_callback
> (determine_platform_image);
> Index: configure.ac
> ===================================================================
> --- configure.ac        (revisión: 146790)
> +++ configure.ac        (copia de trabajo)
> @@ -124,14 +124,6 @@
>  
>  DOCDIR=$(pkg-config --variable=sourcesdir monodoc)
>  
> -# this hack will be dropped once we get this working:
> -#
> http://www.mono-project.com/Moonlight/SecurityStatus#Assembly_Loading
> -if test "x$MOON_A11Y_INTERNAL_HACK" = "x1"; then
> -       AC_DEFINE([MOON_A11Y_INTERNAL_HACK_ENABLED], [1],
> -                 [Whether Mono A11y is enabled for now])
> -fi
> -AM_CONDITIONAL(MOON_A11Y_INTERNAL_HACK,test x$MOON_A11Y_INTERNAL_HACK
> = x1)
> -
>  if test x$with_ff3 = xyes; then
>     MOZILLA_CFLAGS=$FF3_CFLAGS
>  else
> Index: test/2.0/FakeA11yBridge/Makefile.am
> ===================================================================
> --- test/2.0/FakeA11yBridge/Makefile.am (revisión: 146790)
> +++ test/2.0/FakeA11yBridge/Makefile.am (copia de trabajo)
> @@ -1,9 +1,6 @@
> -SMCS = smcs -noconfig -codepage:utf8 -keyfile:mono-uia.snk
> -target:library
> +#don't define MOONLIGHT_ONLY when compiling on MS.NET
> +SMCS = smcs -noconfig -codepage:utf8 -keyfile:mono-uia.snk
> -target:library -define:MOONLIGHT_ONLY
>  
> -if MOON_A11Y_INTERNAL_HACK
> -SMCS += -define:MOON_A11Y_INTERNAL_HACK
> -endif
> -
>  CLEANFILES = \
>         $(wildcard *.dll)       \
>         $(wildcard *.mdb)
> Index: test/2.0/FakeA11yBridge/AttackVector.cs
> ===================================================================
> --- test/2.0/FakeA11yBridge/AttackVector.cs     (revisión: 146790)
> +++ test/2.0/FakeA11yBridge/AttackVector.cs     (copia de trabajo)
> @@ -30,7 +30,7 @@
>                 //sync this with one item of the file
> http://anonsvn.mono-project.com/source/trunk/moon/class/tuning/Descriptors/a11y.xml
>                 public int InternalsVisibleToCall ()
>                 {
> -#if MOON_A11Y_INTERNAL_HACK
> +#if MOONLIGHT_ONLY
>                         return new System.Collections.Hashtable
> ().Count;
>  #else
>                         throw new MethodAccessException ();
> Index: class/Moon.Windows.Desktop/Makefile.am
> ===================================================================
> --- class/Moon.Windows.Desktop/Makefile.am      (revisión: 146453)
> +++ class/Moon.Windows.Desktop/Makefile.am      (copia de trabajo)
> @@ -17,12 +17,6 @@
>  
>  CSCFLAGS = /codepage:65001 -d:SANITY -d:NET_1_1 -d:NET_2_0
> -d:MOONLIGHT -debug+ -noconfig -r:System -r:System.Core -r:System.Xml
> -d:AGCLR -unsafe
>  
> -## this hack will be dropped once we get this working:
> -##
> http://www.mono-project.com/Moonlight/SecurityStatus#Assembly_Loading
> -if MOON_A11Y_INTERNAL_HACK
> -CSCFLAGS += -define:MOON_A11Y_INTERNAL_HACK
> -endif
> -
>  GMCS = MONO_PATH="../lib/moonlight:$$MONO_PATH" gmcs $(CSCFLAGS)
> -lib:../lib/moonlight -d:NET_3_0
>  GACUTIL = gacutil /gacdir $(DESTDIR)$(prefix)/lib /root
> $(DESTDIR)$(prefix)/lib

Was that a copy/paste of another assembly ? (I don't think the variable
is used inside this directory) or is A11Y meant to be supported on the
desktop (without firefox) ?


> Index: class/System.Windows/Assembly/AssemblyInfo.cs
> ===================================================================
> --- class/System.Windows/Assembly/AssemblyInfo.cs       (revisión:
> 146453)
> +++ class/System.Windows/Assembly/AssemblyInfo.cs       (copia de
> trabajo)
> @@ -101,6 +101,4 @@
>  [assembly: InternalsVisibleTo ("System.Windows.Browser,
> PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
>  [assembly: InternalsVisibleTo ("Moonlight.Gtk,
> PublicKey=002400000480000094000000060200000024000052534131000400001100000005E62DA51722818A2ADC73D5CE64289260012A442031582E808F5C290EF155F10AB93441F92A7A59736D3481245ED4E0E864F5E1ACCADD217D53EE0263E6E3852FE94AB6B708984C6C69BA79F40A0896E1FFF820B7C55D4968C8F41CAE2AABC136B16B8AF83D013946CE190BC03C2A6C8DE8C0CB135ED656F46BF9A2D03E8188")]
>  #endif
> -#if MOON_A11Y_INTERNAL_HACK
>  [assembly: InternalsVisibleTo ("MoonAtkBridge,
> PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")]
> -#endif

Like previous. If this is for firefox *only* then it should be inside
the NET_2_1 define (and not present for NET_3_0).

> Index: class/System.Windows/Makefile.am
> ===================================================================
> --- class/System.Windows/Makefile.am    (revisión: 146453)
> +++ class/System.Windows/Makefile.am    (copia de trabajo)
> @@ -29,12 +29,6 @@
>  
>  CSCFLAGS = /codepage:65001 -d:SANITY -d:NET_1_1 -d:NET_2_0
> -d:MOONLIGHT -debug+ -noconfig -r:System -r:System.Core -r:System.Xml
> -d:AGCLR -unsafe
>  
> -## this hack will be dropped once we get this working:
> -##
> http://www.mono-project.com/Moonlight/SecurityStatus#Assembly_Loading
> -if MOON_A11Y_INTERNAL_HACK
> -CSCFLAGS += -define:MOON_A11Y_INTERNAL_HACK
> -endif
> -
>  GMCS = MONO_PATH="../lib/moonlight:../lib/moonlight-bootstrap:
> $$MONO_PATH" gmcs $(CSCFLAGS)
> -lib:../lib/moonlight,../lib/moonlight-bootstrap -d:NET_3_0
>  SMCS = MONO_PATH="../lib/2.1:../lib/2.1-bootstrap:$$MONO_PATH" mono
> --runtime=moonlight --security=temporary-smcs-hack ../lib/2.1/smcs.exe
> -r:System.Net $(CSCFLAGS)
>  GACUTIL = gacutil /gacdir $(DESTDIR)$(prefix)/lib /root
> $(DESTDIR)$(prefix)/lib
> Index: class/System.Windows/Mono/A11yHelper.cs
> ===================================================================
> --- class/System.Windows/Mono/A11yHelper.cs     (revisión: 146453)
> +++ class/System.Windows/Mono/A11yHelper.cs     (copia de trabajo)
> @@ -40,7 +40,6 @@
>  
>                 internal static void Initialize ()
>                 {
> -#if MOON_A11Y_INTERNAL_HACK
>                         string current_assembly_location =
> Assembly.GetExecutingAssembly ().Location;
>                         
>                         //please keep this lookup pattern in sync with
> the one in security.c (security_enable_coreclr() method)
> @@ -99,7 +98,6 @@
> 
> BindingFlags.InvokeMethod)
>                                                                                .Invoke (automation_bridge, null);
>                         return accessible;
> -#endif
>                 }
>         }
>  } 

Great work BTW. I'm glad to see this going on the "by default" road :-)

Sebastien



More information about the Moonlight-list mailing list