{"action":"created","comment":{"url":"https://api.github.com/repos/servo/rust-mozjs/pulls/comments/77810968","id":77810968,"diff_hunk":"@@ -0,0 +1,90 @@\n+#!/usr/bin/env python3\n+\n+import os, subprocess, sys\n+\n+def usage_and_exit():\n+    print(\"\")\n+    print(\"Usage:\")\n+    print(\"    bindings-all.py <platform> <bindgen> <clang_lib_path>\")\n+    print(\"\")\n+    print(\"    Regenerates both debugmozjs and non-debugmozjs bindings and\")\n+    print(\"    tests them.\")\n+    print(\"\")\n+    print(\"    <platform>         One of 'linux_32', 'linux_64', 'macos_64',\")\n+    print(\"                       'windows_gcc_64', or 'windows_msvc14_64'.\")\n+    print(\"\")\n+    print(\"    <bindgen>          The path to bindgen\")\n+    print(\"\")\n+    print(\"    <clang_lib_path>   The path to the directory of clang library files\")\n+    sys.exit(1)\n+\n+# Validate arguments.\n+    \n+if len(sys.argv) != 4:\n+    usage_and_exit()\n+\n+[platform, bindgen, clang_lib_path] = sys.argv[1:]\n+\n+try:\n+    [\"linux_32\", \"linux_64\", \"macos_64\", \"windows_gcc_64\", \"windows_msvc14_64\"].index(platform)\n+except ValueError:\n+    print(\"error: {} is not a valid platform\".format(platform))\n+    usage_and_exit()\n+\n+bindgen = os.path.abspath(bindgen)\n+if not (os.path.isfile(bindgen) and os.access(bindgen, os.X_OK)):\n+    print(\"error: {} is not executable\".format(bindgen))\n+    usage_and_exit()\n+\n+clang_lib_path = os.path.abspath(clang_lib_path)\n+if not os.path.isdir(clang_lib_path):\n+    print(\"error: {} is not a directory\".format(bindgen))\n+\n+# Go to the root of our repo.\n+os.chdir(os.path.dirname(sys.argv[0]))\n+os.chdir(\"..\")\n+\n+def run(cmd, **kwargs):\n+    \"\"\"Run the given shell command. \n+\n+    Pass through kwargs (like env=...) to subprocess.Popen. Wait for the\n+    subprocess to complete, and throw and exception if it didn't exit with 0.\n+\n+    \"\"\"\n+    print(\"{}: Running\".format(sys.argv[0]), cmd)\n+    proc = subprocess.Popen(cmd, **kwargs)\n+    proc.wait()\n+    if proc.returncode != 0:\n+        raise subprocess.CalledProcessError(proc.returncode, cmd)\n+\n+# Set up the environment needed to run bindgen.\n+bindgen_env = os.environ.copy()\n+bindgen_env[\"LIBCLANG_PATH\"] = clang_lib_path\n+if platform.startswith(\"macos\"):\n+    bindgen_env[\"DYLD_LIBRARY_PATH\"] = clang_lib_path\n+else:\n+    bindgen_env[\"LD_LIBRARY_PATH\"] = clang_lib_path\n+\n+# Run our builds.\n+    \n+BUILDS = [\n+    # Release build\n+    (\"\", []),\n+    # DEBUG build\n+    (\"_debug\", [\"--features\", \"debugmozjs\"])\n+]\n+\n+for (build_modifier, extra_cargo_flags) in BUILDS:\n+    run([\"cargo\", \"clean\"])\n+\n+    try:\n+        run([\"cargo\", \"build\"] + extra_cargo_flags)\n+    except subprocess.CalledProcessError:\n+        # This is expected to initially fail because the bindings aren't up to","path":"etc/bindings-all.py","position":83,"original_position":83,"commit_id":"f73d71caead74e43846a41d62f1c77d1ca4887f2","original_commit_id":"f73d71caead74e43846a41d62f1c77d1ca4887f2","user":{"login":"Ms2ger","id":111161,"avatar_url":"https://avatars.githubusercontent.com/u/111161?v=3","gravatar_id":"","url":"https://api.github.com/users/Ms2ger","html_url":"https://github.com/Ms2ger","followers_url":"https://api.github.com/users/Ms2ger/followers","following_url":"https://api.github.com/users/Ms2ger/following{/other_user}","gists_url":"https://api.github.com/users/Ms2ger/gists{/gist_id}","starred_url":"https://api.github.com/users/Ms2ger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ms2ger/subscriptions","organizations_url":"https://api.github.com/users/Ms2ger/orgs","repos_url":"https://api.github.com/users/Ms2ger/repos","events_url":"https://api.github.com/users/Ms2ger/events{/privacy}","received_events_url":"https://api.github.com/users/Ms2ger/received_events","type":"User","site_admin":false},"body":"Can you try making this call `cargo build -p mozjs_sys` instead? r+ either way.","created_at":"2016-09-07T12:23:44Z","updated_at":"2016-09-07T12:23:44Z","html_url":"https://github.com/servo/rust-mozjs/pull/302#discussion_r77810968","pull_request_url":"https://api.github.com/repos/servo/rust-mozjs/pulls/302","_links":{"self":{"href":"https://api.github.com/repos/servo/rust-mozjs/pulls/comments/77810968"},"html":{"href":"https://github.com/servo/rust-mozjs/pull/302#discussion_r77810968"},"pull_request":{"href":"https://api.github.com/repos/servo/rust-mozjs/pulls/302"}}},"pull_request":{"url":"https://api.github.com/repos/servo/rust-mozjs/pulls/302","id":84193634,"html_url":"https://github.com/servo/rust-mozjs/pull/302","diff_url":"https://github.com/servo/rust-mozjs/pull/302.diff","patch_url":"https://github.com/servo/rust-mozjs/pull/302.patch","issue_url":"https://api.github.com/repos/servo/rust-mozjs/issues/302","number":302,"state":"open","locked":false,"title":"Add the `etc/bindings-all.py` script to orchestrate bindings generation","user":{"login":"fitzgen","id":74571,"avatar_url":"https://avatars.githubusercontent.com/u/74571?v=3","gravatar_id":"","url":"https://api.github.com/users/fitzgen","html_url":"https://github.com/fitzgen","followers_url":"https://api.github.com/users/fitzgen/followers","following_url":"https://api.github.com/users/fitzgen/following{/other_user}","gists_url":"https://api.github.com/users/fitzgen/gists{/gist_id}","starred_url":"https://api.github.com/users/fitzgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fitzgen/subscriptions","organizations_url":"https://api.github.com/users/fitzgen/orgs","repos_url":"https://api.github.com/users/fitzgen/repos","events_url":"https://api.github.com/users/fitzgen/events{/privacy}","received_events_url":"https://api.github.com/users/fitzgen/received_events","type":"User","site_admin":false},"body":"The `bindings-all.py` script will make sure that you don't accidentally try and use DEBUG bindings for a non-DEBUG build or vice-versa. It orchestrates all of building, regenerating and testing new SpiderMonkey bindings.\r\n\r\nRunning this script on fedora regenerates the linux_64 bindings exactly as they are on the smup branch for me. I think this is a large usability improvement over what we do now.\r\n\r\nr? @Ms2ger @nox\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/rust-mozjs/302)\n<!-- Reviewable:end -->\n","created_at":"2016-09-06T20:48:12Z","updated_at":"2016-09-07T12:23:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbd089db5d9741c74391435ffba6cc3c34083465","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/servo/rust-mozjs/pulls/302/commits","review_comments_url":"https://api.github.com/repos/servo/rust-mozjs/pulls/302/comments","review_comment_url":"https://api.github.com/repos/servo/rust-mozjs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/rust-mozjs/issues/302/comments","statuses_url":"https://api.github.com/repos/servo/rust-mozjs/statuses/f73d71caead74e43846a41d62f1c77d1ca4887f2","head":{"label":"fitzgen:bindings-all","ref":"bindings-all","sha":"f73d71caead74e43846a41d62f1c77d1ca4887f2","user":{"login":"fitzgen","id":74571,"avatar_url":"https://avatars.githubusercontent.com/u/74571?v=3","gravatar_id":"","url":"https://api.github.com/users/fitzgen","html_url":"https://github.com/fitzgen","followers_url":"https://api.github.com/users/fitzgen/followers","following_url":"https://api.github.com/users/fitzgen/following{/other_user}","gists_url":"https://api.github.com/users/fitzgen/gists{/gist_id}","starred_url":"https://api.github.com/users/fitzgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fitzgen/subscriptions","organizations_url":"https://api.github.com/users/fitzgen/orgs","repos_url":"https://api.github.com/users/fitzgen/repos","events_url":"https://api.github.com/users/fitzgen/events{/privacy}","received_events_url":"https://api.github.com/users/fitzgen/received_events","type":"User","site_admin":false},"repo":{"id":66102946,"name":"rust-mozjs","full_name":"fitzgen/rust-mozjs","owner":{"login":"fitzgen","id":74571,"avatar_url":"https://avatars.githubusercontent.com/u/74571?v=3","gravatar_id":"","url":"https://api.github.com/users/fitzgen","html_url":"https://github.com/fitzgen","followers_url":"https://api.github.com/users/fitzgen/followers","following_url":"https://api.github.com/users/fitzgen/following{/other_user}","gists_url":"https://api.github.com/users/fitzgen/gists{/gist_id}","starred_url":"https://api.github.com/users/fitzgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fitzgen/subscriptions","organizations_url":"https://api.github.com/users/fitzgen/orgs","repos_url":"https://api.github.com/users/fitzgen/repos","events_url":"https://api.github.com/users/fitzgen/events{/privacy}","received_events_url":"https://api.github.com/users/fitzgen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fitzgen/rust-mozjs","description":"Rust bindings to SpiderMonkey","fork":true,"url":"https://api.github.com/repos/fitzgen/rust-mozjs","forks_url":"https://api.github.com/repos/fitzgen/rust-mozjs/forks","keys_url":"https://api.github.com/repos/fitzgen/rust-mozjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fitzgen/rust-mozjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fitzgen/rust-mozjs/teams","hooks_url":"https://api.github.com/repos/fitzgen/rust-mozjs/hooks","issue_events_url":"https://api.github.com/repos/fitzgen/rust-mozjs/issues/events{/number}","events_url":"https://api.github.com/repos/fitzgen/rust-mozjs/events","assignees_url":"https://api.github.com/repos/fitzgen/rust-mozjs/assignees{/user}","branches_url":"https://api.github.com/repos/fitzgen/rust-mozjs/branches{/branch}","tags_url":"https://api.github.com/repos/fitzgen/rust-mozjs/tags","blobs_url":"https://api.github.com/repos/fitzgen/rust-mozjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fitzgen/rust-mozjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fitzgen/rust-mozjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/fitzgen/rust-mozjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fitzgen/rust-mozjs/statuses/{sha}","languages_url":"https://api.github.com/repos/fitzgen/rust-mozjs/languages","stargazers_url":"https://api.github.com/repos/fitzgen/rust-mozjs/stargazers","contributors_url":"https://api.github.com/repos/fitzgen/rust-mozjs/contributors","subscribers_url":"https://api.github.com/repos/fitzgen/rust-mozjs/subscribers","subscription_url":"https://api.github.com/repos/fitzgen/rust-mozjs/subscription","commits_url":"https://api.github.com/repos/fitzgen/rust-mozjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/fitzgen/rust-mozjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/fitzgen/rust-mozjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/fitzgen/rust-mozjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/fitzgen/rust-mozjs/contents/{+path}","compare_url":"https://api.github.com/repos/fitzgen/rust-mozjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fitzgen/rust-mozjs/merges","archive_url":"https://api.github.com/repos/fitzgen/rust-mozjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fitzgen/rust-mozjs/downloads","issues_url":"https://api.github.com/repos/fitzgen/rust-mozjs/issues{/number}","pulls_url":"https://api.github.com/repos/fitzgen/rust-mozjs/pulls{/number}","milestones_url":"https://api.github.com/repos/fitzgen/rust-mozjs/milestones{/number}","notifications_url":"https://api.github.com/repos/fitzgen/rust-mozjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fitzgen/rust-mozjs/labels{/name}","releases_url":"https://api.github.com/repos/fitzgen/rust-mozjs/releases{/id}","deployments_url":"https://api.github.com/repos/fitzgen/rust-mozjs/deployments","created_at":"2016-08-19T18:13:00Z","updated_at":"2016-08-19T18:13:01Z","pushed_at":"2016-09-06T20:45:01Z","git_url":"git://github.com/fitzgen/rust-mozjs.git","ssh_url":"git@github.com:fitzgen/rust-mozjs.git","clone_url":"https://github.com/fitzgen/rust-mozjs.git","svn_url":"https://github.com/fitzgen/rust-mozjs","homepage":"","size":1470,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"servo:master","ref":"master","sha":"bbf907b61bac6901bb34071fa9afe467515716fa","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":3861673,"name":"rust-mozjs","full_name":"servo/rust-mozjs","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/rust-mozjs","description":"Rust bindings to SpiderMonkey","fork":false,"url":"https://api.github.com/repos/servo/rust-mozjs","forks_url":"https://api.github.com/repos/servo/rust-mozjs/forks","keys_url":"https://api.github.com/repos/servo/rust-mozjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/rust-mozjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/rust-mozjs/teams","hooks_url":"https://api.github.com/repos/servo/rust-mozjs/hooks","issue_events_url":"https://api.github.com/repos/servo/rust-mozjs/issues/events{/number}","events_url":"https://api.github.com/repos/servo/rust-mozjs/events","assignees_url":"https://api.github.com/repos/servo/rust-mozjs/assignees{/user}","branches_url":"https://api.github.com/repos/servo/rust-mozjs/branches{/branch}","tags_url":"https://api.github.com/repos/servo/rust-mozjs/tags","blobs_url":"https://api.github.com/repos/servo/rust-mozjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/rust-mozjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/rust-mozjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/rust-mozjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/rust-mozjs/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/rust-mozjs/languages","stargazers_url":"https://api.github.com/repos/servo/rust-mozjs/stargazers","contributors_url":"https://api.github.com/repos/servo/rust-mozjs/contributors","subscribers_url":"https://api.github.com/repos/servo/rust-mozjs/subscribers","subscription_url":"https://api.github.com/repos/servo/rust-mozjs/subscription","commits_url":"https://api.github.com/repos/servo/rust-mozjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/rust-mozjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/rust-mozjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/rust-mozjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/rust-mozjs/contents/{+path}","compare_url":"https://api.github.com/repos/servo/rust-mozjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/rust-mozjs/merges","archive_url":"https://api.github.com/repos/servo/rust-mozjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/rust-mozjs/downloads","issues_url":"https://api.github.com/repos/servo/rust-mozjs/issues{/number}","pulls_url":"https://api.github.com/repos/servo/rust-mozjs/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/rust-mozjs/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/rust-mozjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/rust-mozjs/labels{/name}","releases_url":"https://api.github.com/repos/servo/rust-mozjs/releases{/id}","deployments_url":"https://api.github.com/repos/servo/rust-mozjs/deployments","created_at":"2012-03-29T02:07:23Z","updated_at":"2016-09-05T19:50:26Z","pushed_at":"2016-09-06T20:48:17Z","git_url":"git://github.com/servo/rust-mozjs.git","ssh_url":"git@github.com:servo/rust-mozjs.git","clone_url":"https://github.com/servo/rust-mozjs.git","svn_url":"https://github.com/servo/rust-mozjs","homepage":"","size":1796,"stargazers_count":69,"watchers_count":69,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":32,"forks":61,"open_issues":32,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/rust-mozjs/pulls/302"},"html":{"href":"https://github.com/servo/rust-mozjs/pull/302"},"issue":{"href":"https://api.github.com/repos/servo/rust-mozjs/issues/302"},"comments":{"href":"https://api.github.com/repos/servo/rust-mozjs/issues/302/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/rust-mozjs/pulls/302/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/rust-mozjs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/rust-mozjs/pulls/302/commits"},"statuses":{"href":"https://api.github.com/repos/servo/rust-mozjs/statuses/f73d71caead74e43846a41d62f1c77d1ca4887f2"}}}}
{"actor":{"display_login":"Ms2ger"}}