Boo
  1. Boo
  2. BOO-1117

Allow compilation for Silverlight profile

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8.2
    • Fix Version/s: 0.9
    • Component/s: Compiler
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      Currently Boo cannot compile with Silverlight profile (--nostdlib then references to Silverlight assemblies) because of some missing attributes that we check.

      Attached patch fixes this. Testsuite does not regress.
      However since I'm not sure why this code path was not enabled until now please confirm patch is ok to commit.

        Activity

        Hide
        Cedric Vivier added a comment -

        Error was:

        Entering Boo.Lang.Compiler.Steps.InitializeNameResolutionService
        Leaving Boo.Lang.Compiler.Steps.InitializeNameResolutionService
        BCE0106: Boo.Lang.Compiler.CompilerError: Failed to access the types defined in
        assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec8
        5d7bea7798e' - (C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assem
        blies\System.Windows.dll): Could not load type 'System.Security.SecuritySafeCrit
        icalAttribute' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, Public
        KeyToken=b77a5c561934e089'.. ---> System.TypeLoadException: Could not load type
        'System.Security.SecuritySafeCriticalAttribute' from assembly 'mscorlib, Version
        =2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
           at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeIn
        stArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInst
        Count)
           at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[]
         typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
           at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTy
        peArguments, Type[] genericMethodArguments)
           at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttrib
        uteRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module
        decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType,
        Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, Runtime
        Type& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Bool
        ean& isVarArg)
           at System.Reflection.CustomAttribute.IsCustomAttributeDefined(Module decorate
        dModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean
        mustBeInheritable)
           at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType
        caType, Boolean inherit)
           at System.RuntimeType.IsDefined(Type attributeType, Boolean inherit)
           at System.Attribute.IsDefined(MemberInfo element, Type attributeType, Boolean
         inherit)
           at System.Attribute.IsDefined(MemberInfo element, Type attributeType)
           at Boo.Lang.Compiler.TypeSystem.MetadataUtil.IsAttributeDefined(MemberInfo me
        mber, Type attributeType)
           at Boo.Lang.Compiler.TypeSystem.TypeSystemServices.IsModule(Type type)
           at Boo.Lang.Compiler.TypeSystem.NamespaceEntity.Add(Type type)
           at Boo.Lang.Compiler.TypeSystem.NameResolutionService.CatalogPublicTypes(Type
        [] types)
           at Boo.Lang.Compiler.TypeSystem.NameResolutionService.OrganizeAssemblyTypes(A
        ssembly asm)
           at Boo.Lang.Compiler.Steps.InitializeNameResolutionService.OrganizeExternalNa
        mespaces()
        
        Show
        Cedric Vivier added a comment - Error was: Entering Boo.Lang. Compiler .Steps.InitializeNameResolutionService Leaving Boo.Lang. Compiler .Steps.InitializeNameResolutionService BCE0106: Boo.Lang. Compiler .CompilerError: Failed to access the types defined in assembly ' System .Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec8 5d7bea7798e' - (C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assem blies\ System .Windows.dll): Could not load type ' System .Security.SecuritySafeCrit icalAttribute' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, Public KeyToken=b77a5c561934e089'.. ---> System .TypeLoadException: Could not load type ' System .Security.SecuritySafeCriticalAttribute' from assembly 'mscorlib, Version =2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at System .ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeIn stArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInst Count) at System .ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System .Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTy peArguments, Type[] genericMethodArguments) at System .Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttrib uteRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object [] attributes, IList derivedAttributes, Runtime Type& attributeType, RuntimeMethodHandle& ctor, Boolean & ctorHasParameters, Bool ean& isVarArg) at System .Reflection.CustomAttribute.IsCustomAttributeDefined(Module decorate dModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable) at System .Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, Boolean inherit) at System .RuntimeType.IsDefined(Type attributeType, Boolean inherit) at System .Attribute.IsDefined(MemberInfo element, Type attributeType, Boolean inherit) at System .Attribute.IsDefined(MemberInfo element, Type attributeType) at Boo.Lang. Compiler .TypeSystem.MetadataUtil.IsAttributeDefined(MemberInfo me mber, Type attributeType) at Boo.Lang. Compiler .TypeSystem.TypeSystemServices.IsModule(Type type) at Boo.Lang. Compiler .TypeSystem.NamespaceEntity.Add(Type type) at Boo.Lang. Compiler .TypeSystem.NameResolutionService.CatalogPublicTypes(Type [] types) at Boo.Lang. Compiler .TypeSystem.NameResolutionService.OrganizeAssemblyTypes(A ssembly asm) at Boo.Lang. Compiler .Steps.InitializeNameResolutionService.OrganizeExternalNa mespaces()
        Hide
        Rodrigo B. de Oliveira added a comment -

        Patch looks good.

        Show
        Rodrigo B. de Oliveira added a comment - Patch looks good.
        Hide
        Cedric Vivier added a comment -

        Fixed in rev. 3122

        Show
        Cedric Vivier added a comment - Fixed in rev. 3122

          People

          • Assignee:
            Cedric Vivier
            Reporter:
            Cedric Vivier
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: