{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments/63042052","id":63042052,"diff_hunk":"@@ -9,19 +9,30 @@\n */\n \n import Foundation\n+import func POSIX.getenv\n+import func POSIX.getcwd\n \n-private var memoized = [String: String]()\n+private let PATH = [POSIX.getcwd()] + (getenv(\"PATH\") ?? \"\").components(separatedBy: \":\")","path":"Sources/Utility/which.swift","position":null,"original_position":8,"commit_id":"b634c34f7d84d4badefbe0976945be156c1cba31","original_commit_id":"b634c34f7d84d4badefbe0976945be156c1cba31","user":{"login":"ddunbar","id":106625,"avatar_url":"https://avatars.githubusercontent.com/u/106625?v=3","gravatar_id":"","url":"https://api.github.com/users/ddunbar","html_url":"https://github.com/ddunbar","followers_url":"https://api.github.com/users/ddunbar/followers","following_url":"https://api.github.com/users/ddunbar/following{/other_user}","gists_url":"https://api.github.com/users/ddunbar/gists{/gist_id}","starred_url":"https://api.github.com/users/ddunbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddunbar/subscriptions","organizations_url":"https://api.github.com/users/ddunbar/orgs","repos_url":"https://api.github.com/users/ddunbar/repos","events_url":"https://api.github.com/users/ddunbar/events{/privacy}","received_events_url":"https://api.github.com/users/ddunbar/received_events","type":"User","site_admin":false},"body":"We shouldn't default to looking in the `cwd`, that can be a security issue.","created_at":"2016-05-12T15:32:37Z","updated_at":"2016-05-12T15:32:37Z","html_url":"https://github.com/apple/swift-package-manager/pull/303#discussion_r63042052","pull_request_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/303","_links":{"self":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments/63042052"},"html":{"href":"https://github.com/apple/swift-package-manager/pull/303#discussion_r63042052"},"pull_request":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/303"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift-package-manager/pulls/303","id":68541678,"html_url":"https://github.com/apple/swift-package-manager/pull/303","diff_url":"https://github.com/apple/swift-package-manager/pull/303.diff","patch_url":"https://github.com/apple/swift-package-manager/pull/303.patch","issue_url":"https://api.github.com/repos/apple/swift-package-manager/issues/303","number":303,"state":"open","locked":false,"title":"SR-1005: [Foundation] Replace posix_spawn by NSTask","user":{"login":"Bouke","id":235882,"avatar_url":"https://avatars.githubusercontent.com/u/235882?v=3","gravatar_id":"","url":"https://api.github.com/users/Bouke","html_url":"https://github.com/Bouke","followers_url":"https://api.github.com/users/Bouke/followers","following_url":"https://api.github.com/users/Bouke/following{/other_user}","gists_url":"https://api.github.com/users/Bouke/gists{/gist_id}","starred_url":"https://api.github.com/users/Bouke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bouke/subscriptions","organizations_url":"https://api.github.com/users/Bouke/orgs","repos_url":"https://api.github.com/users/Bouke/repos","events_url":"https://api.github.com/users/Bouke/events{/privacy}","received_events_url":"https://api.github.com/users/Bouke/received_events","type":"User","site_admin":false},"body":"Currently this cannot be merged as builds fail on Linux;\r\n\r\n* [x] Builds on Linux need to include Foundation ([PR][1])\r\n* [x] SwiftFoundation doesn't implement output redirection (`NSTask.standardOutput`), so no output can be captured ([PR][2]).\r\n* [x] SwiftFoundation doesn't implement output streaming (`NSFileHandle.availableData`) ([PR][2]).\r\n* [x] SwiftFoundation's NSTask fails to run some commands with custom environment variables ([PR][3]).\r\n* [x] SwiftFoundation's NSTask `argv[0]` and stderr apple/swift-corelibs-foundation#353\r\n\r\n[1]: https://github.com/apple/swift/pull/2406\r\n[2]: https://github.com/apple/swift-corelibs-foundation/pull/348\r\n[3]: https://github.com/apple/swift-corelibs-foundation/pull/349","created_at":"2016-05-02T09:54:19Z","updated_at":"2016-05-12T15:32:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfd3b0ed653205d6e839f769e3648a4e6d756e9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/303/commits","review_comments_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/303/comments","review_comment_url":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift-package-manager/issues/303/comments","statuses_url":"https://api.github.com/repos/apple/swift-package-manager/statuses/b634c34f7d84d4badefbe0976945be156c1cba31","head":{"label":"Bouke:sr-1005-nstask","ref":"sr-1005-nstask","sha":"b634c34f7d84d4badefbe0976945be156c1cba31","user":{"login":"Bouke","id":235882,"avatar_url":"https://avatars.githubusercontent.com/u/235882?v=3","gravatar_id":"","url":"https://api.github.com/users/Bouke","html_url":"https://github.com/Bouke","followers_url":"https://api.github.com/users/Bouke/followers","following_url":"https://api.github.com/users/Bouke/following{/other_user}","gists_url":"https://api.github.com/users/Bouke/gists{/gist_id}","starred_url":"https://api.github.com/users/Bouke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bouke/subscriptions","organizations_url":"https://api.github.com/users/Bouke/orgs","repos_url":"https://api.github.com/users/Bouke/repos","events_url":"https://api.github.com/users/Bouke/events{/privacy}","received_events_url":"https://api.github.com/users/Bouke/received_events","type":"User","site_admin":false},"repo":{"id":57142461,"name":"swift-package-manager","full_name":"Bouke/swift-package-manager","owner":{"login":"Bouke","id":235882,"avatar_url":"https://avatars.githubusercontent.com/u/235882?v=3","gravatar_id":"","url":"https://api.github.com/users/Bouke","html_url":"https://github.com/Bouke","followers_url":"https://api.github.com/users/Bouke/followers","following_url":"https://api.github.com/users/Bouke/following{/other_user}","gists_url":"https://api.github.com/users/Bouke/gists{/gist_id}","starred_url":"https://api.github.com/users/Bouke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bouke/subscriptions","organizations_url":"https://api.github.com/users/Bouke/orgs","repos_url":"https://api.github.com/users/Bouke/repos","events_url":"https://api.github.com/users/Bouke/events{/privacy}","received_events_url":"https://api.github.com/users/Bouke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bouke/swift-package-manager","description":"The Package Manager for the Swift Programming Language","fork":true,"url":"https://api.github.com/repos/Bouke/swift-package-manager","forks_url":"https://api.github.com/repos/Bouke/swift-package-manager/forks","keys_url":"https://api.github.com/repos/Bouke/swift-package-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bouke/swift-package-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bouke/swift-package-manager/teams","hooks_url":"https://api.github.com/repos/Bouke/swift-package-manager/hooks","issue_events_url":"https://api.github.com/repos/Bouke/swift-package-manager/issues/events{/number}","events_url":"https://api.github.com/repos/Bouke/swift-package-manager/events","assignees_url":"https://api.github.com/repos/Bouke/swift-package-manager/assignees{/user}","branches_url":"https://api.github.com/repos/Bouke/swift-package-manager/branches{/branch}","tags_url":"https://api.github.com/repos/Bouke/swift-package-manager/tags","blobs_url":"https://api.github.com/repos/Bouke/swift-package-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bouke/swift-package-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bouke/swift-package-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bouke/swift-package-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bouke/swift-package-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/Bouke/swift-package-manager/languages","stargazers_url":"https://api.github.com/repos/Bouke/swift-package-manager/stargazers","contributors_url":"https://api.github.com/repos/Bouke/swift-package-manager/contributors","subscribers_url":"https://api.github.com/repos/Bouke/swift-package-manager/subscribers","subscription_url":"https://api.github.com/repos/Bouke/swift-package-manager/subscription","commits_url":"https://api.github.com/repos/Bouke/swift-package-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bouke/swift-package-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bouke/swift-package-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bouke/swift-package-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bouke/swift-package-manager/contents/{+path}","compare_url":"https://api.github.com/repos/Bouke/swift-package-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bouke/swift-package-manager/merges","archive_url":"https://api.github.com/repos/Bouke/swift-package-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bouke/swift-package-manager/downloads","issues_url":"https://api.github.com/repos/Bouke/swift-package-manager/issues{/number}","pulls_url":"https://api.github.com/repos/Bouke/swift-package-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/Bouke/swift-package-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/Bouke/swift-package-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bouke/swift-package-manager/labels{/name}","releases_url":"https://api.github.com/repos/Bouke/swift-package-manager/releases{/id}","deployments_url":"https://api.github.com/repos/Bouke/swift-package-manager/deployments","created_at":"2016-04-26T16:03:54Z","updated_at":"2016-04-26T16:03:55Z","pushed_at":"2016-05-11T12:23:37Z","git_url":"git://github.com/Bouke/swift-package-manager.git","ssh_url":"git@github.com:Bouke/swift-package-manager.git","clone_url":"https://github.com/Bouke/swift-package-manager.git","svn_url":"https://github.com/Bouke/swift-package-manager","homepage":"","size":1337,"stargazers_count":0,"watchers_count":0,"language":"Swift","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":"apple:master","ref":"master","sha":"827b7033d1b11c083d174aad3b4887e333e3d8d9","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44840041,"name":"swift-package-manager","full_name":"apple/swift-package-manager","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift-package-manager","description":"The Package Manager for the Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift-package-manager","forks_url":"https://api.github.com/repos/apple/swift-package-manager/forks","keys_url":"https://api.github.com/repos/apple/swift-package-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift-package-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift-package-manager/teams","hooks_url":"https://api.github.com/repos/apple/swift-package-manager/hooks","issue_events_url":"https://api.github.com/repos/apple/swift-package-manager/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift-package-manager/events","assignees_url":"https://api.github.com/repos/apple/swift-package-manager/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift-package-manager/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift-package-manager/tags","blobs_url":"https://api.github.com/repos/apple/swift-package-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift-package-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift-package-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift-package-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift-package-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift-package-manager/languages","stargazers_url":"https://api.github.com/repos/apple/swift-package-manager/stargazers","contributors_url":"https://api.github.com/repos/apple/swift-package-manager/contributors","subscribers_url":"https://api.github.com/repos/apple/swift-package-manager/subscribers","subscription_url":"https://api.github.com/repos/apple/swift-package-manager/subscription","commits_url":"https://api.github.com/repos/apple/swift-package-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift-package-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift-package-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift-package-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift-package-manager/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift-package-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift-package-manager/merges","archive_url":"https://api.github.com/repos/apple/swift-package-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift-package-manager/downloads","issues_url":"https://api.github.com/repos/apple/swift-package-manager/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift-package-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift-package-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift-package-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift-package-manager/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift-package-manager/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift-package-manager/deployments","created_at":"2015-10-23T21:41:12Z","updated_at":"2016-05-12T11:15:20Z","pushed_at":"2016-05-12T15:31:04Z","git_url":"git://github.com/apple/swift-package-manager.git","ssh_url":"git@github.com:apple/swift-package-manager.git","clone_url":"https://github.com/apple/swift-package-manager.git","svn_url":"https://github.com/apple/swift-package-manager","homepage":"","size":1629,"stargazers_count":4043,"watchers_count":4043,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":14,"forks":340,"open_issues":14,"watchers":4043,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/303"},"html":{"href":"https://github.com/apple/swift-package-manager/pull/303"},"issue":{"href":"https://api.github.com/repos/apple/swift-package-manager/issues/303"},"comments":{"href":"https://api.github.com/repos/apple/swift-package-manager/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift-package-manager/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift-package-manager/statuses/b634c34f7d84d4badefbe0976945be156c1cba31"}}}}