{"action":"created","comment":{"url":"https://api.github.com/repos/tailhook/vagga/pulls/comments/63601885","id":63601885,"diff_hunk":"@@ -303,19 +300,18 @@ impl BuildStep for RunAs {\n         for i in self.supplementary_gids.iter() {\n             hash.text(\"supplementary_gids\", &i);\n         }\n-        hash.field(\"RunAs\", &self.script);\n+        hash.field(\"script\", &self.script);\n         Ok(())\n     }\n     fn build(&self, guard: &mut Guard, build: bool)\n         -> Result<(), StepError>\n     {\n         if build {\n-            let mut cmd = try!(build_command(&mut guard.ctx,\n-                                             &[\"/bin/sh\".to_string(),\n-                                               \"-exc\".to_string(),\n-                                               self.script.to_string()],\n-                                             &Path::new(\"/work\"),\n-                                             &[]));\n+            let mut cmd = Command::new(&\"/bin/sh\".to_string());\n+            setup_command(&guard.ctx, &mut cmd);\n+            cmd.args(&[\"-exc\".to_string(), self.script.to_string()]);","path":"src/builder/commands/generic.rs","position":null,"original_position":68,"commit_id":"10e5961a21c0df2007ae88a5b9870dc48178237c","original_commit_id":"10e5961a21c0df2007ae88a5b9870dc48178237c","user":{"login":"tailhook","id":321799,"avatar_url":"https://avatars.githubusercontent.com/u/321799?v=3","gravatar_id":"","url":"https://api.github.com/users/tailhook","html_url":"https://github.com/tailhook","followers_url":"https://api.github.com/users/tailhook/followers","following_url":"https://api.github.com/users/tailhook/following{/other_user}","gists_url":"https://api.github.com/users/tailhook/gists{/gist_id}","starred_url":"https://api.github.com/users/tailhook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tailhook/subscriptions","organizations_url":"https://api.github.com/users/tailhook/orgs","repos_url":"https://api.github.com/users/tailhook/repos","events_url":"https://api.github.com/users/tailhook/events{/privacy}","received_events_url":"https://api.github.com/users/tailhook/received_events","type":"User","site_admin":false},"body":"This is similar, you don't need `to_string()` conversion, which is allocating a `String`. and you don't need to create a slice, just:\r\n```\r\ncmd.arg(\"-exc\");\r\ncmd.arg(&self.script)\r\n```\r\n\r\n(The slice is cost-less, but using separate call allows to use different type for each argument, if needed)","created_at":"2016-05-17T20:54:30Z","updated_at":"2016-05-17T20:54:30Z","html_url":"https://github.com/tailhook/vagga/pull/251#discussion_r63601885","pull_request_url":"https://api.github.com/repos/tailhook/vagga/pulls/251","_links":{"self":{"href":"https://api.github.com/repos/tailhook/vagga/pulls/comments/63601885"},"html":{"href":"https://github.com/tailhook/vagga/pull/251#discussion_r63601885"},"pull_request":{"href":"https://api.github.com/repos/tailhook/vagga/pulls/251"}}},"pull_request":{"url":"https://api.github.com/repos/tailhook/vagga/pulls/251","id":70383001,"html_url":"https://github.com/tailhook/vagga/pull/251","diff_url":"https://github.com/tailhook/vagga/pull/251.diff","patch_url":"https://github.com/tailhook/vagga/pull/251.patch","issue_url":"https://api.github.com/repos/tailhook/vagga/issues/251","number":251,"state":"open","locked":false,"title":"RunAs command (merge after uidmap)","user":{"login":"popravich","id":323442,"avatar_url":"https://avatars.githubusercontent.com/u/323442?v=3","gravatar_id":"","url":"https://api.github.com/users/popravich","html_url":"https://github.com/popravich","followers_url":"https://api.github.com/users/popravich/followers","following_url":"https://api.github.com/users/popravich/following{/other_user}","gists_url":"https://api.github.com/users/popravich/gists{/gist_id}","starred_url":"https://api.github.com/users/popravich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popravich/subscriptions","organizations_url":"https://api.github.com/users/popravich/orgs","repos_url":"https://api.github.com/users/popravich/repos","events_url":"https://api.github.com/users/popravich/events{/privacy}","received_events_url":"https://api.github.com/users/popravich/received_events","type":"User","site_admin":false},"body":"Implements #241 \r\n\r\nDone:\r\n* [x] code\r\n* [x] tests\r\n* [x] docs\r\n* [ ] wait `uidmap` branch merged into master","created_at":"2016-05-17T15:56:49Z","updated_at":"2016-05-17T20:54:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"894de2d1e9c97610ea3092f635811048522b6ab8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tailhook/vagga/pulls/251/commits","review_comments_url":"https://api.github.com/repos/tailhook/vagga/pulls/251/comments","review_comment_url":"https://api.github.com/repos/tailhook/vagga/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tailhook/vagga/issues/251/comments","statuses_url":"https://api.github.com/repos/tailhook/vagga/statuses/10e5961a21c0df2007ae88a5b9870dc48178237c","head":{"label":"popravich:run_as_command","ref":"run_as_command","sha":"10e5961a21c0df2007ae88a5b9870dc48178237c","user":{"login":"popravich","id":323442,"avatar_url":"https://avatars.githubusercontent.com/u/323442?v=3","gravatar_id":"","url":"https://api.github.com/users/popravich","html_url":"https://github.com/popravich","followers_url":"https://api.github.com/users/popravich/followers","following_url":"https://api.github.com/users/popravich/following{/other_user}","gists_url":"https://api.github.com/users/popravich/gists{/gist_id}","starred_url":"https://api.github.com/users/popravich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popravich/subscriptions","organizations_url":"https://api.github.com/users/popravich/orgs","repos_url":"https://api.github.com/users/popravich/repos","events_url":"https://api.github.com/users/popravich/events{/privacy}","received_events_url":"https://api.github.com/users/popravich/received_events","type":"User","site_admin":false},"repo":{"id":42934616,"name":"vagga","full_name":"popravich/vagga","owner":{"login":"popravich","id":323442,"avatar_url":"https://avatars.githubusercontent.com/u/323442?v=3","gravatar_id":"","url":"https://api.github.com/users/popravich","html_url":"https://github.com/popravich","followers_url":"https://api.github.com/users/popravich/followers","following_url":"https://api.github.com/users/popravich/following{/other_user}","gists_url":"https://api.github.com/users/popravich/gists{/gist_id}","starred_url":"https://api.github.com/users/popravich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popravich/subscriptions","organizations_url":"https://api.github.com/users/popravich/orgs","repos_url":"https://api.github.com/users/popravich/repos","events_url":"https://api.github.com/users/popravich/events{/privacy}","received_events_url":"https://api.github.com/users/popravich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/popravich/vagga","description":"Vagga is a containerisation tool without daemons","fork":true,"url":"https://api.github.com/repos/popravich/vagga","forks_url":"https://api.github.com/repos/popravich/vagga/forks","keys_url":"https://api.github.com/repos/popravich/vagga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/popravich/vagga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/popravich/vagga/teams","hooks_url":"https://api.github.com/repos/popravich/vagga/hooks","issue_events_url":"https://api.github.com/repos/popravich/vagga/issues/events{/number}","events_url":"https://api.github.com/repos/popravich/vagga/events","assignees_url":"https://api.github.com/repos/popravich/vagga/assignees{/user}","branches_url":"https://api.github.com/repos/popravich/vagga/branches{/branch}","tags_url":"https://api.github.com/repos/popravich/vagga/tags","blobs_url":"https://api.github.com/repos/popravich/vagga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/popravich/vagga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/popravich/vagga/git/refs{/sha}","trees_url":"https://api.github.com/repos/popravich/vagga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/popravich/vagga/statuses/{sha}","languages_url":"https://api.github.com/repos/popravich/vagga/languages","stargazers_url":"https://api.github.com/repos/popravich/vagga/stargazers","contributors_url":"https://api.github.com/repos/popravich/vagga/contributors","subscribers_url":"https://api.github.com/repos/popravich/vagga/subscribers","subscription_url":"https://api.github.com/repos/popravich/vagga/subscription","commits_url":"https://api.github.com/repos/popravich/vagga/commits{/sha}","git_commits_url":"https://api.github.com/repos/popravich/vagga/git/commits{/sha}","comments_url":"https://api.github.com/repos/popravich/vagga/comments{/number}","issue_comment_url":"https://api.github.com/repos/popravich/vagga/issues/comments{/number}","contents_url":"https://api.github.com/repos/popravich/vagga/contents/{+path}","compare_url":"https://api.github.com/repos/popravich/vagga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/popravich/vagga/merges","archive_url":"https://api.github.com/repos/popravich/vagga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/popravich/vagga/downloads","issues_url":"https://api.github.com/repos/popravich/vagga/issues{/number}","pulls_url":"https://api.github.com/repos/popravich/vagga/pulls{/number}","milestones_url":"https://api.github.com/repos/popravich/vagga/milestones{/number}","notifications_url":"https://api.github.com/repos/popravich/vagga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/popravich/vagga/labels{/name}","releases_url":"https://api.github.com/repos/popravich/vagga/releases{/id}","deployments_url":"https://api.github.com/repos/popravich/vagga/deployments","created_at":"2015-09-22T13:14:24Z","updated_at":"2016-02-16T11:46:32Z","pushed_at":"2016-05-17T20:27:54Z","git_url":"git://github.com/popravich/vagga.git","ssh_url":"git@github.com:popravich/vagga.git","clone_url":"https://github.com/popravich/vagga.git","svn_url":"https://github.com/popravich/vagga","homepage":"http://vagga.readthedocs.org","size":4096,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"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":0,"default_branch":"master"}},"base":{"label":"tailhook:master","ref":"master","sha":"3ce990f8315d463515ce94bfee0df9583b725685","user":{"login":"tailhook","id":321799,"avatar_url":"https://avatars.githubusercontent.com/u/321799?v=3","gravatar_id":"","url":"https://api.github.com/users/tailhook","html_url":"https://github.com/tailhook","followers_url":"https://api.github.com/users/tailhook/followers","following_url":"https://api.github.com/users/tailhook/following{/other_user}","gists_url":"https://api.github.com/users/tailhook/gists{/gist_id}","starred_url":"https://api.github.com/users/tailhook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tailhook/subscriptions","organizations_url":"https://api.github.com/users/tailhook/orgs","repos_url":"https://api.github.com/users/tailhook/repos","events_url":"https://api.github.com/users/tailhook/events{/privacy}","received_events_url":"https://api.github.com/users/tailhook/received_events","type":"User","site_admin":false},"repo":{"id":22660519,"name":"vagga","full_name":"tailhook/vagga","owner":{"login":"tailhook","id":321799,"avatar_url":"https://avatars.githubusercontent.com/u/321799?v=3","gravatar_id":"","url":"https://api.github.com/users/tailhook","html_url":"https://github.com/tailhook","followers_url":"https://api.github.com/users/tailhook/followers","following_url":"https://api.github.com/users/tailhook/following{/other_user}","gists_url":"https://api.github.com/users/tailhook/gists{/gist_id}","starred_url":"https://api.github.com/users/tailhook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tailhook/subscriptions","organizations_url":"https://api.github.com/users/tailhook/orgs","repos_url":"https://api.github.com/users/tailhook/repos","events_url":"https://api.github.com/users/tailhook/events{/privacy}","received_events_url":"https://api.github.com/users/tailhook/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tailhook/vagga","description":"Vagga is a containerization tool without daemons","fork":false,"url":"https://api.github.com/repos/tailhook/vagga","forks_url":"https://api.github.com/repos/tailhook/vagga/forks","keys_url":"https://api.github.com/repos/tailhook/vagga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tailhook/vagga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tailhook/vagga/teams","hooks_url":"https://api.github.com/repos/tailhook/vagga/hooks","issue_events_url":"https://api.github.com/repos/tailhook/vagga/issues/events{/number}","events_url":"https://api.github.com/repos/tailhook/vagga/events","assignees_url":"https://api.github.com/repos/tailhook/vagga/assignees{/user}","branches_url":"https://api.github.com/repos/tailhook/vagga/branches{/branch}","tags_url":"https://api.github.com/repos/tailhook/vagga/tags","blobs_url":"https://api.github.com/repos/tailhook/vagga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tailhook/vagga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tailhook/vagga/git/refs{/sha}","trees_url":"https://api.github.com/repos/tailhook/vagga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tailhook/vagga/statuses/{sha}","languages_url":"https://api.github.com/repos/tailhook/vagga/languages","stargazers_url":"https://api.github.com/repos/tailhook/vagga/stargazers","contributors_url":"https://api.github.com/repos/tailhook/vagga/contributors","subscribers_url":"https://api.github.com/repos/tailhook/vagga/subscribers","subscription_url":"https://api.github.com/repos/tailhook/vagga/subscription","commits_url":"https://api.github.com/repos/tailhook/vagga/commits{/sha}","git_commits_url":"https://api.github.com/repos/tailhook/vagga/git/commits{/sha}","comments_url":"https://api.github.com/repos/tailhook/vagga/comments{/number}","issue_comment_url":"https://api.github.com/repos/tailhook/vagga/issues/comments{/number}","contents_url":"https://api.github.com/repos/tailhook/vagga/contents/{+path}","compare_url":"https://api.github.com/repos/tailhook/vagga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tailhook/vagga/merges","archive_url":"https://api.github.com/repos/tailhook/vagga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tailhook/vagga/downloads","issues_url":"https://api.github.com/repos/tailhook/vagga/issues{/number}","pulls_url":"https://api.github.com/repos/tailhook/vagga/pulls{/number}","milestones_url":"https://api.github.com/repos/tailhook/vagga/milestones{/number}","notifications_url":"https://api.github.com/repos/tailhook/vagga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tailhook/vagga/labels{/name}","releases_url":"https://api.github.com/repos/tailhook/vagga/releases{/id}","deployments_url":"https://api.github.com/repos/tailhook/vagga/deployments","created_at":"2014-08-05T21:43:56Z","updated_at":"2016-05-17T17:42:02Z","pushed_at":"2016-05-17T20:27:54Z","git_url":"git://github.com/tailhook/vagga.git","ssh_url":"git@github.com:tailhook/vagga.git","clone_url":"https://github.com/tailhook/vagga.git","svn_url":"https://github.com/tailhook/vagga","homepage":"http://vagga.readthedocs.org","size":4176,"stargazers_count":805,"watchers_count":805,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":54,"forks":39,"open_issues":54,"watchers":805,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tailhook/vagga/pulls/251"},"html":{"href":"https://github.com/tailhook/vagga/pull/251"},"issue":{"href":"https://api.github.com/repos/tailhook/vagga/issues/251"},"comments":{"href":"https://api.github.com/repos/tailhook/vagga/issues/251/comments"},"review_comments":{"href":"https://api.github.com/repos/tailhook/vagga/pulls/251/comments"},"review_comment":{"href":"https://api.github.com/repos/tailhook/vagga/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tailhook/vagga/pulls/251/commits"},"statuses":{"href":"https://api.github.com/repos/tailhook/vagga/statuses/10e5961a21c0df2007ae88a5b9870dc48178237c"}}}}