1. 09 3月, 2015 1 次提交
    • J
      Stop emitting assembly / PDB to a temp directory · 22e86fe4
      Jared Parsons 提交于
      When a compilation fails the compiler should not delete or edit the outputs of a previous successful.  They should remain around to satisfy scenarios like F5 on build failure.
      
      Roslyn implemented this logic by doing the following:
      
      - Creating a `Stream` for the assembly / PDB in a temp directory.
      - Running the compilation.
      - Moving the `Stream` to the desired output location on success.
      
      This introduced a subtle bug into the compiler.  When the source + dest of `File.Move` are on the same volume the destination file will end up with the ACLs it got from being created in the source directory.  In this example it meant the assembly / PDB had the ACLs of the temp directory not the actual output one.
      
      This can produce breaks in cases where the temp and output directory have different inheritable ACLS.  This case comes up for instance in ASP.Net.
      
      To fix this we are going back to the native compiler behavior here.  The creation of the `Stream` objects will be delayed until we are ready to write to disk (happens after the compilation is verified to have no errors).
      
      Because this portion of the compiler is on .NET 4.5.2 the Emit layer cannot open the files directly (no file system API to use).  Instead we pass down the `EmitStreamProvider` abstraction from the desktop layer and let that control the openning of the files.
      
      This change also allows us to remove all of the temp directory logic from the compiler and build protocol.
      
      Note: Whether or not to make this entry point a public API is being considered separately from this thread.  If we decide to make this public it will be done as a separate follow up change.
      22e86fe4
  2. 08 3月, 2015 1 次提交
  3. 07 3月, 2015 6 次提交
  4. 06 3月, 2015 9 次提交
    • J
      Corrected the doc comment for CodeBlockAnalysisContext · 8d506a56
      John Hamby 提交于
      8d506a56
    • S
      Delete the public TriggerDiagnosticDescriptor type. · f1045fdd
      Shyam N 提交于
      And seal its base type DiagnosticDescriptor.
      
      (Fixes #789)
      f1045fdd
    • T
    • T
      Enable hosts to compile strong-named assemblies on all platforms by supplying... · f591db04
      Tomas Matousek 提交于
      Enable hosts to compile strong-named assemblies on all platforms by supplying public key via compilation options and also enable OSS signing with such key
      f591db04
    • J
      Diagnostics API changes for registering compilation actions, code block actions, and end actions · bbb448bb
      John Hamby 提交于
      This change set introduces the notions of registering compilation actions and code block actions into the diagnostics API. Compilation actions differ from compilation end actions in that they do not have access to per-compilation analyzer state and do not introduce action execution ordering constraints. Code block actions differ from code block end actions in that they do not have access to per-block analyzer state and do not introduce action execution ordering constraints.
      
      This change set also removes RegisterXEndAction methods on contexts other than the corresponding StartXAnalysisContext types. This change is intended to guide analyzer authors towards introducing analyzer state with appropriate lifetime.
      
      Some internal mechanism for the removed registration methods remains. This keeps the mechanism fully general and imposes a very marginal execution cost.
      
      The specific API changes:
       -- Removal of AnalysisContext.RegisterCompilationEndAction. CompilationStartAnalysisContext.RegisterCompilationEndAction remains.
       -- Removal of AnalysisContext.RegisterCodeBlockEndAction and CompilationStartAnalysisContext.RegisterCodeBlockEndAction. CodeBlockStartAnalysisContext.RegisterCodeBlockEndAction remains.
       -- Introduction of AnalysisContext.RegisterCompilationAction.
       -- Introduction of AnalysisContext.RegisterCodeBlockAction and CompilationStartAnalysisContext.RegisterCodeBlockAction.
       -- Renaming of CompilationEndAnalysisContext to CompilationAnalysisContext.
       -- Renaming of CodeBlockEndAnalysisContext to CodeBlockAnalysisContext.
      bbb448bb
    • M
      Fixes #950: Seal public methods of DiagnosticAnalyzer that can be overridden... · fb696001
      Manish Vasani 提交于
      Fixes #950: Seal public methods of DiagnosticAnalyzer that can be overridden and can throw: Equals,GetHashCode and ToString. This is required as we use analyzers as keys for various caches in our diagnostic engines.
      
      Also fix an issue pointed out by CyrusN: Don't report analyzer diagnostics for OperationCancelledException during analyzer execution.
      fb696001
    • P
      Remove Logger and RoslynCompilerEventSource · a28fda12
      Paul Harrington 提交于
      a28fda12
    • M
      Address CR feedback from Heejae: Avoid unnecessary... · 6349fc97
      Manish Vasani 提交于
      Address CR feedback from Heejae: Avoid unnecessary IEqualityComparer<AnalyzerAndOptions>, set concurrency level for concurrent dictionary, and add early out checks based on reference equality in added Equals overrides.
      6349fc97
    • J
      Fixed a path casing issue · 5d4f85f2
      Jared Parsons 提交于
      Looks like some of the MSBuild files got checked in under Src instead of
      src.  This corrects that.
      
      closes #1045
      5d4f85f2
  5. 05 3月, 2015 5 次提交
    • M
      Fix execution of CompilationStartActions when only analyzer options for the... · 37f0a943
      Manish Vasani 提交于
      Fix execution of CompilationStartActions when only analyzer options for the project change, but the underlying compilation is identical.
      
      Our current assumption for executing CompilationStartActions is that they should be executed exactly once per-compilation per-analyzer. We cache the registered nested actions for every compilation in AnalyzerManager to ensure this. However, if user just changes an additional document for the project, then the analyzer options change, but the underlying compilation is unchanged. Project change causes IDE diagnostic service to clear all cached diagnostics, but when re-computing diagnostics, we end up skipping execution of CompilationStartActions and directly move to nested compilation actions. This can be troublesome in couple of ways. First, we will have duplicate callbacks for all nested actions for the initially invoked compilation start action. Second, and event worse, if the analyzer is reading the contents of the additional documents in the start action and caching them for later use by the nested actions, all the nested actions get stale contents for the additional documents. Apparently, Tom is the first one to go through this agony as the DeclarePublicAPI analyzer that he implemented exactly does the latter.
      
      Fix is to ensure that we execute compilation start actions for every unique compilation start analysis context, i.e. {compilation, analyzer options} tuple for every analyzer.
      37f0a943
    • T
      cedeba0a
    • T
      SymbolEquivalenceComparer improvements: custom assembly comparer, handling... · 3387b3d4
      Tomas Matousek 提交于
      SymbolEquivalenceComparer improvements: custom assembly comparer, handling custom modifiers, comparing method return types
      3387b3d4
    • A
      Re-add the managed client to the build task. · a630d2f2
      Andy Gocke 提交于
      Brings back the managed client and reworks the two new build
      task specific tests to compile using the managed client inside
      the build task.
      a630d2f2
    • M
      Improve encoding support in syntaxTrees and documents · d5c8ffcf
      Matt Warren 提交于
      d5c8ffcf
  6. 04 3月, 2015 5 次提交
  7. 03 3月, 2015 2 次提交
    • M
      Address review feedback from Heejae: add DiagnosticDescriptor.WithOnException... · 4e120580
      Manish Vasani 提交于
      Address review feedback from Heejae: add DiagnosticDescriptor.WithOnException to create a new descriptor with hooked up exception handler for reporting exception diagnostics from LocalizableStrings, instead of mutating fields of LocalizableString implementations.
      4e120580
    • M
      This is the final change in the series of changes I have been making to ensure... · 51282e31
      Manish Vasani 提交于
      This is the final change in the series of changes I have been making to ensure that compiler and IDE are completely hardened against exceptions from analyzers.
      
      This change makes the DiagnosticDescriptor completely exception safe. Currently, DiagnosticDescriptor has lazily evaluated LocalizableString fields for Title, MessageFormat and Description. These have public extension points at ToString, Equals and GetHashCode methods, all of which can throw. These callbacks have now been wrapped within a try-catch for our LocalizableResourceString implementation of LocalizableString. For custom user implementations of LocalizableString (which should hopefully be rare), we wrap these within an ExceptionSafeLocalizableString which calls into the inner localizable string wrapped within a try-catch. All this is done within the DiagnosticDescriptor constructor, none of the clients have to explicitly handle the exception at use sites.
      51282e31
  8. 28 2月, 2015 6 次提交
  9. 27 2月, 2015 3 次提交
  10. 26 2月, 2015 2 次提交
    • J
      Remove vspscc files · c99336c1
      Jared Parsons 提交于
      These files are a hold over from when Roslyn was in TFS.  They aren't
      needed anymore now that we are in git.
      
      closes #858
      c99336c1
    • T
      Don't leak exceptions from AssemblyResolve handler · 7c338cb5
      Tom Meschter 提交于
      Leaking an exception from an `AppDomain.AssemblyResolve` event handler
      may interrupt the entire assembly resolution process, which is
      undesirable. Instead, we should just return null and give other handlers
      and/or the CLR a chance at assembly resolution.
      7c338cb5