{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/12759","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/12759/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/12759/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/12759/events","html_url":"https://github.com/dotnet/roslyn/issues/12759","id":167701263,"number":12759,"title":"(Portable) Source Link","user":{"login":"tmat","id":41759,"avatar_url":"https://avatars.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Interactive","name":"Area-Interactive","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Interactive-Debugging","name":"Interactive-Debugging","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"tmat","id":41759,"avatar_url":"https://avatars.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"assignees":[{"login":"tmat","id":41759,"avatar_url":"https://avatars.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/23","html_url":"https://github.com/dotnet/roslyn/milestones/2.0%20(RC)","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/23/labels","id":1926441,"number":23,"title":"2.0 (RC)","description":"","creator":{"login":"ManishJayaswal","id":9527491,"avatar_url":"https://avatars.githubusercontent.com/u/9527491?v=3","gravatar_id":"","url":"https://api.github.com/users/ManishJayaswal","html_url":"https://github.com/ManishJayaswal","followers_url":"https://api.github.com/users/ManishJayaswal/followers","following_url":"https://api.github.com/users/ManishJayaswal/following{/other_user}","gists_url":"https://api.github.com/users/ManishJayaswal/gists{/gist_id}","starred_url":"https://api.github.com/users/ManishJayaswal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManishJayaswal/subscriptions","organizations_url":"https://api.github.com/users/ManishJayaswal/orgs","repos_url":"https://api.github.com/users/ManishJayaswal/repos","events_url":"https://api.github.com/users/ManishJayaswal/events{/privacy}","received_events_url":"https://api.github.com/users/ManishJayaswal/received_events","type":"User","site_admin":false},"open_issues":119,"closed_issues":20,"state":"open","created_at":"2016-08-06T00:01:13Z","updated_at":"2016-09-03T21:32:27Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2016-07-26T20:17:31Z","updated_at":"2016-09-03T21:34:12Z","closed_at":null,"body":"To complete the E2E experience with Portable PDBs (embedded or not), the debugger needs to be able to find out the sources for documents included in the PDB. In case of Windows PDB a post-build rewriter tool injects the source document URLs into the PDB. \r\n\r\nRewriting is not desirable. I propose we add a new compiler switch ```/sourcelink:<file>``` that tells the compiler to embed a blob into the PDB describing how to retrieve sources from a source control server. \r\nThis technique could be used for both Windows and Portable PDBs, although we would initially only support the switch when ```/debug:portable``` or ```/debug:embedded``` is also specified.\r\n\r\nIn case of Portable PDBs the content of the source link file would be in JSON format with the following structure:\r\n\r\n```JSON\r\n{\r\n  \"documents\": {\r\n     \"f:/build/*\" : \"https://raw.githubusercontent.com/OmniSharp/omnisharp-vscode/14fbdd1897c2993c0a08e224c8eb7c36b82e8cb8/*\"\r\n  }\r\n}\r\n```\r\n\r\nThe content of the file would be generated by a build task preceding csc task. The build task would be specific to source control used by the project (git, TFS, etc.) and would query the source control for the current commit sha and generate the corresponding URL to the .json file.\r\n\r\n**Implementation details**\r\n\r\nIn Portable PDB the source link data would be saved in a Custom Debug Information blob associated with the assembly.\r\n\r\nThe Portable PDB bridge would implement method already exposed on ```ISymUnmanagedReader4```:\r\n\r\n```C#\r\npublic int GetSourceServerData(out byte* data, out int size)\r\n```\r\n\r\nIt would read the CDI and return the raw content. The debugger would interpret the data.\r\n\r\n**An alternative approach** \r\n\r\nwould be to embed the source link file into the .dll itself as a managed resource (/resource:source_link.json). Although this would avoid compiler switch it would require a convention for the resource name. Unless we use some kind of GUID the resource name might collide with some resource that the project already has. Also it's odd that this information would be in the .dll and not where all other debug information is - in the .pdb (embedded or not). At the end of the day a dedicated compiler switch is imo cleaner."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/244570960","html_url":"https://github.com/dotnet/roslyn/issues/12759#issuecomment-244570960","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/12759","id":244570960,"user":{"login":"tmat","id":41759,"avatar_url":"https://avatars.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T21:34:12Z","updated_at":"2016-09-03T21:34:12Z","body":"Remaining work:\r\n[ ] Debugger support\r\n[ ] msbuild task/snippet to generate the .json file from GIT repo\r\n[ ] Project System UI\r\n[ ] E2E testing in .NET Core projects"}}
{"actor":{"display_login":"tmat"}}