{"action":"created","comment":{"url":"https://api.github.com/repos/WebAssembly/experimental/pulls/comments/46761344","id":46761344,"diff_hunk":"@@ -51,69 +62,79 @@ def Remove(path):\n     os.remove(path)\n \n \n+def GitConfigRebaseMaster(cwd):\n+  subprocess.check_call(\n+    ['git', 'config', 'branch.master.rebase', 'true'], cwd=cwd)\n+\n+\n def FindPriorRev(path, goal):\n   revs = subprocess.check_output(\n       ['git', 'rev-list', 'origin/master'], cwd=path).splitlines()\n   for rev in revs:\n-    num = int(subprocess.check_output(\n-        ['git', 'svn', 'find-rev', rev], cwd=path).strip())\n-    if num <= goal:\n+    num = subprocess.check_output(\n+        ['git', 'svn', 'find-rev', rev], cwd=path).strip()\n+    if int(num) <= goal:\n       return num\n   raise Error('Cannot find clang rev at or before %d' % goal)\n \n \n-def Sync():\n+def SyncLLVMClang():\n   BuildStep('Sync LLVM')\n   Chdir(SCRIPT_DIR)\n   Mkdir(WORK_DIR)\n   if os.path.exists(LLVM_DIR):\n     print 'LLVM directory already exists'\n   else:\n-    print 'Cloning llvm and clang'\n-    subprocess.check_call(\n-        ['git', 'clone',\n-         'https://chromium.googlesource.com/chromiumos/third_party/llvm',\n-         LLVM_DIR])\n-    subprocess.check_call(\n-        ['git', 'config', 'branch.master.rebase', 'true'], cwd=LLVM_DIR)\n-    subprocess.check_call(\n-        ['git', 'clone',\n-         'https://chromium.googlesource.com/chromiumos/third_party/clang',\n-         CLANG_DIR])\n-    subprocess.check_call(\n-        ['git', 'config', 'branch.master.rebase', 'true'], cwd=CLANG_DIR)\n-  print 'Syncing llvm'\n+    print 'Cloning LLVM and Clang'\n+    subprocess.check_call(['git', 'clone', LLVM_GIT, LLVM_DIR])\n+    GitConfigRebaseMaster(LLVM_DIR)\n+    subprocess.check_call(['git', 'clone', CLANG_GIT, CLANG_DIR])\n+    GitConfigRebaseMaster(CLANG_DIR)\n+  print 'Syncing LLVM'\n   subprocess.check_call(['git', 'fetch'], cwd=LLVM_DIR)\n   subprocess.check_call(['git', 'checkout', LLVM_REVISION], cwd=LLVM_DIR)\n-  print 'Getting svn rev'\n+  print 'Getting SVN rev'\n   svn_rev = int(subprocess.check_output(\n       ['git', 'svn', 'find-rev', 'HEAD'], cwd=LLVM_DIR).strip())\n   print 'SVN REV: %d' % svn_rev\n-  print 'Finding prior clang rev'\n+  print 'Finding prior Clang rev'\n   subprocess.check_call(['git', 'fetch'], cwd=CLANG_DIR)\n   prior_rev = FindPriorRev(CLANG_DIR, svn_rev)\n-  print 'Checking out clang rev: %s' % prior_rev\n-  subprocess.check_call(['git', 'checkout', prior_rev], cwd=CLANG_DIR)\n+  print 'Checking out Clang rev: %s' % prior_rev\n+  # TODO: broken, should this be:\n+  #       ['git', 'svn', 'log', '--show-commit', '--revision=%s' % prior_rev]\n+  #subprocess.check_call(['git', 'checkout', prior_rev], cwd=CLANG_DIR)\n+  return svn_rev\n \n-  if os.path.exists(CHROMIUM_CLANG_TOOLS_CLANG):\n-    print 'Chromium clang directory already exists'\n+\n+def SyncGCC():\n+  if os.path.exists(GCC_DIR):\n+    print 'GCC directory already exists'\n   else:\n-    print 'Cloning chromium clang directory'\n-    Mkdir(CHROMIUM_CLANG)\n-    Mkdir(CHROMIUM_CLANG_TOOLS)\n-    subprocess.check_call(\n-        ['git', 'clone',\n-         'https://chromium.googlesource.com/chromium/src/tools/clang',\n-         CHROMIUM_CLANG_TOOLS_CLANG])\n+    print 'Cloning GCC'\n+    subprocess.check_call(['git', 'clone', GCC_GIT, GCC_DIR])\n+    GitConfigRebaseMaster(GCC_DIR)\n+  print 'Syncing GCC'\n+  subprocess.check_call(['git', 'fetch'], cwd=GCC_DIR)\n+  subprocess.check_call(['git', 'checkout', GCC_REVISION], cwd=GCC_DIR)\n+\n+\n+def SyncPrebuiltClang():\n+  if os.path.exists(PREBUILT_CLANG_TOOLS_CLANG):\n+    print 'Prebuilt Chromium Clang directory already exists'\n+  else:\n+    print 'Cloning Prebuilt Chromium Clang directory'\n+    Mkdir(PREBUILT_CLANG)\n+    Mkdir(PREBUILT_CLANG_TOOLS)\n     subprocess.check_call(\n-        ['git', 'config', 'branch.master.rebase', 'true'],\n-        cwd=CHROMIUM_CLANG_TOOLS_CLANG)\n-  print 'Syncing chromium clang scripts'\n-  subprocess.check_call(['git', 'fetch'], cwd=CHROMIUM_CLANG_TOOLS_CLANG)\n-  print 'Syncing chromium clang'\n-  subprocess.check_call(\n-      [os.path.join(CHROMIUM_CLANG_TOOLS_CLANG, 'scripts', 'update.py')])\n-  return svn_rev\n+        ['git', 'clone', CLANG_GIT, PREBUILT_CLANG_TOOLS_CLANG])\n+    GitConfigRebaseMaster(PREBUILT_CLANG_TOOLS_CLANG)\n+  print 'Syncing Prebuilt Chromium Clang scripts'\n+  subprocess.check_call(['git', 'fetch'], cwd=PREBUILT_CLANG_TOOLS_CLANG)\n+  print 'Syncing Prebuilt Chromium Clang'\n+  # TODO: this doesn't seem to exist?\n+  #subprocess.check_call(\n+  #    [os.path.join(PREBUILT_CLANG_TOOLS_CLANG, 'scripts', 'update.py')])","path":"buildbot/build.py","position":154,"original_position":154,"commit_id":"26b94f61748e3a29a365f1525990a44c235b76d0","original_commit_id":"26b94f61748e3a29a365f1525990a44c235b76d0","user":{"login":"jfbastien","id":298127,"avatar_url":"https://avatars.githubusercontent.com/u/298127?v=3","gravatar_id":"","url":"https://api.github.com/users/jfbastien","html_url":"https://github.com/jfbastien","followers_url":"https://api.github.com/users/jfbastien/followers","following_url":"https://api.github.com/users/jfbastien/following{/other_user}","gists_url":"https://api.github.com/users/jfbastien/gists{/gist_id}","starred_url":"https://api.github.com/users/jfbastien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfbastien/subscriptions","organizations_url":"https://api.github.com/users/jfbastien/orgs","repos_url":"https://api.github.com/users/jfbastien/repos","events_url":"https://api.github.com/users/jfbastien/events{/privacy}","received_events_url":"https://api.github.com/users/jfbastien/received_events","type":"User","site_admin":false},"body":"Ditto broken @flagxor.","created_at":"2015-12-05T18:25:34Z","updated_at":"2015-12-05T18:25:34Z","html_url":"https://github.com/WebAssembly/experimental/pull/36#discussion_r46761344","pull_request_url":"https://api.github.com/repos/WebAssembly/experimental/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/experimental/pulls/comments/46761344"},"html":{"href":"https://github.com/WebAssembly/experimental/pull/36#discussion_r46761344"},"pull_request":{"href":"https://api.github.com/repos/WebAssembly/experimental/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/WebAssembly/experimental/pulls/36","id":52760956,"html_url":"https://github.com/WebAssembly/experimental/pull/36","diff_url":"https://github.com/WebAssembly/experimental/pull/36.diff","patch_url":"https://github.com/WebAssembly/experimental/pull/36.patch","issue_url":"https://api.github.com/repos/WebAssembly/experimental/issues/36","number":36,"state":"open","locked":false,"title":"Buildbot: GCC, refactor, bugs","user":{"login":"jfbastien","id":298127,"avatar_url":"https://avatars.githubusercontent.com/u/298127?v=3","gravatar_id":"","url":"https://api.github.com/users/jfbastien","html_url":"https://github.com/jfbastien","followers_url":"https://api.github.com/users/jfbastien/followers","following_url":"https://api.github.com/users/jfbastien/following{/other_user}","gists_url":"https://api.github.com/users/jfbastien/gists{/gist_id}","starred_url":"https://api.github.com/users/jfbastien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfbastien/subscriptions","organizations_url":"https://api.github.com/users/jfbastien/orgs","repos_url":"https://api.github.com/users/jfbastien/repos","events_url":"https://api.github.com/users/jfbastien/events{/privacy}","received_events_url":"https://api.github.com/users/jfbastien/received_events","type":"User","site_admin":false},"body":"Check out GCC, I'll run the torture tests later.\r\nRefactor some of the code.\r\nFix or comment out some bugs.","created_at":"2015-12-05T18:25:05Z","updated_at":"2015-12-05T18:25:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da4c4c1bf3773633bab55009d4a16af7acc0125a","assignee":{"login":"flagxor","id":7519520,"avatar_url":"https://avatars.githubusercontent.com/u/7519520?v=3","gravatar_id":"","url":"https://api.github.com/users/flagxor","html_url":"https://github.com/flagxor","followers_url":"https://api.github.com/users/flagxor/followers","following_url":"https://api.github.com/users/flagxor/following{/other_user}","gists_url":"https://api.github.com/users/flagxor/gists{/gist_id}","starred_url":"https://api.github.com/users/flagxor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flagxor/subscriptions","organizations_url":"https://api.github.com/users/flagxor/orgs","repos_url":"https://api.github.com/users/flagxor/repos","events_url":"https://api.github.com/users/flagxor/events{/privacy}","received_events_url":"https://api.github.com/users/flagxor/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/WebAssembly/experimental/pulls/36/commits","review_comments_url":"https://api.github.com/repos/WebAssembly/experimental/pulls/36/comments","review_comment_url":"https://api.github.com/repos/WebAssembly/experimental/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WebAssembly/experimental/issues/36/comments","statuses_url":"https://api.github.com/repos/WebAssembly/experimental/statuses/26b94f61748e3a29a365f1525990a44c235b76d0","head":{"label":"WebAssembly:gcc-refactor-bugs","ref":"gcc-refactor-bugs","sha":"26b94f61748e3a29a365f1525990a44c235b76d0","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":37306763,"name":"experimental","full_name":"WebAssembly/experimental","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/experimental","description":"Loosely-coupled collection of quick-and-dirty experiments.","fork":false,"url":"https://api.github.com/repos/WebAssembly/experimental","forks_url":"https://api.github.com/repos/WebAssembly/experimental/forks","keys_url":"https://api.github.com/repos/WebAssembly/experimental/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/experimental/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/experimental/teams","hooks_url":"https://api.github.com/repos/WebAssembly/experimental/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/experimental/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/experimental/events","assignees_url":"https://api.github.com/repos/WebAssembly/experimental/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/experimental/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/experimental/tags","blobs_url":"https://api.github.com/repos/WebAssembly/experimental/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/experimental/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/experimental/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/experimental/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/experimental/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/experimental/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/experimental/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/experimental/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/experimental/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/experimental/subscription","commits_url":"https://api.github.com/repos/WebAssembly/experimental/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/experimental/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/experimental/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/experimental/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/experimental/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/experimental/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/experimental/merges","archive_url":"https://api.github.com/repos/WebAssembly/experimental/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/experimental/downloads","issues_url":"https://api.github.com/repos/WebAssembly/experimental/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/experimental/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/experimental/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/experimental/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/experimental/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/experimental/releases{/id}","created_at":"2015-06-12T06:51:01Z","updated_at":"2015-11-23T16:14:25Z","pushed_at":"2015-12-05T18:25:05Z","git_url":"git://github.com/WebAssembly/experimental.git","ssh_url":"git@github.com:WebAssembly/experimental.git","clone_url":"https://github.com/WebAssembly/experimental.git","svn_url":"https://github.com/WebAssembly/experimental","homepage":null,"size":168,"stargazers_count":65,"watchers_count":65,"language":"Assembly","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":4,"forks":16,"open_issues":4,"watchers":65,"default_branch":"master"}},"base":{"label":"WebAssembly:master","ref":"master","sha":"a1d19c44261c4164b41a689857f6dbc6c7a2da96","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":37306763,"name":"experimental","full_name":"WebAssembly/experimental","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/experimental","description":"Loosely-coupled collection of quick-and-dirty experiments.","fork":false,"url":"https://api.github.com/repos/WebAssembly/experimental","forks_url":"https://api.github.com/repos/WebAssembly/experimental/forks","keys_url":"https://api.github.com/repos/WebAssembly/experimental/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/experimental/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/experimental/teams","hooks_url":"https://api.github.com/repos/WebAssembly/experimental/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/experimental/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/experimental/events","assignees_url":"https://api.github.com/repos/WebAssembly/experimental/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/experimental/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/experimental/tags","blobs_url":"https://api.github.com/repos/WebAssembly/experimental/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/experimental/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/experimental/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/experimental/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/experimental/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/experimental/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/experimental/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/experimental/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/experimental/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/experimental/subscription","commits_url":"https://api.github.com/repos/WebAssembly/experimental/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/experimental/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/experimental/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/experimental/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/experimental/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/experimental/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/experimental/merges","archive_url":"https://api.github.com/repos/WebAssembly/experimental/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/experimental/downloads","issues_url":"https://api.github.com/repos/WebAssembly/experimental/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/experimental/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/experimental/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/experimental/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/experimental/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/experimental/releases{/id}","created_at":"2015-06-12T06:51:01Z","updated_at":"2015-11-23T16:14:25Z","pushed_at":"2015-12-05T18:25:05Z","git_url":"git://github.com/WebAssembly/experimental.git","ssh_url":"git@github.com:WebAssembly/experimental.git","clone_url":"https://github.com/WebAssembly/experimental.git","svn_url":"https://github.com/WebAssembly/experimental","homepage":null,"size":168,"stargazers_count":65,"watchers_count":65,"language":"Assembly","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":4,"forks":16,"open_issues":4,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/experimental/pulls/36"},"html":{"href":"https://github.com/WebAssembly/experimental/pull/36"},"issue":{"href":"https://api.github.com/repos/WebAssembly/experimental/issues/36"},"comments":{"href":"https://api.github.com/repos/WebAssembly/experimental/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/WebAssembly/experimental/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/WebAssembly/experimental/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WebAssembly/experimental/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/WebAssembly/experimental/statuses/26b94f61748e3a29a365f1525990a44c235b76d0"}}}}