{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/25325","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/25325/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/25325/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/25325/events","html_url":"https://github.com/dotnet/roslyn/pull/25325","id":303275967,"number":25325,"title":"Implements targets that calculate PathMap from SourceRoots","user":{"login":"tmat","id":41759,"avatar_url":"https://avatars0.githubusercontent.com/u/41759?v=4","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":[{"id":166673288,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/32","html_url":"https://github.com/dotnet/roslyn/milestone/32","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/32/labels","id":2817494,"number":32,"title":"15.7","description":null,"creator":{"login":"sharwell","id":1408396,"avatar_url":"https://avatars1.githubusercontent.com/u/1408396?v=4","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"open_issues":223,"closed_issues":274,"state":"open","created_at":"2017-10-05T14:58:29Z","updated_at":"2018-03-27T19:59:35Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-03-07T22:00:52Z","updated_at":"2018-03-27T20:13:33Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/25325","html_url":"https://github.com/dotnet/roslyn/pull/25325","diff_url":"https://github.com/dotnet/roslyn/pull/25325.diff","patch_url":"https://github.com/dotnet/roslyn/pull/25325.patch"},"body":"### Customer scenario\r\n\r\nThis change is a piece in larger effort to make SourceLink easy to use, robust and compatible with deterministic builds.\r\n\r\nSee https://github.com/tmat/repository-info/tree/master/docs for an overview of the end-to-end scenario and https://github.com/Microsoft/msbuild/pull/2960 for a list of all components that support the scenario.\r\n\r\n### Bugs this fixes\r\n\r\nhttps://github.com/dotnet/roslyn/issues/25635\r\n\r\n### Workarounds, if any\r\n\r\n### Risk\r\n\r\nSmall.\r\n\r\n### Performance impact\r\n\r\nSmall.\r\n\r\n### Is this a regression from a previous update?\r\n\r\nNew feature.\r\n\r\n### Root cause analysis\r\n\r\n### How was the bug found?\r\n\r\n### Test documentation updated?\r\n\r\n### Implementation details\r\n\r\nThe data flow among msbuild targets involved here is a bit tricky. The high-level design assumes a set of producers and a set of consumers of source control information. Producing targets (e.g. target wrapping a `GitLib`) need to execute before consuming targets (e.g. AssemblyInformationalVersion generator, Roslyn compiler, NuSpec generator, etc.), thus they need to synchronize on an in-between target, which is `InitializeSourceControlInformation` target defined in Microsoft.Common.targets.\r\n\r\nSource control info producer populates `SourceRoot` items. They can also be populated from source packages or added manually to the project. \r\n`MapSourceRootPaths` takes `SourceRoot` items and adds `MappedPath` to metadata of each item. This is the path that the compiler will generate into the DLL/PDB. It's a path with a deterministic prefix if `Deterministic` is true, and the original path otherwise. \r\n`SourceRoot` then flows to the other target defined here that calculates `PathMap` based on the `MappedPath` metadata of each root. `PathMap` is then used by `csc` task.\r\n`SoruceRoot` also flows to Source Link generator target (which will be supplied by a SourceLink nuget package), which uses `MappedPath` and other info on the `SourceRoot` to generate `sourcelink.json` file that is passed to `csc` task.\r\n\r\n\r\nTODO:\r\n- [ ] Fix path map escaping issues: https://github.com/dotnet/roslyn/issues/22835, https://github.com/dotnet/roslyn/issues/23523\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/376659420","html_url":"https://github.com/dotnet/roslyn/pull/25325#issuecomment-376659420","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/25325","id":376659420,"user":{"login":"tmat","id":41759,"avatar_url":"https://avatars0.githubusercontent.com/u/41759?v=4","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":"2018-03-27T20:13:33Z","updated_at":"2018-03-27T20:13:33Z","author_association":"MEMBER","body":"test windows_debug_unit64_prtest  please"}}
{"actor":{"display_login":"tmat"}}