{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node-gyp/pulls/comments/38811950","id":38811950,"diff_hunk":"@@ -0,0 +1,99 @@\n+var semver = require('semver')\n+var url = require('url')\n+var path = require('path')\n+\n+var bitsre = /(x86|x64)/\n+\n+// Captures all the logic required to determine download URLs, local directory and \n+// file names and whether we need to use SHA-1 or 2. Inputs come from command-line","path":"lib/process-release.js","position":8,"original_position":8,"commit_id":"b7c5ff1ee7d3426ee614b3329ef97fe6b6d73326","original_commit_id":"b7c5ff1ee7d3426ee614b3329ef97fe6b6d73326","user":{"login":"bnoordhuis","id":275871,"avatar_url":"https://avatars.githubusercontent.com/u/275871?v=3","gravatar_id":"","url":"https://api.github.com/users/bnoordhuis","html_url":"https://github.com/bnoordhuis","followers_url":"https://api.github.com/users/bnoordhuis/followers","following_url":"https://api.github.com/users/bnoordhuis/following{/other_user}","gists_url":"https://api.github.com/users/bnoordhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/bnoordhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnoordhuis/subscriptions","organizations_url":"https://api.github.com/users/bnoordhuis/orgs","repos_url":"https://api.github.com/users/bnoordhuis/repos","events_url":"https://api.github.com/users/bnoordhuis/events{/privacy}","received_events_url":"https://api.github.com/users/bnoordhuis/received_events","type":"User","site_admin":false},"body":"s/2/SHA-256/?  SHA-2 is a family of hash functions, of which SHA-256 is just one.","created_at":"2015-09-05T15:50:20Z","updated_at":"2015-09-05T15:50:20Z","html_url":"https://github.com/nodejs/node-gyp/pull/711#discussion_r38811950","pull_request_url":"https://api.github.com/repos/nodejs/node-gyp/pulls/711","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node-gyp/pulls/comments/38811950"},"html":{"href":"https://github.com/nodejs/node-gyp/pull/711#discussion_r38811950"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node-gyp/pulls/711"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node-gyp/pulls/711","id":44220316,"html_url":"https://github.com/nodejs/node-gyp/pull/711","diff_url":"https://github.com/nodejs/node-gyp/pull/711.diff","patch_url":"https://github.com/nodejs/node-gyp/pull/711.patch","issue_url":"https://api.github.com/repos/nodejs/node-gyp/issues/711","number":711,"state":"open","locked":false,"title":"use process.release, make aware of io.js & node v4 differences","user":{"login":"rvagg","id":495647,"avatar_url":"https://avatars.githubusercontent.com/u/495647?v=3","gravatar_id":"","url":"https://api.github.com/users/rvagg","html_url":"https://github.com/rvagg","followers_url":"https://api.github.com/users/rvagg/followers","following_url":"https://api.github.com/users/rvagg/following{/other_user}","gists_url":"https://api.github.com/users/rvagg/gists{/gist_id}","starred_url":"https://api.github.com/users/rvagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvagg/subscriptions","organizations_url":"https://api.github.com/users/rvagg/orgs","repos_url":"https://api.github.com/users/rvagg/repos","events_url":"https://api.github.com/users/rvagg/events{/privacy}","received_events_url":"https://api.github.com/users/rvagg/received_events","type":"User","site_admin":false},"body":"Looking for patient reviewers, ASAP please. I'd like to be able to ship v4 with this version patched over the top of npm and upstream it to npm as soon as they are happy with it as well.\r\n\r\n* introduce a lib/process-release.js module that encapsulates all of the logic around downloads, names, versions and directories\r\n* introduce a test for process-release.js that hits it with various configurations and asserts that it comes up with the right answers\r\n* make node-gyp aware of process.release where it exists (`>=3.0.0`) and use it to determine download locations and names\r\n* make node-gyp aware of \"iojs\" where process.release doesn't exist, thereby making it work for _all versions of Node and io.js_ from 0.8 to current so an `npm install npm@latest -g` even on one of the older versions of io.js will _just work_ (magic).\r\n* make node-gyp able to compile against header-only tarballs, see the one-line change in addon.gypi and the search in two locations for common.gypi, for `>=3.0.0` we are shipping header-only tarballs which are super quick to download, but it also needs to be able to compile against full source as well\r\n* keep the `--target` stuff intact (although I'd love to know if anybody actually uses that)\r\n* make node-gyp aware of the change in location for node.lib (& iojs.lib) for `>=1.0.0`. In `<1.0.0` you find 32-bit node.lib in the root of the version's dist directory (e.g. http://nodejs.org/dist/v0.12.7/node.lib) while the 64-bit node.lib is in an x64 subdirectory (e.g. http://nodejs.org/dist/v0.12.7/x64/node.lib), for io.js we took the opportunity to clean this up and they are now in win-x86 and win-x64 subdirectories (e.g. https://iojs.org/dist/v3.3.0/win-x86/iojs.lib & https://iojs.org/dist/v3.3.0/win-x64/iojs.lib) _(and the .msi's have been renamed and are in the parent directory, but that's not relevant here)_. Note that it still downloads both 32-bit and 64-bit .lib files, I haven't changed that logic.\r\n* introduced a test/docker.sh script that runs it forreal, but only on Linux obviously:\r\n  1. set up a base image with compile tooling\r\n  2. set up a clones image on top of the base image with git clones of some native addons to test\r\n  3. set up an image on top of the clones image for each of the versions of node and io.js to test _plus_ the latest version of npm over the top\r\n  4. start a new container for each version of node & io.js, copy `pwd` into npm's node-gyp dependency folder so it uses the current code for testing when you use `npm install` etc., then do an `npm install` of the projects to see how it behaves.\r\n  * you can see it downloading and using the source tarballs for all but io.js v3.3.0 for which it grabs the headers file because it's only in v3 that we started shipping that and introduced `process.release`\r\n\r\nWhat does this buy us?\r\n * The ability to ship **actually useful** RC's, nightlies and master/unstable/canary builds which don't have to have proper release version numbers and sit in the release downloads directories, node-gyp will _just work_\r\n * The additional ability for sophisticated users to create custom / corporate / internal builds of Node that point to header/source tarballs that are at a different location e.g. inside a protected & HA network, thereby removing one more point of failure & build/bundle time (add in npme or similar and you can be _fully_ HA). Note that this requires a custom build of Node, so re security it's the same discussion as the `--link-module` feature we introduced.\r\n* The ability to support existing versions of io.js with new versions of npm (no more \"you have to use the npm that ships with that version of io.js). We also get the ability to re-use the io.js brand if we revive it and start shipping again for some purpose, no more floating patches.\r\n\r\nWhat's not here?\r\n\r\nWe need to finally make node-gyp aware of locally installed headers: this has been on multiple people's radars for a very long time but has never got done but it should get done. When you install via a complete tarball, or a `make install` from the source, you get the header files installed for that version. node-gyp should be able to use those to avoid any downloading. However this is not a panacea because:\r\n 1. This hasn't been enabled at all for Windows installers, although that's not an impossible task\r\n 2. Some old versions don't unpack headers and some just have broken headers—from memory there's some broken stuff across 0.12 and a couple of versions of io.js shipped without openssl headers\r\n 3. Some users don't have complete installs, we offer a plain node.exe for instance\r\n 4. node-gyp still has the ability to \"cross compile\" addons which won't work here (`--target`)\r\n 5. version managers will have to get creative with how they ship versions and communicate with node-gyp about the locations of header files\r\n 7. Doesn't solve the node.lib problem on Windows, although we may be able to ship that in the msi as well\r\n 6. ... more mess ..\r\n\r\nSo this is a TODO, someone needs to take a bite at this soon, but it's not a top priority for shipping core.\r\n\r\nPossible reviewers: @nodejs/build, @nodejs/addon-api, @TooTallNate, @Fishrock123, @othiym23, @bnoordhuis, @piscisaureus ","created_at":"2015-09-04T13:56:47Z","updated_at":"2015-09-05T15:50:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87557ab681511af02fcc55a9f44c91dde159e608","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node-gyp/pulls/711/commits","review_comments_url":"https://api.github.com/repos/nodejs/node-gyp/pulls/711/comments","review_comment_url":"https://api.github.com/repos/nodejs/node-gyp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node-gyp/issues/711/comments","statuses_url":"https://api.github.com/repos/nodejs/node-gyp/statuses/b7c5ff1ee7d3426ee614b3329ef97fe6b6d73326","head":{"label":"rvagg:process.release","ref":"process.release","sha":"b7c5ff1ee7d3426ee614b3329ef97fe6b6d73326","user":{"login":"rvagg","id":495647,"avatar_url":"https://avatars.githubusercontent.com/u/495647?v=3","gravatar_id":"","url":"https://api.github.com/users/rvagg","html_url":"https://github.com/rvagg","followers_url":"https://api.github.com/users/rvagg/followers","following_url":"https://api.github.com/users/rvagg/following{/other_user}","gists_url":"https://api.github.com/users/rvagg/gists{/gist_id}","starred_url":"https://api.github.com/users/rvagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvagg/subscriptions","organizations_url":"https://api.github.com/users/rvagg/orgs","repos_url":"https://api.github.com/users/rvagg/repos","events_url":"https://api.github.com/users/rvagg/events{/privacy}","received_events_url":"https://api.github.com/users/rvagg/received_events","type":"User","site_admin":false},"repo":{"id":29378008,"name":"node-gyp","full_name":"rvagg/node-gyp","owner":{"login":"rvagg","id":495647,"avatar_url":"https://avatars.githubusercontent.com/u/495647?v=3","gravatar_id":"","url":"https://api.github.com/users/rvagg","html_url":"https://github.com/rvagg","followers_url":"https://api.github.com/users/rvagg/followers","following_url":"https://api.github.com/users/rvagg/following{/other_user}","gists_url":"https://api.github.com/users/rvagg/gists{/gist_id}","starred_url":"https://api.github.com/users/rvagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvagg/subscriptions","organizations_url":"https://api.github.com/users/rvagg/orgs","repos_url":"https://api.github.com/users/rvagg/repos","events_url":"https://api.github.com/users/rvagg/events{/privacy}","received_events_url":"https://api.github.com/users/rvagg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rvagg/node-gyp","description":"Node.js native addon build tool","fork":true,"url":"https://api.github.com/repos/rvagg/node-gyp","forks_url":"https://api.github.com/repos/rvagg/node-gyp/forks","keys_url":"https://api.github.com/repos/rvagg/node-gyp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rvagg/node-gyp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rvagg/node-gyp/teams","hooks_url":"https://api.github.com/repos/rvagg/node-gyp/hooks","issue_events_url":"https://api.github.com/repos/rvagg/node-gyp/issues/events{/number}","events_url":"https://api.github.com/repos/rvagg/node-gyp/events","assignees_url":"https://api.github.com/repos/rvagg/node-gyp/assignees{/user}","branches_url":"https://api.github.com/repos/rvagg/node-gyp/branches{/branch}","tags_url":"https://api.github.com/repos/rvagg/node-gyp/tags","blobs_url":"https://api.github.com/repos/rvagg/node-gyp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rvagg/node-gyp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rvagg/node-gyp/git/refs{/sha}","trees_url":"https://api.github.com/repos/rvagg/node-gyp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rvagg/node-gyp/statuses/{sha}","languages_url":"https://api.github.com/repos/rvagg/node-gyp/languages","stargazers_url":"https://api.github.com/repos/rvagg/node-gyp/stargazers","contributors_url":"https://api.github.com/repos/rvagg/node-gyp/contributors","subscribers_url":"https://api.github.com/repos/rvagg/node-gyp/subscribers","subscription_url":"https://api.github.com/repos/rvagg/node-gyp/subscription","commits_url":"https://api.github.com/repos/rvagg/node-gyp/commits{/sha}","git_commits_url":"https://api.github.com/repos/rvagg/node-gyp/git/commits{/sha}","comments_url":"https://api.github.com/repos/rvagg/node-gyp/comments{/number}","issue_comment_url":"https://api.github.com/repos/rvagg/node-gyp/issues/comments{/number}","contents_url":"https://api.github.com/repos/rvagg/node-gyp/contents/{+path}","compare_url":"https://api.github.com/repos/rvagg/node-gyp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rvagg/node-gyp/merges","archive_url":"https://api.github.com/repos/rvagg/node-gyp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rvagg/node-gyp/downloads","issues_url":"https://api.github.com/repos/rvagg/node-gyp/issues{/number}","pulls_url":"https://api.github.com/repos/rvagg/node-gyp/pulls{/number}","milestones_url":"https://api.github.com/repos/rvagg/node-gyp/milestones{/number}","notifications_url":"https://api.github.com/repos/rvagg/node-gyp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rvagg/node-gyp/labels{/name}","releases_url":"https://api.github.com/repos/rvagg/node-gyp/releases{/id}","created_at":"2015-01-17T03:07:09Z","updated_at":"2015-01-17T03:07:11Z","pushed_at":"2015-09-04T17:42:41Z","git_url":"git://github.com/rvagg/node-gyp.git","ssh_url":"git@github.com:rvagg/node-gyp.git","clone_url":"https://github.com/rvagg/node-gyp.git","svn_url":"https://github.com/rvagg/node-gyp","homepage":"","size":3104,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"85ed1075654c763c971a1a5870a8987c6083c060","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":3342055,"name":"node-gyp","full_name":"nodejs/node-gyp","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node-gyp","description":"Node.js native addon build tool","fork":false,"url":"https://api.github.com/repos/nodejs/node-gyp","forks_url":"https://api.github.com/repos/nodejs/node-gyp/forks","keys_url":"https://api.github.com/repos/nodejs/node-gyp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node-gyp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node-gyp/teams","hooks_url":"https://api.github.com/repos/nodejs/node-gyp/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node-gyp/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node-gyp/events","assignees_url":"https://api.github.com/repos/nodejs/node-gyp/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node-gyp/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node-gyp/tags","blobs_url":"https://api.github.com/repos/nodejs/node-gyp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node-gyp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node-gyp/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node-gyp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node-gyp/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node-gyp/languages","stargazers_url":"https://api.github.com/repos/nodejs/node-gyp/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node-gyp/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node-gyp/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node-gyp/subscription","commits_url":"https://api.github.com/repos/nodejs/node-gyp/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node-gyp/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node-gyp/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node-gyp/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node-gyp/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node-gyp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node-gyp/merges","archive_url":"https://api.github.com/repos/nodejs/node-gyp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node-gyp/downloads","issues_url":"https://api.github.com/repos/nodejs/node-gyp/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node-gyp/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node-gyp/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node-gyp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node-gyp/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node-gyp/releases{/id}","created_at":"2012-02-03T05:50:50Z","updated_at":"2015-09-04T06:33:54Z","pushed_at":"2015-09-05T07:33:55Z","git_url":"git://github.com/nodejs/node-gyp.git","ssh_url":"git@github.com:nodejs/node-gyp.git","clone_url":"https://github.com/nodejs/node-gyp.git","svn_url":"https://github.com/nodejs/node-gyp","homepage":"","size":7581,"stargazers_count":1507,"watchers_count":1507,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":284,"mirror_url":null,"open_issues_count":203,"forks":284,"open_issues":203,"watchers":1507,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node-gyp/pulls/711"},"html":{"href":"https://github.com/nodejs/node-gyp/pull/711"},"issue":{"href":"https://api.github.com/repos/nodejs/node-gyp/issues/711"},"comments":{"href":"https://api.github.com/repos/nodejs/node-gyp/issues/711/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node-gyp/pulls/711/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node-gyp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node-gyp/pulls/711/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node-gyp/statuses/b7c5ff1ee7d3426ee614b3329ef97fe6b6d73326"}}}}