{"action":"created","comment":{"url":"https://api.github.com/repos/dlang/tools/pulls/comments/76525957","id":76525957,"diff_hunk":"@@ -694,10 +714,13 @@ private string[string] getDependencies(string rootModule, string workDir,\n     immutable rootDir = dirName(rootModule);\n \n     // Collect dependencies\n-    auto depsGetter =\n-        // \"cd \"~shellQuote(rootDir)~\" && \"\n-        [ compiler ] ~ compilerFlags ~\n-        [\"-v\", \"-o-\", rootModule, \"-I\"~rootDir];\n+    auto depsGetter = [ compiler ] ~ compilerFlags ~ [\n+        \"-v\",\n+        \"-c\",\n+        \"-of\"~buildPath(objDir, \"rdmd.root\"~objExt),\n+        rootModule,\n+        \"-I\"~rootDir\n+    ];\n \n     scope(failure)\n     {","path":"rdmd.d","position":155,"original_position":155,"commit_id":"10ca1582c4f037a63a1a91befc458458c1e668b2","original_commit_id":"10ca1582c4f037a63a1a91befc458458c1e668b2","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"body":"While `run` can throw (e.g. writing the output file), it just returns an exit code if the spawned process fails.\r\nIn `rebuild` errors are handled by just checking for the exit code.","created_at":"2016-08-28T04:29:19Z","updated_at":"2016-08-28T04:29:19Z","html_url":"https://github.com/dlang/tools/pull/194#discussion_r76525957","pull_request_url":"https://api.github.com/repos/dlang/tools/pulls/194","_links":{"self":{"href":"https://api.github.com/repos/dlang/tools/pulls/comments/76525957"},"html":{"href":"https://github.com/dlang/tools/pull/194#discussion_r76525957"},"pull_request":{"href":"https://api.github.com/repos/dlang/tools/pulls/194"}}},"pull_request":{"url":"https://api.github.com/repos/dlang/tools/pulls/194","id":83001456,"html_url":"https://github.com/dlang/tools/pull/194","diff_url":"https://github.com/dlang/tools/pull/194.diff","patch_url":"https://github.com/dlang/tools/pull/194.patch","issue_url":"https://api.github.com/repos/dlang/tools/issues/194","number":194,"state":"open","locked":false,"title":"rdmd: compile the root module in the same step as getting the dependencies","user":{"login":"aG0aep6G","id":9287500,"avatar_url":"https://avatars.githubusercontent.com/u/9287500?v=3","gravatar_id":"","url":"https://api.github.com/users/aG0aep6G","html_url":"https://github.com/aG0aep6G","followers_url":"https://api.github.com/users/aG0aep6G/followers","following_url":"https://api.github.com/users/aG0aep6G/following{/other_user}","gists_url":"https://api.github.com/users/aG0aep6G/gists{/gist_id}","starred_url":"https://api.github.com/users/aG0aep6G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aG0aep6G/subscriptions","organizations_url":"https://api.github.com/users/aG0aep6G/orgs","repos_url":"https://api.github.com/users/aG0aep6G/repos","events_url":"https://api.github.com/users/aG0aep6G/events{/privacy}","received_events_url":"https://api.github.com/users/aG0aep6G/received_events","type":"User","site_admin":false},"body":"As suggested by Andrei in [a comment](https://github.com/dlang/tools/pull/191#issuecomment-242746480) on #191. Consequently, this is an alternative to #191.\r\n\r\n## Little benchmark\r\n\r\nUsed bash's builtin `time` with `TIMEFORMAT=%R` to get simple output.\r\nAll times are the best of 3 runs.\r\n`rdmd_master` is the current master (1260719a9ce64b012dac5c6287e179353afaaefa).\r\n`rdmd_single_out_root` is the one from this PR.\r\nfoo.d is <http://sprunge.us/ZZhR>, taken from #191.\r\n\r\n### single file\r\n\r\n```\r\n$ time ./rdmd_master --force foo.d > /dev/null\r\n1.142\r\n$ time ./rdmd_single_out_root --force foo.d > /dev/null\r\n0.747\r\n```\r\n\r\nGood improvement here.\r\n\r\n\r\n### trivial root, complex import\r\n\r\nbar.d is `import foo;`.\r\n\r\n```\r\n$ time ./rdmd_master --force bar.d > /dev/null\r\n0.935\r\n$ time ./rdmd_single_out_root --force bar.d > /dev/null\r\n0.937\r\n```\r\n\r\nAs expected, no change here.\r\n\r\n\r\n### complex root, trivial import\r\n\r\nbaz.d is foo.d plus `import qux;`.\r\nqux.d is an empty file.\r\n\r\n```\r\n$ time ./rdmd_master --force baz.d > /dev/null\r\n1.144\r\n$ time ./rdmd_single_out_root --force baz.d > /dev/null\r\n0.763\r\n```\r\n\r\nThis is improving too, because the root isn't compiled again when the import is compiled.\r\n\r\n\r\n### reuse cached executable\r\n\r\n```\r\n$ time ./rdmd_master foo.d > /dev/null\r\n0.013\r\n$ time ./rdmd_single_out_root foo.d > /dev/null\r\n0.012\r\n```\r\n\r\nNo bad surprise here.","created_at":"2016-08-27T23:31:35Z","updated_at":"2016-08-28T04:29:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cae5a72745a390a3284406edbd396b69daa23cc","assignee":{"login":"CyberShadow","id":160894,"avatar_url":"https://avatars.githubusercontent.com/u/160894?v=3","gravatar_id":"","url":"https://api.github.com/users/CyberShadow","html_url":"https://github.com/CyberShadow","followers_url":"https://api.github.com/users/CyberShadow/followers","following_url":"https://api.github.com/users/CyberShadow/following{/other_user}","gists_url":"https://api.github.com/users/CyberShadow/gists{/gist_id}","starred_url":"https://api.github.com/users/CyberShadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyberShadow/subscriptions","organizations_url":"https://api.github.com/users/CyberShadow/orgs","repos_url":"https://api.github.com/users/CyberShadow/repos","events_url":"https://api.github.com/users/CyberShadow/events{/privacy}","received_events_url":"https://api.github.com/users/CyberShadow/received_events","type":"User","site_admin":false},"assignees":[{"login":"CyberShadow","id":160894,"avatar_url":"https://avatars.githubusercontent.com/u/160894?v=3","gravatar_id":"","url":"https://api.github.com/users/CyberShadow","html_url":"https://github.com/CyberShadow","followers_url":"https://api.github.com/users/CyberShadow/followers","following_url":"https://api.github.com/users/CyberShadow/following{/other_user}","gists_url":"https://api.github.com/users/CyberShadow/gists{/gist_id}","starred_url":"https://api.github.com/users/CyberShadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyberShadow/subscriptions","organizations_url":"https://api.github.com/users/CyberShadow/orgs","repos_url":"https://api.github.com/users/CyberShadow/repos","events_url":"https://api.github.com/users/CyberShadow/events{/privacy}","received_events_url":"https://api.github.com/users/CyberShadow/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dlang/tools/pulls/194/commits","review_comments_url":"https://api.github.com/repos/dlang/tools/pulls/194/comments","review_comment_url":"https://api.github.com/repos/dlang/tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlang/tools/issues/194/comments","statuses_url":"https://api.github.com/repos/dlang/tools/statuses/10ca1582c4f037a63a1a91befc458458c1e668b2","head":{"label":"aG0aep6G:rdmd-single-out-root","ref":"rdmd-single-out-root","sha":"10ca1582c4f037a63a1a91befc458458c1e668b2","user":{"login":"aG0aep6G","id":9287500,"avatar_url":"https://avatars.githubusercontent.com/u/9287500?v=3","gravatar_id":"","url":"https://api.github.com/users/aG0aep6G","html_url":"https://github.com/aG0aep6G","followers_url":"https://api.github.com/users/aG0aep6G/followers","following_url":"https://api.github.com/users/aG0aep6G/following{/other_user}","gists_url":"https://api.github.com/users/aG0aep6G/gists{/gist_id}","starred_url":"https://api.github.com/users/aG0aep6G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aG0aep6G/subscriptions","organizations_url":"https://api.github.com/users/aG0aep6G/orgs","repos_url":"https://api.github.com/users/aG0aep6G/repos","events_url":"https://api.github.com/users/aG0aep6G/events{/privacy}","received_events_url":"https://api.github.com/users/aG0aep6G/received_events","type":"User","site_admin":false},"repo":{"id":37431805,"name":"tools","full_name":"aG0aep6G/tools","owner":{"login":"aG0aep6G","id":9287500,"avatar_url":"https://avatars.githubusercontent.com/u/9287500?v=3","gravatar_id":"","url":"https://api.github.com/users/aG0aep6G","html_url":"https://github.com/aG0aep6G","followers_url":"https://api.github.com/users/aG0aep6G/followers","following_url":"https://api.github.com/users/aG0aep6G/following{/other_user}","gists_url":"https://api.github.com/users/aG0aep6G/gists{/gist_id}","starred_url":"https://api.github.com/users/aG0aep6G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aG0aep6G/subscriptions","organizations_url":"https://api.github.com/users/aG0aep6G/orgs","repos_url":"https://api.github.com/users/aG0aep6G/repos","events_url":"https://api.github.com/users/aG0aep6G/events{/privacy}","received_events_url":"https://api.github.com/users/aG0aep6G/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aG0aep6G/tools","description":"Ancillary tools for the D programming language compiler","fork":true,"url":"https://api.github.com/repos/aG0aep6G/tools","forks_url":"https://api.github.com/repos/aG0aep6G/tools/forks","keys_url":"https://api.github.com/repos/aG0aep6G/tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aG0aep6G/tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aG0aep6G/tools/teams","hooks_url":"https://api.github.com/repos/aG0aep6G/tools/hooks","issue_events_url":"https://api.github.com/repos/aG0aep6G/tools/issues/events{/number}","events_url":"https://api.github.com/repos/aG0aep6G/tools/events","assignees_url":"https://api.github.com/repos/aG0aep6G/tools/assignees{/user}","branches_url":"https://api.github.com/repos/aG0aep6G/tools/branches{/branch}","tags_url":"https://api.github.com/repos/aG0aep6G/tools/tags","blobs_url":"https://api.github.com/repos/aG0aep6G/tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aG0aep6G/tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aG0aep6G/tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/aG0aep6G/tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aG0aep6G/tools/statuses/{sha}","languages_url":"https://api.github.com/repos/aG0aep6G/tools/languages","stargazers_url":"https://api.github.com/repos/aG0aep6G/tools/stargazers","contributors_url":"https://api.github.com/repos/aG0aep6G/tools/contributors","subscribers_url":"https://api.github.com/repos/aG0aep6G/tools/subscribers","subscription_url":"https://api.github.com/repos/aG0aep6G/tools/subscription","commits_url":"https://api.github.com/repos/aG0aep6G/tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/aG0aep6G/tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/aG0aep6G/tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/aG0aep6G/tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/aG0aep6G/tools/contents/{+path}","compare_url":"https://api.github.com/repos/aG0aep6G/tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aG0aep6G/tools/merges","archive_url":"https://api.github.com/repos/aG0aep6G/tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aG0aep6G/tools/downloads","issues_url":"https://api.github.com/repos/aG0aep6G/tools/issues{/number}","pulls_url":"https://api.github.com/repos/aG0aep6G/tools/pulls{/number}","milestones_url":"https://api.github.com/repos/aG0aep6G/tools/milestones{/number}","notifications_url":"https://api.github.com/repos/aG0aep6G/tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aG0aep6G/tools/labels{/name}","releases_url":"https://api.github.com/repos/aG0aep6G/tools/releases{/id}","deployments_url":"https://api.github.com/repos/aG0aep6G/tools/deployments","created_at":"2015-06-14T22:20:03Z","updated_at":"2015-06-14T22:20:04Z","pushed_at":"2016-08-27T22:40:48Z","git_url":"git://github.com/aG0aep6G/tools.git","ssh_url":"git@github.com:aG0aep6G/tools.git","clone_url":"https://github.com/aG0aep6G/tools.git","svn_url":"https://github.com/aG0aep6G/tools","homepage":"http://dlang.org","size":433,"stargazers_count":0,"watchers_count":0,"language":"D","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":"dlang:master","ref":"master","sha":"1260719a9ce64b012dac5c6287e179353afaaefa","user":{"login":"dlang","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"repo":{"id":1262864,"name":"tools","full_name":"dlang/tools","owner":{"login":"dlang","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dlang/tools","description":"Ancillary tools for the D programming language compiler","fork":false,"url":"https://api.github.com/repos/dlang/tools","forks_url":"https://api.github.com/repos/dlang/tools/forks","keys_url":"https://api.github.com/repos/dlang/tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlang/tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlang/tools/teams","hooks_url":"https://api.github.com/repos/dlang/tools/hooks","issue_events_url":"https://api.github.com/repos/dlang/tools/issues/events{/number}","events_url":"https://api.github.com/repos/dlang/tools/events","assignees_url":"https://api.github.com/repos/dlang/tools/assignees{/user}","branches_url":"https://api.github.com/repos/dlang/tools/branches{/branch}","tags_url":"https://api.github.com/repos/dlang/tools/tags","blobs_url":"https://api.github.com/repos/dlang/tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlang/tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlang/tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlang/tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlang/tools/statuses/{sha}","languages_url":"https://api.github.com/repos/dlang/tools/languages","stargazers_url":"https://api.github.com/repos/dlang/tools/stargazers","contributors_url":"https://api.github.com/repos/dlang/tools/contributors","subscribers_url":"https://api.github.com/repos/dlang/tools/subscribers","subscription_url":"https://api.github.com/repos/dlang/tools/subscription","commits_url":"https://api.github.com/repos/dlang/tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlang/tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlang/tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlang/tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlang/tools/contents/{+path}","compare_url":"https://api.github.com/repos/dlang/tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlang/tools/merges","archive_url":"https://api.github.com/repos/dlang/tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlang/tools/downloads","issues_url":"https://api.github.com/repos/dlang/tools/issues{/number}","pulls_url":"https://api.github.com/repos/dlang/tools/pulls{/number}","milestones_url":"https://api.github.com/repos/dlang/tools/milestones{/number}","notifications_url":"https://api.github.com/repos/dlang/tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlang/tools/labels{/name}","releases_url":"https://api.github.com/repos/dlang/tools/releases{/id}","deployments_url":"https://api.github.com/repos/dlang/tools/deployments","created_at":"2011-01-17T09:07:05Z","updated_at":"2016-08-26T19:37:32Z","pushed_at":"2016-08-28T03:00:22Z","git_url":"git://github.com/dlang/tools.git","ssh_url":"git@github.com:dlang/tools.git","clone_url":"https://github.com/dlang/tools.git","svn_url":"https://github.com/dlang/tools","homepage":"http://dlang.org","size":851,"stargazers_count":99,"watchers_count":99,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":8,"forks":98,"open_issues":8,"watchers":99,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlang/tools/pulls/194"},"html":{"href":"https://github.com/dlang/tools/pull/194"},"issue":{"href":"https://api.github.com/repos/dlang/tools/issues/194"},"comments":{"href":"https://api.github.com/repos/dlang/tools/issues/194/comments"},"review_comments":{"href":"https://api.github.com/repos/dlang/tools/pulls/194/comments"},"review_comment":{"href":"https://api.github.com/repos/dlang/tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlang/tools/pulls/194/commits"},"statuses":{"href":"https://api.github.com/repos/dlang/tools/statuses/10ca1582c4f037a63a1a91befc458458c1e668b2"}}}}
{"actor":{"display_login":"wilzbach"}}