{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/25888754","id":25888754,"diff_hunk":"@@ -0,0 +1,63 @@\n+﻿// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.\n+\n+using System.Diagnostics;\n+using System.IO;\n+\n+namespace Microsoft.CodeAnalysis\n+{\n+    /// <summary>\n+    /// The compilation object is an immutable representation of a single invocation of the\n+    /// compiler. Although immutable, a compilation is also on-demand, and will realize and cache\n+    /// data as necessary. A compilation can produce a new compilation from existing compilation\n+    /// with the application of small deltas. In many cases, it is more efficient than creating a\n+    /// new compilation from scratch, as the new compilation can reuse information from the old\n+    /// compilation.\n+    /// </summary>\n+    public abstract partial class Compilation\n+    {\n+        /// <summary>\n+        /// Abstraction that allows the caller to delay the creation of the <see cref=\"Stream\"/> values \n+        /// until they are actually needed.\n+        /// </summary>\n+        internal abstract class EmitStreamProvider","path":"src/Compilers/Core/Portable/Compilation.EmitStreamProvider.cs","position":22,"original_position":22,"commit_id":"d925236b1e9d7d20f01b4ffbcc086a4d16bcfc95","original_commit_id":"d925236b1e9d7d20f01b4ffbcc086a4d16bcfc95","user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"body":"@AlekseyTs this API would be called immediately before returning hence it wouldn't provide any value over say just waiting for the compiler to return. ","created_at":"2015-03-05T18:36:58Z","updated_at":"2015-03-05T18:36:58Z","html_url":"https://github.com/dotnet/roslyn/pull/1032#discussion_r25888754","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/1032","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/25888754"},"html":{"href":"https://github.com/dotnet/roslyn/pull/1032#discussion_r25888754"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/1032"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/1032","id":30516244,"html_url":"https://github.com/dotnet/roslyn/pull/1032","diff_url":"https://github.com/dotnet/roslyn/pull/1032.diff","patch_url":"https://github.com/dotnet/roslyn/pull/1032.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/1032","number":1032,"state":"open","locked":false,"title":"Stop emitting assembly / PDB to a temp directory","user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"body":"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.\r\n\r\nRoslyn implemented this logic by doing the following:\r\n\r\n- Creating a `Stream` for the assembly / PDB in a temp directory.\r\n- Running the compilation.\r\n- Moving the `Stream` to the desired output location on success.\r\n\r\nThis 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.\r\n\r\nThis can produce breaks in cases where the temp and output directory have different inheritable ACLS.  This case comes up for instance in ASP.Net.\r\n\r\nTo 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).\r\n\r\nBecause 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.\r\n\r\nThis change also allows us to remove all of the temp directory logic from the compiler and build protocol.\r\n\r\nNote: 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.","created_at":"2015-03-04T23:34:47Z","updated_at":"2015-03-05T18:36:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0652579a7e522c3c01fe484a81901dacb54eac1","assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/1032/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/1032/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/1032/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/d925236b1e9d7d20f01b4ffbcc086a4d16bcfc95","head":{"label":"jaredpar:fix-temp","ref":"fix-temp","sha":"d925236b1e9d7d20f01b4ffbcc086a4d16bcfc95","user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"repo":{"id":29310774,"name":"roslyn","full_name":"jaredpar/roslyn","owner":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaredpar/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/jaredpar/roslyn","forks_url":"https://api.github.com/repos/jaredpar/roslyn/forks","keys_url":"https://api.github.com/repos/jaredpar/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaredpar/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaredpar/roslyn/teams","hooks_url":"https://api.github.com/repos/jaredpar/roslyn/hooks","issue_events_url":"https://api.github.com/repos/jaredpar/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/jaredpar/roslyn/events","assignees_url":"https://api.github.com/repos/jaredpar/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/jaredpar/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/jaredpar/roslyn/tags","blobs_url":"https://api.github.com/repos/jaredpar/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaredpar/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaredpar/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaredpar/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaredpar/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/jaredpar/roslyn/languages","stargazers_url":"https://api.github.com/repos/jaredpar/roslyn/stargazers","contributors_url":"https://api.github.com/repos/jaredpar/roslyn/contributors","subscribers_url":"https://api.github.com/repos/jaredpar/roslyn/subscribers","subscription_url":"https://api.github.com/repos/jaredpar/roslyn/subscription","commits_url":"https://api.github.com/repos/jaredpar/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaredpar/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaredpar/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaredpar/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaredpar/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/jaredpar/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaredpar/roslyn/merges","archive_url":"https://api.github.com/repos/jaredpar/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaredpar/roslyn/downloads","issues_url":"https://api.github.com/repos/jaredpar/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/jaredpar/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/jaredpar/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/jaredpar/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaredpar/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/jaredpar/roslyn/releases{/id}","created_at":"2015-01-15T18:10:36Z","updated_at":"2015-02-24T21:51:57Z","pushed_at":"2015-03-05T14:59:17Z","git_url":"git://github.com/jaredpar/roslyn.git","ssh_url":"git@github.com:jaredpar/roslyn.git","clone_url":"https://github.com/jaredpar/roslyn.git","svn_url":"https://github.com/jaredpar/roslyn","homepage":"","size":54482,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"7b82f7644de7b5cbcb9ada8bb5824faa44cb2181","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","created_at":"2015-01-11T02:39:03Z","updated_at":"2015-03-05T18:27:19Z","pushed_at":"2015-03-05T18:27:18Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":78911,"stargazers_count":1395,"watchers_count":1395,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":281,"mirror_url":null,"open_issues_count":497,"forks":281,"open_issues":497,"watchers":1395,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/1032"},"html":{"href":"https://github.com/dotnet/roslyn/pull/1032"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/1032"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/1032/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/1032/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/1032/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/d925236b1e9d7d20f01b4ffbcc086a4d16bcfc95"}}}}