{"action":"created","comment":{"url":"https://api.github.com/repos/mesonbuild/meson/pulls/comments/185205738","pull_request_review_id":116546876,"id":185205738,"diff_hunk":"@@ -2386,24 +2386,21 @@ def add_languages(self, args, required):\n             mlog.log('Native %s compiler: ' % comp.get_display_language(), mlog.bold(' '.join(comp.get_exelist())), version_string, sep='')\n \n             # If <language>_args/_link_args settings are given on the\n-            # command line, use them.\n+            # command line, use them, otherwise take them from env.\n+            (preproc_args, compile_args, link_args) = environment.get_args_from_envvars(comp)\n             for optspec in self.build.environment.cmd_line_options.projectoptions:\n                 (optname, optvalue) = optspec.split('=', maxsplit=1)\n-                if optname.endswith('_link_args'):\n-                    lang = optname[:-10]\n-                    self.coredata.external_link_args.setdefault(lang, []).append(optvalue)\n+                if optname == lang + '_link_args':\n+                    link_args = shlex.split(optvalue)\n                 elif optname.endswith('_args'):\n-                    lang = optname[:-5]\n-                    self.coredata.external_args.setdefault(lang, []).append(optvalue)\n-            # Otherwise, look for definitions from environment\n-            # variables such as CFLAGS.\n-            (preproc_args, compile_args, link_args) = environment.get_args_from_envvars(comp)\n-            if not comp.get_language() in self.coredata.external_preprocess_args:\n-                self.coredata.external_preprocess_args[comp.get_language()] = preproc_args\n-            if not comp.get_language() in self.coredata.external_args:\n-                self.coredata.external_args[comp.get_language()] = compile_args\n-            if not comp.get_language() in self.coredata.external_link_args:\n-                self.coredata.external_link_args[comp.get_language()] = link_args\n+                    compile_args = shlex.split(optvalue)","path":"mesonbuild/interpreter.py","position":26,"original_position":26,"commit_id":"19d0fb983a39bfbc72dcb0df6404d36be3c60202","original_commit_id":"19d0fb983a39bfbc72dcb0df6404d36be3c60202","user":{"login":"nirbheek","id":75801,"avatar_url":"https://avatars0.githubusercontent.com/u/75801?v=4","gravatar_id":"","url":"https://api.github.com/users/nirbheek","html_url":"https://github.com/nirbheek","followers_url":"https://api.github.com/users/nirbheek/followers","following_url":"https://api.github.com/users/nirbheek/following{/other_user}","gists_url":"https://api.github.com/users/nirbheek/gists{/gist_id}","starred_url":"https://api.github.com/users/nirbheek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirbheek/subscriptions","organizations_url":"https://api.github.com/users/nirbheek/orgs","repos_url":"https://api.github.com/users/nirbheek/repos","events_url":"https://api.github.com/users/nirbheek/events{/privacy}","received_events_url":"https://api.github.com/users/nirbheek/received_events","type":"User","site_admin":false},"body":"Am I misreading the diff or was it the other way around? The default values were set with `-Dlang_args` and they were overriden by the environment variable values.","created_at":"2018-05-01T11:33:25Z","updated_at":"2018-05-01T11:33:25Z","html_url":"https://github.com/mesonbuild/meson/pull/3507#discussion_r185205738","pull_request_url":"https://api.github.com/repos/mesonbuild/meson/pulls/3507","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/comments/185205738"},"html":{"href":"https://github.com/mesonbuild/meson/pull/3507#discussion_r185205738"},"pull_request":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/3507"}},"in_reply_to_id":185064274},"pull_request":{"url":"https://api.github.com/repos/mesonbuild/meson/pulls/3507","id":185022448,"html_url":"https://github.com/mesonbuild/meson/pull/3507","diff_url":"https://github.com/mesonbuild/meson/pull/3507.diff","patch_url":"https://github.com/mesonbuild/meson/pull/3507.patch","issue_url":"https://api.github.com/repos/mesonbuild/meson/issues/3507","number":3507,"state":"open","locked":false,"title":"Fix setting c_args and friends from command line","user":{"login":"xclaesse","id":1379109,"avatar_url":"https://avatars3.githubusercontent.com/u/1379109?v=4","gravatar_id":"","url":"https://api.github.com/users/xclaesse","html_url":"https://github.com/xclaesse","followers_url":"https://api.github.com/users/xclaesse/followers","following_url":"https://api.github.com/users/xclaesse/following{/other_user}","gists_url":"https://api.github.com/users/xclaesse/gists{/gist_id}","starred_url":"https://api.github.com/users/xclaesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xclaesse/subscriptions","organizations_url":"https://api.github.com/users/xclaesse/orgs","repos_url":"https://api.github.com/users/xclaesse/repos","events_url":"https://api.github.com/users/xclaesse/events{/privacy}","received_events_url":"https://api.github.com/users/xclaesse/received_events","type":"User","site_admin":false},"body":"When passing more than one -Dc_args it should override the value\r\ninstead of appending. This is how all other options works.\r\n\r\nValue should be split on spaces using shlex just like it does with\r\nCFLAGS environment variable.\r\n\r\nFixes #3473.","created_at":"2018-04-30T17:59:09Z","updated_at":"2018-05-01T11:33:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e15749a880acc2b33d1a729d1ce5b4ccc0a61c8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mesonbuild/meson/pulls/3507/commits","review_comments_url":"https://api.github.com/repos/mesonbuild/meson/pulls/3507/comments","review_comment_url":"https://api.github.com/repos/mesonbuild/meson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesonbuild/meson/issues/3507/comments","statuses_url":"https://api.github.com/repos/mesonbuild/meson/statuses/19d0fb983a39bfbc72dcb0df6404d36be3c60202","head":{"label":"xclaesse:c_args","ref":"c_args","sha":"19d0fb983a39bfbc72dcb0df6404d36be3c60202","user":{"login":"xclaesse","id":1379109,"avatar_url":"https://avatars3.githubusercontent.com/u/1379109?v=4","gravatar_id":"","url":"https://api.github.com/users/xclaesse","html_url":"https://github.com/xclaesse","followers_url":"https://api.github.com/users/xclaesse/followers","following_url":"https://api.github.com/users/xclaesse/following{/other_user}","gists_url":"https://api.github.com/users/xclaesse/gists{/gist_id}","starred_url":"https://api.github.com/users/xclaesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xclaesse/subscriptions","organizations_url":"https://api.github.com/users/xclaesse/orgs","repos_url":"https://api.github.com/users/xclaesse/repos","events_url":"https://api.github.com/users/xclaesse/events{/privacy}","received_events_url":"https://api.github.com/users/xclaesse/received_events","type":"User","site_admin":false},"repo":{"id":108554452,"name":"meson","full_name":"xclaesse/meson","owner":{"login":"xclaesse","id":1379109,"avatar_url":"https://avatars3.githubusercontent.com/u/1379109?v=4","gravatar_id":"","url":"https://api.github.com/users/xclaesse","html_url":"https://github.com/xclaesse","followers_url":"https://api.github.com/users/xclaesse/followers","following_url":"https://api.github.com/users/xclaesse/following{/other_user}","gists_url":"https://api.github.com/users/xclaesse/gists{/gist_id}","starred_url":"https://api.github.com/users/xclaesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xclaesse/subscriptions","organizations_url":"https://api.github.com/users/xclaesse/orgs","repos_url":"https://api.github.com/users/xclaesse/repos","events_url":"https://api.github.com/users/xclaesse/events{/privacy}","received_events_url":"https://api.github.com/users/xclaesse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xclaesse/meson","description":"The Meson Build System","fork":true,"url":"https://api.github.com/repos/xclaesse/meson","forks_url":"https://api.github.com/repos/xclaesse/meson/forks","keys_url":"https://api.github.com/repos/xclaesse/meson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xclaesse/meson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xclaesse/meson/teams","hooks_url":"https://api.github.com/repos/xclaesse/meson/hooks","issue_events_url":"https://api.github.com/repos/xclaesse/meson/issues/events{/number}","events_url":"https://api.github.com/repos/xclaesse/meson/events","assignees_url":"https://api.github.com/repos/xclaesse/meson/assignees{/user}","branches_url":"https://api.github.com/repos/xclaesse/meson/branches{/branch}","tags_url":"https://api.github.com/repos/xclaesse/meson/tags","blobs_url":"https://api.github.com/repos/xclaesse/meson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xclaesse/meson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xclaesse/meson/git/refs{/sha}","trees_url":"https://api.github.com/repos/xclaesse/meson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xclaesse/meson/statuses/{sha}","languages_url":"https://api.github.com/repos/xclaesse/meson/languages","stargazers_url":"https://api.github.com/repos/xclaesse/meson/stargazers","contributors_url":"https://api.github.com/repos/xclaesse/meson/contributors","subscribers_url":"https://api.github.com/repos/xclaesse/meson/subscribers","subscription_url":"https://api.github.com/repos/xclaesse/meson/subscription","commits_url":"https://api.github.com/repos/xclaesse/meson/commits{/sha}","git_commits_url":"https://api.github.com/repos/xclaesse/meson/git/commits{/sha}","comments_url":"https://api.github.com/repos/xclaesse/meson/comments{/number}","issue_comment_url":"https://api.github.com/repos/xclaesse/meson/issues/comments{/number}","contents_url":"https://api.github.com/repos/xclaesse/meson/contents/{+path}","compare_url":"https://api.github.com/repos/xclaesse/meson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xclaesse/meson/merges","archive_url":"https://api.github.com/repos/xclaesse/meson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xclaesse/meson/downloads","issues_url":"https://api.github.com/repos/xclaesse/meson/issues{/number}","pulls_url":"https://api.github.com/repos/xclaesse/meson/pulls{/number}","milestones_url":"https://api.github.com/repos/xclaesse/meson/milestones{/number}","notifications_url":"https://api.github.com/repos/xclaesse/meson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xclaesse/meson/labels{/name}","releases_url":"https://api.github.com/repos/xclaesse/meson/releases{/id}","deployments_url":"https://api.github.com/repos/xclaesse/meson/deployments","created_at":"2017-10-27T14:12:46Z","updated_at":"2018-04-02T13:33:24Z","pushed_at":"2018-04-30T18:01:32Z","git_url":"git://github.com/xclaesse/meson.git","ssh_url":"git@github.com:xclaesse/meson.git","clone_url":"https://github.com/xclaesse/meson.git","svn_url":"https://github.com/xclaesse/meson","homepage":"http://mesonbuild.com","size":14394,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mesonbuild:master","ref":"master","sha":"8c381e1786d0fbeb2136187c6d98f4000e8962bf","user":{"login":"mesonbuild","id":12551236,"avatar_url":"https://avatars0.githubusercontent.com/u/12551236?v=4","gravatar_id":"","url":"https://api.github.com/users/mesonbuild","html_url":"https://github.com/mesonbuild","followers_url":"https://api.github.com/users/mesonbuild/followers","following_url":"https://api.github.com/users/mesonbuild/following{/other_user}","gists_url":"https://api.github.com/users/mesonbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/mesonbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesonbuild/subscriptions","organizations_url":"https://api.github.com/users/mesonbuild/orgs","repos_url":"https://api.github.com/users/mesonbuild/repos","events_url":"https://api.github.com/users/mesonbuild/events{/privacy}","received_events_url":"https://api.github.com/users/mesonbuild/received_events","type":"Organization","site_admin":false},"repo":{"id":19784232,"name":"meson","full_name":"mesonbuild/meson","owner":{"login":"mesonbuild","id":12551236,"avatar_url":"https://avatars0.githubusercontent.com/u/12551236?v=4","gravatar_id":"","url":"https://api.github.com/users/mesonbuild","html_url":"https://github.com/mesonbuild","followers_url":"https://api.github.com/users/mesonbuild/followers","following_url":"https://api.github.com/users/mesonbuild/following{/other_user}","gists_url":"https://api.github.com/users/mesonbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/mesonbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesonbuild/subscriptions","organizations_url":"https://api.github.com/users/mesonbuild/orgs","repos_url":"https://api.github.com/users/mesonbuild/repos","events_url":"https://api.github.com/users/mesonbuild/events{/privacy}","received_events_url":"https://api.github.com/users/mesonbuild/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesonbuild/meson","description":"The Meson Build System","fork":false,"url":"https://api.github.com/repos/mesonbuild/meson","forks_url":"https://api.github.com/repos/mesonbuild/meson/forks","keys_url":"https://api.github.com/repos/mesonbuild/meson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesonbuild/meson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesonbuild/meson/teams","hooks_url":"https://api.github.com/repos/mesonbuild/meson/hooks","issue_events_url":"https://api.github.com/repos/mesonbuild/meson/issues/events{/number}","events_url":"https://api.github.com/repos/mesonbuild/meson/events","assignees_url":"https://api.github.com/repos/mesonbuild/meson/assignees{/user}","branches_url":"https://api.github.com/repos/mesonbuild/meson/branches{/branch}","tags_url":"https://api.github.com/repos/mesonbuild/meson/tags","blobs_url":"https://api.github.com/repos/mesonbuild/meson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesonbuild/meson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesonbuild/meson/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesonbuild/meson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesonbuild/meson/statuses/{sha}","languages_url":"https://api.github.com/repos/mesonbuild/meson/languages","stargazers_url":"https://api.github.com/repos/mesonbuild/meson/stargazers","contributors_url":"https://api.github.com/repos/mesonbuild/meson/contributors","subscribers_url":"https://api.github.com/repos/mesonbuild/meson/subscribers","subscription_url":"https://api.github.com/repos/mesonbuild/meson/subscription","commits_url":"https://api.github.com/repos/mesonbuild/meson/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesonbuild/meson/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesonbuild/meson/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesonbuild/meson/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesonbuild/meson/contents/{+path}","compare_url":"https://api.github.com/repos/mesonbuild/meson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesonbuild/meson/merges","archive_url":"https://api.github.com/repos/mesonbuild/meson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesonbuild/meson/downloads","issues_url":"https://api.github.com/repos/mesonbuild/meson/issues{/number}","pulls_url":"https://api.github.com/repos/mesonbuild/meson/pulls{/number}","milestones_url":"https://api.github.com/repos/mesonbuild/meson/milestones{/number}","notifications_url":"https://api.github.com/repos/mesonbuild/meson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesonbuild/meson/labels{/name}","releases_url":"https://api.github.com/repos/mesonbuild/meson/releases{/id}","deployments_url":"https://api.github.com/repos/mesonbuild/meson/deployments","created_at":"2014-05-14T15:08:16Z","updated_at":"2018-04-30T16:06:43Z","pushed_at":"2018-04-30T18:28:59Z","git_url":"git://github.com/mesonbuild/meson.git","ssh_url":"git@github.com:mesonbuild/meson.git","clone_url":"https://github.com/mesonbuild/meson.git","svn_url":"https://github.com/mesonbuild/meson","homepage":"http://mesonbuild.com","size":14559,"stargazers_count":1427,"watchers_count":1427,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":369,"mirror_url":null,"archived":false,"open_issues_count":697,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":369,"open_issues":697,"watchers":1427,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/3507"},"html":{"href":"https://github.com/mesonbuild/meson/pull/3507"},"issue":{"href":"https://api.github.com/repos/mesonbuild/meson/issues/3507"},"comments":{"href":"https://api.github.com/repos/mesonbuild/meson/issues/3507/comments"},"review_comments":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/3507/comments"},"review_comment":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/3507/commits"},"statuses":{"href":"https://api.github.com/repos/mesonbuild/meson/statuses/19d0fb983a39bfbc72dcb0df6404d36be3c60202"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nirbheek"}}