{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/135542698","pull_request_review_id":58962553,"id":135542698,"diff_hunk":"@@ -332,16 +333,15 @@ REM === Build the CLR VM\n REM ===\n REM =========================================================================================\n \n-if %__BuildNative% EQU 1 ( \n+if %__BuildNative% EQU 1 (\n+    REM Scope environment changes start {\n+    setlocal","path":"build.cmd","position":24,"original_position":24,"commit_id":"fdc8bc20e453c928e0c2c4f4fb64c8003fcc0647","original_commit_id":"fdc8bc20e453c928e0c2c4f4fb64c8003fcc0647","user":{"login":"JosephTremoulet","id":10655216,"avatar_url":"https://avatars3.githubusercontent.com/u/10655216?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephTremoulet","html_url":"https://github.com/JosephTremoulet","followers_url":"https://api.github.com/users/JosephTremoulet/followers","following_url":"https://api.github.com/users/JosephTremoulet/following{/other_user}","gists_url":"https://api.github.com/users/JosephTremoulet/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephTremoulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephTremoulet/subscriptions","organizations_url":"https://api.github.com/users/JosephTremoulet/orgs","repos_url":"https://api.github.com/users/JosephTremoulet/repos","events_url":"https://api.github.com/users/JosephTremoulet/events{/privacy}","received_events_url":"https://api.github.com/users/JosephTremoulet/received_events","type":"User","site_admin":false},"body":"Since you're adding `setlocal` anyway, would an explicit `ENABLEDELAYEDEXPANSION` be a good idea?  I see the script is already using it, so it must be fine to rely on it, I'm just curious.","created_at":"2017-08-28T14:43:26Z","updated_at":"2017-08-28T14:43:54Z","html_url":"https://github.com/dotnet/coreclr/pull/13605#discussion_r135542698","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/13605","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/135542698"},"html":{"href":"https://github.com/dotnet/coreclr/pull/13605#discussion_r135542698"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13605"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/13605","id":137777516,"html_url":"https://github.com/dotnet/coreclr/pull/13605","diff_url":"https://github.com/dotnet/coreclr/pull/13605.diff","patch_url":"https://github.com/dotnet/coreclr/pull/13605.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/13605","number":13605,"state":"open","locked":false,"title":"Scope build script environment variable setting","user":{"login":"BruceForstall","id":10901265,"avatar_url":"https://avatars3.githubusercontent.com/u/10901265?v=4","gravatar_id":"","url":"https://api.github.com/users/BruceForstall","html_url":"https://github.com/BruceForstall","followers_url":"https://api.github.com/users/BruceForstall/followers","following_url":"https://api.github.com/users/BruceForstall/following{/other_user}","gists_url":"https://api.github.com/users/BruceForstall/gists{/gist_id}","starred_url":"https://api.github.com/users/BruceForstall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BruceForstall/subscriptions","organizations_url":"https://api.github.com/users/BruceForstall/orgs","repos_url":"https://api.github.com/users/BruceForstall/repos","events_url":"https://api.github.com/users/BruceForstall/events{/privacy}","received_events_url":"https://api.github.com/users/BruceForstall/received_events","type":"User","site_admin":false},"body":"The product and test build scripts invoke Visual Studio environment\r\nsetting scripts several times during the build process. If doing a full\r\ncross architecture build including test build, it's as many as five times.\r\nThese environment changes are cumulative. For the PATH variable, in\r\nparticular, they can lead to a failure by exceeding the variable\r\nlength limit. This seems to have been exacerbated by VS2017, which\r\nhas very long paths, and for which many things are added to the PATH.\r\n\r\nFix this by adding \"setlocal\" / \"endlocal\" around various sections\r\nof the scripts, so that the multiple calls to the environment script\r\nare not cumulative.\r\n\r\n(There is still some cumulative environment setting, as build.cmd\r\ncalls VsDevCmd.bat, then if tests are being built, calls build-test.cmd,\r\nwhich also calls VsDevCmd.bat, and then possibly in addition calls\r\nvcvarsall.bat.)\r\n\r\nIn addition, I simplified the code that sets up the msbuild logging\r\nparameters, so it is more readable, regular, and doesn't have so\r\nmuch repeated text.","created_at":"2017-08-26T00:22:33Z","updated_at":"2017-08-28T14:43:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fc93b575bef026da737ba92d11410169130be89","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/13605/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/13605/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/13605/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/fdc8bc20e453c928e0c2c4f4fb64c8003fcc0647","head":{"label":"BruceForstall:ScopeEnvSettings","ref":"ScopeEnvSettings","sha":"fdc8bc20e453c928e0c2c4f4fb64c8003fcc0647","user":{"login":"BruceForstall","id":10901265,"avatar_url":"https://avatars3.githubusercontent.com/u/10901265?v=4","gravatar_id":"","url":"https://api.github.com/users/BruceForstall","html_url":"https://github.com/BruceForstall","followers_url":"https://api.github.com/users/BruceForstall/followers","following_url":"https://api.github.com/users/BruceForstall/following{/other_user}","gists_url":"https://api.github.com/users/BruceForstall/gists{/gist_id}","starred_url":"https://api.github.com/users/BruceForstall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BruceForstall/subscriptions","organizations_url":"https://api.github.com/users/BruceForstall/orgs","repos_url":"https://api.github.com/users/BruceForstall/repos","events_url":"https://api.github.com/users/BruceForstall/events{/privacy}","received_events_url":"https://api.github.com/users/BruceForstall/received_events","type":"User","site_admin":false},"repo":{"id":30471921,"name":"coreclr","full_name":"BruceForstall/coreclr","owner":{"login":"BruceForstall","id":10901265,"avatar_url":"https://avatars3.githubusercontent.com/u/10901265?v=4","gravatar_id":"","url":"https://api.github.com/users/BruceForstall","html_url":"https://github.com/BruceForstall","followers_url":"https://api.github.com/users/BruceForstall/followers","following_url":"https://api.github.com/users/BruceForstall/following{/other_user}","gists_url":"https://api.github.com/users/BruceForstall/gists{/gist_id}","starred_url":"https://api.github.com/users/BruceForstall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BruceForstall/subscriptions","organizations_url":"https://api.github.com/users/BruceForstall/orgs","repos_url":"https://api.github.com/users/BruceForstall/repos","events_url":"https://api.github.com/users/BruceForstall/events{/privacy}","received_events_url":"https://api.github.com/users/BruceForstall/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BruceForstall/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection. The repo contains the complete up-to-date CoreCLR codebase.","fork":true,"url":"https://api.github.com/repos/BruceForstall/coreclr","forks_url":"https://api.github.com/repos/BruceForstall/coreclr/forks","keys_url":"https://api.github.com/repos/BruceForstall/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BruceForstall/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BruceForstall/coreclr/teams","hooks_url":"https://api.github.com/repos/BruceForstall/coreclr/hooks","issue_events_url":"https://api.github.com/repos/BruceForstall/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/BruceForstall/coreclr/events","assignees_url":"https://api.github.com/repos/BruceForstall/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/BruceForstall/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/BruceForstall/coreclr/tags","blobs_url":"https://api.github.com/repos/BruceForstall/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BruceForstall/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BruceForstall/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/BruceForstall/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BruceForstall/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/BruceForstall/coreclr/languages","stargazers_url":"https://api.github.com/repos/BruceForstall/coreclr/stargazers","contributors_url":"https://api.github.com/repos/BruceForstall/coreclr/contributors","subscribers_url":"https://api.github.com/repos/BruceForstall/coreclr/subscribers","subscription_url":"https://api.github.com/repos/BruceForstall/coreclr/subscription","commits_url":"https://api.github.com/repos/BruceForstall/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/BruceForstall/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/BruceForstall/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/BruceForstall/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/BruceForstall/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/BruceForstall/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BruceForstall/coreclr/merges","archive_url":"https://api.github.com/repos/BruceForstall/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BruceForstall/coreclr/downloads","issues_url":"https://api.github.com/repos/BruceForstall/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/BruceForstall/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/BruceForstall/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/BruceForstall/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BruceForstall/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/BruceForstall/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/BruceForstall/coreclr/deployments","created_at":"2015-02-07T22:04:54Z","updated_at":"2017-07-14T07:39:06Z","pushed_at":"2017-08-26T00:33:01Z","git_url":"git://github.com/BruceForstall/coreclr.git","ssh_url":"git@github.com:BruceForstall/coreclr.git","clone_url":"https://github.com/BruceForstall/coreclr.git","svn_url":"https://github.com/BruceForstall/coreclr","homepage":"","size":174387,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":false,"has_projects":true,"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":2,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"18ee973ffcc068e64f31f4c2b3d0c342c661c259","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called System.Private.Corelib (or mscorlib). It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2017-08-28T08:36:01Z","pushed_at":"2017-08-28T13:17:34Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://github.com/dotnet/core","size":177086,"stargazers_count":8047,"watchers_count":8047,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2044,"mirror_url":null,"open_issues_count":1405,"forks":2044,"open_issues":1405,"watchers":8047,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13605"},"html":{"href":"https://github.com/dotnet/coreclr/pull/13605"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/13605"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/13605/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13605/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13605/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/fdc8bc20e453c928e0c2c4f4fb64c8003fcc0647"}}}}
{"actor":{"display_login":"JosephTremoulet"}}