{"action":"created","comment":{"url":"https://api.github.com/repos/emscripten-core/emscripten/pulls/comments/316462372","pull_request_review_id":278147645,"id":316462372,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNjQ2MjM3Mg==","diff_hunk":"@@ -437,43 +437,55 @@ def test_emcc_5(self):\n         self.assertContained('hello, world!', run_js('a.out.js'))\n         assert test(open('a.out.js').read()), text\n \n-  def test_emcc_6(self):\n-    for compiler in [EMCC, EMXX]:\n-      # Compiling two source files into a final JS.\n-      for args, target in [([], 'a.out.js'), (['-o', 'combined.js'], 'combined.js')]:\n-        self.clear()\n-        run_process([PYTHON, compiler, path_from_root('tests', 'twopart_main.cpp'), path_from_root('tests', 'twopart_side.cpp')] + args)\n-        self.assertContained('side got: hello from main, over', run_js(target))\n+  def test_multiple_sources(self):\n+    # Compiling two sources at a time should work.\n+    cmd = [PYTHON, EMCC, '-c', path_from_root('tests', 'twopart_main.cpp'), path_from_root('tests', 'twopart_side.cpp')]\n+    run_process(cmd)\n \n-        # Compiling two files with -c will generate separate .bc files\n-        self.clear()\n-        expect_error = '-o' in args # specifying -o and -c is an error\n-        cmd = [PYTHON, compiler, path_from_root('tests', 'twopart_main.cpp'), path_from_root('tests', 'twopart_side.cpp'), '-c'] + args\n-        if expect_error:\n-          err = self.expect_fail(cmd)\n-          self.assertContained('fatal error', err)\n-          continue\n+    # Object files should be generated by default in the current working\n+    # directory, and not alongside the sources.\n+    self.assertExists('twopart_main.o')\n+    self.assertExists('twopart_side.o')\n+    self.assertNotExists(path_from_root('tests', 'twopart_main.o'))\n+    self.assertNotExists(path_from_root('tests', 'twopart_side.o'))\n \n-        run_process(cmd)\n-        try_delete(target)\n-\n-        # Compiling one of them alone is expected to fail\n-        run_process([PYTHON, compiler, 'twopart_main.o', '-O1', '-g', '-s', 'WARN_ON_UNDEFINED_SYMBOLS=0'] + args)\n-        self.assertContained('missing function', run_js(target, stderr=STDOUT, assert_returncode=None))\n-        try_delete(target)\n-\n-        # Combining those object files into js should work\n-        run_process([PYTHON, compiler, 'twopart_main.o', 'twopart_side.o'] + args)\n-        self.assertContained('side got: hello from main, over', run_js(target))\n-\n-        # Combining object files into another object should also work\n-        try_delete(target)\n-        run_process([PYTHON, compiler, 'twopart_main.o', 'twopart_side.o', '-o', 'combined.o'] + args)\n-        syms = Building.llvm_nm('combined.o')\n-        assert len(syms.defs) in (2, 3) and 'main' in syms.defs, 'Should be two functions (and in the wasm backend, also __original_main)'\n-        run_process([PYTHON, compiler, 'combined.o', '-o', 'combined.o.js'])\n-        self.assertExists('combined.o.js')\n-        self.assertContained('side got: hello from main, over', run_js('combined.o.js'))\n+    # But it is an error if '-o' is also specified.\n+    self.clear()\n+    err = self.expect_fail(cmd + ['-o', 'out.o'])\n+\n+    self.assertContained('cannot specify -o with -c/S and multiple source files', err)\n+    self.assertNotExists('twopart_main.o')","path":"tests/test_other.py","position":56,"original_position":56,"commit_id":"9896a9b3e9bffe8aa8f7a19bc2541bb5981acb5b","original_commit_id":"9896a9b3e9bffe8aa8f7a19bc2541bb5981acb5b","user":{"login":"sbc100","id":515813,"node_id":"MDQ6VXNlcjUxNTgxMw==","avatar_url":"https://avatars2.githubusercontent.com/u/515813?v=4","gravatar_id":"","url":"https://api.github.com/users/sbc100","html_url":"https://github.com/sbc100","followers_url":"https://api.github.com/users/sbc100/followers","following_url":"https://api.github.com/users/sbc100/following{/other_user}","gists_url":"https://api.github.com/users/sbc100/gists{/gist_id}","starred_url":"https://api.github.com/users/sbc100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbc100/subscriptions","organizations_url":"https://api.github.com/users/sbc100/orgs","repos_url":"https://api.github.com/users/sbc100/repos","events_url":"https://api.github.com/users/sbc100/events{/privacy}","received_events_url":"https://api.github.com/users/sbc100/received_events","type":"User","site_admin":false},"body":"Yes we had a case where were leaking object files alongside the source files.\r\n\r\nThere is more extensive fix I could do, but moving the check earlier before we do any compilation seems simpler for now, as well as strictly better.","created_at":"2019-08-22T01:13:46Z","updated_at":"2019-08-22T01:13:46Z","html_url":"https://github.com/emscripten-core/emscripten/pull/9291#discussion_r316462372","pull_request_url":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/emscripten-core/emscripten/pulls/comments/316462372"},"html":{"href":"https://github.com/emscripten-core/emscripten/pull/9291#discussion_r316462372"},"pull_request":{"href":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291"}},"in_reply_to_id":316461174},"pull_request":{"url":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291","id":309735262,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA5NzM1MjYy","html_url":"https://github.com/emscripten-core/emscripten/pull/9291","diff_url":"https://github.com/emscripten-core/emscripten/pull/9291.diff","patch_url":"https://github.com/emscripten-core/emscripten/pull/9291.patch","issue_url":"https://api.github.com/repos/emscripten-core/emscripten/issues/9291","number":9291,"state":"open","locked":false,"title":"Error out earlier with -c + -o and multiple input files","user":{"login":"sbc100","id":515813,"node_id":"MDQ6VXNlcjUxNTgxMw==","avatar_url":"https://avatars2.githubusercontent.com/u/515813?v=4","gravatar_id":"","url":"https://api.github.com/users/sbc100","html_url":"https://github.com/sbc100","followers_url":"https://api.github.com/users/sbc100/followers","following_url":"https://api.github.com/users/sbc100/following{/other_user}","gists_url":"https://api.github.com/users/sbc100/gists{/gist_id}","starred_url":"https://api.github.com/users/sbc100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbc100/subscriptions","organizations_url":"https://api.github.com/users/sbc100/orgs","repos_url":"https://api.github.com/users/sbc100/repos","events_url":"https://api.github.com/users/sbc100/events{/privacy}","received_events_url":"https://api.github.com/users/sbc100/received_events","type":"User","site_admin":false},"body":"This also happens to prevent the leaking of object files alongside\r\nsource files in this case.\r\n\r\nThis change also refactors and cleans up the tests around this error.\r\n\r\n","created_at":"2019-08-22T00:24:21Z","updated_at":"2019-08-22T01:13:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0095fd9cb5b304843a983f12e7e0a744b1f22e60","assignee":null,"assignees":[],"requested_reviewers":[{"login":"kripken","id":173661,"node_id":"MDQ6VXNlcjE3MzY2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291/commits","review_comments_url":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291/comments","review_comment_url":"https://api.github.com/repos/emscripten-core/emscripten/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emscripten-core/emscripten/issues/9291/comments","statuses_url":"https://api.github.com/repos/emscripten-core/emscripten/statuses/9896a9b3e9bffe8aa8f7a19bc2541bb5981acb5b","head":{"label":"emscripten-core:multiple_input_sources","ref":"multiple_input_sources","sha":"9896a9b3e9bffe8aa8f7a19bc2541bb5981acb5b","user":{"login":"emscripten-core","id":46011144,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDExMTQ0","avatar_url":"https://avatars3.githubusercontent.com/u/46011144?v=4","gravatar_id":"","url":"https://api.github.com/users/emscripten-core","html_url":"https://github.com/emscripten-core","followers_url":"https://api.github.com/users/emscripten-core/followers","following_url":"https://api.github.com/users/emscripten-core/following{/other_user}","gists_url":"https://api.github.com/users/emscripten-core/gists{/gist_id}","starred_url":"https://api.github.com/users/emscripten-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emscripten-core/subscriptions","organizations_url":"https://api.github.com/users/emscripten-core/orgs","repos_url":"https://api.github.com/users/emscripten-core/repos","events_url":"https://api.github.com/users/emscripten-core/events{/privacy}","received_events_url":"https://api.github.com/users/emscripten-core/received_events","type":"Organization","site_admin":false},"repo":{"id":1357796,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU3Nzk2","name":"emscripten","full_name":"emscripten-core/emscripten","private":false,"owner":{"login":"emscripten-core","id":46011144,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDExMTQ0","avatar_url":"https://avatars3.githubusercontent.com/u/46011144?v=4","gravatar_id":"","url":"https://api.github.com/users/emscripten-core","html_url":"https://github.com/emscripten-core","followers_url":"https://api.github.com/users/emscripten-core/followers","following_url":"https://api.github.com/users/emscripten-core/following{/other_user}","gists_url":"https://api.github.com/users/emscripten-core/gists{/gist_id}","starred_url":"https://api.github.com/users/emscripten-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emscripten-core/subscriptions","organizations_url":"https://api.github.com/users/emscripten-core/orgs","repos_url":"https://api.github.com/users/emscripten-core/repos","events_url":"https://api.github.com/users/emscripten-core/events{/privacy}","received_events_url":"https://api.github.com/users/emscripten-core/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/emscripten-core/emscripten","description":"Emscripten: An LLVM-to-Web Compiler","fork":false,"url":"https://api.github.com/repos/emscripten-core/emscripten","forks_url":"https://api.github.com/repos/emscripten-core/emscripten/forks","keys_url":"https://api.github.com/repos/emscripten-core/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emscripten-core/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emscripten-core/emscripten/teams","hooks_url":"https://api.github.com/repos/emscripten-core/emscripten/hooks","issue_events_url":"https://api.github.com/repos/emscripten-core/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/emscripten-core/emscripten/events","assignees_url":"https://api.github.com/repos/emscripten-core/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/emscripten-core/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/emscripten-core/emscripten/tags","blobs_url":"https://api.github.com/repos/emscripten-core/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emscripten-core/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emscripten-core/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/emscripten-core/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emscripten-core/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/emscripten-core/emscripten/languages","stargazers_url":"https://api.github.com/repos/emscripten-core/emscripten/stargazers","contributors_url":"https://api.github.com/repos/emscripten-core/emscripten/contributors","subscribers_url":"https://api.github.com/repos/emscripten-core/emscripten/subscribers","subscription_url":"https://api.github.com/repos/emscripten-core/emscripten/subscription","commits_url":"https://api.github.com/repos/emscripten-core/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/emscripten-core/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/emscripten-core/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/emscripten-core/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/emscripten-core/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/emscripten-core/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emscripten-core/emscripten/merges","archive_url":"https://api.github.com/repos/emscripten-core/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emscripten-core/emscripten/downloads","issues_url":"https://api.github.com/repos/emscripten-core/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/emscripten-core/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/emscripten-core/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/emscripten-core/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emscripten-core/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/emscripten-core/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/emscripten-core/emscripten/deployments","created_at":"2011-02-12T05:23:30Z","updated_at":"2019-08-22T00:40:47Z","pushed_at":"2019-08-22T00:47:49Z","git_url":"git://github.com/emscripten-core/emscripten.git","ssh_url":"git@github.com:emscripten-core/emscripten.git","clone_url":"https://github.com/emscripten-core/emscripten.git","svn_url":"https://github.com/emscripten-core/emscripten","homepage":"","size":198003,"stargazers_count":17699,"watchers_count":17699,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2083,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1926,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2083,"open_issues":1926,"watchers":17699,"default_branch":"incoming"}},"base":{"label":"emscripten-core:incoming","ref":"incoming","sha":"b11766a5cb4473d994987ec13abb55a9a349711b","user":{"login":"emscripten-core","id":46011144,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDExMTQ0","avatar_url":"https://avatars3.githubusercontent.com/u/46011144?v=4","gravatar_id":"","url":"https://api.github.com/users/emscripten-core","html_url":"https://github.com/emscripten-core","followers_url":"https://api.github.com/users/emscripten-core/followers","following_url":"https://api.github.com/users/emscripten-core/following{/other_user}","gists_url":"https://api.github.com/users/emscripten-core/gists{/gist_id}","starred_url":"https://api.github.com/users/emscripten-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emscripten-core/subscriptions","organizations_url":"https://api.github.com/users/emscripten-core/orgs","repos_url":"https://api.github.com/users/emscripten-core/repos","events_url":"https://api.github.com/users/emscripten-core/events{/privacy}","received_events_url":"https://api.github.com/users/emscripten-core/received_events","type":"Organization","site_admin":false},"repo":{"id":1357796,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU3Nzk2","name":"emscripten","full_name":"emscripten-core/emscripten","private":false,"owner":{"login":"emscripten-core","id":46011144,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDExMTQ0","avatar_url":"https://avatars3.githubusercontent.com/u/46011144?v=4","gravatar_id":"","url":"https://api.github.com/users/emscripten-core","html_url":"https://github.com/emscripten-core","followers_url":"https://api.github.com/users/emscripten-core/followers","following_url":"https://api.github.com/users/emscripten-core/following{/other_user}","gists_url":"https://api.github.com/users/emscripten-core/gists{/gist_id}","starred_url":"https://api.github.com/users/emscripten-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emscripten-core/subscriptions","organizations_url":"https://api.github.com/users/emscripten-core/orgs","repos_url":"https://api.github.com/users/emscripten-core/repos","events_url":"https://api.github.com/users/emscripten-core/events{/privacy}","received_events_url":"https://api.github.com/users/emscripten-core/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/emscripten-core/emscripten","description":"Emscripten: An LLVM-to-Web Compiler","fork":false,"url":"https://api.github.com/repos/emscripten-core/emscripten","forks_url":"https://api.github.com/repos/emscripten-core/emscripten/forks","keys_url":"https://api.github.com/repos/emscripten-core/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emscripten-core/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emscripten-core/emscripten/teams","hooks_url":"https://api.github.com/repos/emscripten-core/emscripten/hooks","issue_events_url":"https://api.github.com/repos/emscripten-core/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/emscripten-core/emscripten/events","assignees_url":"https://api.github.com/repos/emscripten-core/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/emscripten-core/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/emscripten-core/emscripten/tags","blobs_url":"https://api.github.com/repos/emscripten-core/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emscripten-core/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emscripten-core/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/emscripten-core/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emscripten-core/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/emscripten-core/emscripten/languages","stargazers_url":"https://api.github.com/repos/emscripten-core/emscripten/stargazers","contributors_url":"https://api.github.com/repos/emscripten-core/emscripten/contributors","subscribers_url":"https://api.github.com/repos/emscripten-core/emscripten/subscribers","subscription_url":"https://api.github.com/repos/emscripten-core/emscripten/subscription","commits_url":"https://api.github.com/repos/emscripten-core/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/emscripten-core/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/emscripten-core/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/emscripten-core/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/emscripten-core/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/emscripten-core/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emscripten-core/emscripten/merges","archive_url":"https://api.github.com/repos/emscripten-core/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emscripten-core/emscripten/downloads","issues_url":"https://api.github.com/repos/emscripten-core/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/emscripten-core/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/emscripten-core/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/emscripten-core/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emscripten-core/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/emscripten-core/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/emscripten-core/emscripten/deployments","created_at":"2011-02-12T05:23:30Z","updated_at":"2019-08-22T00:40:47Z","pushed_at":"2019-08-22T00:47:49Z","git_url":"git://github.com/emscripten-core/emscripten.git","ssh_url":"git@github.com:emscripten-core/emscripten.git","clone_url":"https://github.com/emscripten-core/emscripten.git","svn_url":"https://github.com/emscripten-core/emscripten","homepage":"","size":198003,"stargazers_count":17699,"watchers_count":17699,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2083,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1926,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2083,"open_issues":1926,"watchers":17699,"default_branch":"incoming"}},"_links":{"self":{"href":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291"},"html":{"href":"https://github.com/emscripten-core/emscripten/pull/9291"},"issue":{"href":"https://api.github.com/repos/emscripten-core/emscripten/issues/9291"},"comments":{"href":"https://api.github.com/repos/emscripten-core/emscripten/issues/9291/comments"},"review_comments":{"href":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291/comments"},"review_comment":{"href":"https://api.github.com/repos/emscripten-core/emscripten/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emscripten-core/emscripten/pulls/9291/commits"},"statuses":{"href":"https://api.github.com/repos/emscripten-core/emscripten/statuses/9896a9b3e9bffe8aa8f7a19bc2541bb5981acb5b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sbc100"}}