{"action":"opened","number":4512,"pull_request":{"url":"https://api.github.com/repos/mesonbuild/meson/pulls/4512","id":230780390,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNzgwMzkw","html_url":"https://github.com/mesonbuild/meson/pull/4512","diff_url":"https://github.com/mesonbuild/meson/pull/4512.diff","patch_url":"https://github.com/mesonbuild/meson/pull/4512.patch","issue_url":"https://api.github.com/repos/mesonbuild/meson/issues/4512","number":4512,"state":"open","locked":false,"title":"add function get_all_user_options()","user":{"login":"asartori86","id":10710861,"node_id":"MDQ6VXNlcjEwNzEwODYx","avatar_url":"https://avatars3.githubusercontent.com/u/10710861?v=4","gravatar_id":"","url":"https://api.github.com/users/asartori86","html_url":"https://github.com/asartori86","followers_url":"https://api.github.com/users/asartori86/followers","following_url":"https://api.github.com/users/asartori86/following{/other_user}","gists_url":"https://api.github.com/users/asartori86/gists{/gist_id}","starred_url":"https://api.github.com/users/asartori86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asartori86/subscriptions","organizations_url":"https://api.github.com/users/asartori86/orgs","repos_url":"https://api.github.com/users/asartori86/repos","events_url":"https://api.github.com/users/asartori86/events{/privacy}","received_events_url":"https://api.github.com/users/asartori86/received_events","type":"User","site_admin":false},"body":"It might be useful to get all the options defined in the file `meson_options.txt`. For example, if they are all suitable to be put in a `config.h` file, we could use something like\r\n```\r\n_cdata = configuration_data()\r\n\r\nforeach _opt : get_all_user_options()\r\n    _cdata.set(_opt, get_option(_opt))\r\nendforeach\r\n```\r\n\r\naddresses #3422\r\n\r\nI defined a function `get_all_user_options_internal` (you may suggest a more appropriate name) that returns a `list` with the option names. I had to add a `*args` after `self` even though I do not use `args`. How can I resolve this?\r\n\r\nIt might be useful tha the function `get_all_user_options()` returns a `dict` but the following implementation doesn't work\r\n\r\n```\r\ndef get_all_user_options_internal(self, *args):\r\n    return {d:self.get_option_internal(d) for d in self.coredata.user_options}\r\n....\r\n # in the meson.build file\r\nforeach k,v : get_all_user_options()  # this gives error\r\n```\r\nthe output error is \r\n```\r\nmeson.build:48:8: ERROR:  Assigned value not of assignable type.\r\n```\r\n","created_at":"2018-11-14T10:20:24Z","updated_at":"2018-11-14T10:20:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mesonbuild/meson/pulls/4512/commits","review_comments_url":"https://api.github.com/repos/mesonbuild/meson/pulls/4512/comments","review_comment_url":"https://api.github.com/repos/mesonbuild/meson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesonbuild/meson/issues/4512/comments","statuses_url":"https://api.github.com/repos/mesonbuild/meson/statuses/72354c6d4214969b26456f5c5b379aafd02fb47c","head":{"label":"asartori86:options","ref":"options","sha":"72354c6d4214969b26456f5c5b379aafd02fb47c","user":{"login":"asartori86","id":10710861,"node_id":"MDQ6VXNlcjEwNzEwODYx","avatar_url":"https://avatars3.githubusercontent.com/u/10710861?v=4","gravatar_id":"","url":"https://api.github.com/users/asartori86","html_url":"https://github.com/asartori86","followers_url":"https://api.github.com/users/asartori86/followers","following_url":"https://api.github.com/users/asartori86/following{/other_user}","gists_url":"https://api.github.com/users/asartori86/gists{/gist_id}","starred_url":"https://api.github.com/users/asartori86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asartori86/subscriptions","organizations_url":"https://api.github.com/users/asartori86/orgs","repos_url":"https://api.github.com/users/asartori86/repos","events_url":"https://api.github.com/users/asartori86/events{/privacy}","received_events_url":"https://api.github.com/users/asartori86/received_events","type":"User","site_admin":false},"repo":{"id":128637484,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg2Mzc0ODQ=","name":"meson","full_name":"asartori86/meson","private":false,"owner":{"login":"asartori86","id":10710861,"node_id":"MDQ6VXNlcjEwNzEwODYx","avatar_url":"https://avatars3.githubusercontent.com/u/10710861?v=4","gravatar_id":"","url":"https://api.github.com/users/asartori86","html_url":"https://github.com/asartori86","followers_url":"https://api.github.com/users/asartori86/followers","following_url":"https://api.github.com/users/asartori86/following{/other_user}","gists_url":"https://api.github.com/users/asartori86/gists{/gist_id}","starred_url":"https://api.github.com/users/asartori86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asartori86/subscriptions","organizations_url":"https://api.github.com/users/asartori86/orgs","repos_url":"https://api.github.com/users/asartori86/repos","events_url":"https://api.github.com/users/asartori86/events{/privacy}","received_events_url":"https://api.github.com/users/asartori86/received_events","type":"User","site_admin":false},"html_url":"https://github.com/asartori86/meson","description":"The Meson Build System","fork":true,"url":"https://api.github.com/repos/asartori86/meson","forks_url":"https://api.github.com/repos/asartori86/meson/forks","keys_url":"https://api.github.com/repos/asartori86/meson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asartori86/meson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asartori86/meson/teams","hooks_url":"https://api.github.com/repos/asartori86/meson/hooks","issue_events_url":"https://api.github.com/repos/asartori86/meson/issues/events{/number}","events_url":"https://api.github.com/repos/asartori86/meson/events","assignees_url":"https://api.github.com/repos/asartori86/meson/assignees{/user}","branches_url":"https://api.github.com/repos/asartori86/meson/branches{/branch}","tags_url":"https://api.github.com/repos/asartori86/meson/tags","blobs_url":"https://api.github.com/repos/asartori86/meson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asartori86/meson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asartori86/meson/git/refs{/sha}","trees_url":"https://api.github.com/repos/asartori86/meson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asartori86/meson/statuses/{sha}","languages_url":"https://api.github.com/repos/asartori86/meson/languages","stargazers_url":"https://api.github.com/repos/asartori86/meson/stargazers","contributors_url":"https://api.github.com/repos/asartori86/meson/contributors","subscribers_url":"https://api.github.com/repos/asartori86/meson/subscribers","subscription_url":"https://api.github.com/repos/asartori86/meson/subscription","commits_url":"https://api.github.com/repos/asartori86/meson/commits{/sha}","git_commits_url":"https://api.github.com/repos/asartori86/meson/git/commits{/sha}","comments_url":"https://api.github.com/repos/asartori86/meson/comments{/number}","issue_comment_url":"https://api.github.com/repos/asartori86/meson/issues/comments{/number}","contents_url":"https://api.github.com/repos/asartori86/meson/contents/{+path}","compare_url":"https://api.github.com/repos/asartori86/meson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asartori86/meson/merges","archive_url":"https://api.github.com/repos/asartori86/meson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asartori86/meson/downloads","issues_url":"https://api.github.com/repos/asartori86/meson/issues{/number}","pulls_url":"https://api.github.com/repos/asartori86/meson/pulls{/number}","milestones_url":"https://api.github.com/repos/asartori86/meson/milestones{/number}","notifications_url":"https://api.github.com/repos/asartori86/meson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asartori86/meson/labels{/name}","releases_url":"https://api.github.com/repos/asartori86/meson/releases{/id}","deployments_url":"https://api.github.com/repos/asartori86/meson/deployments","created_at":"2018-04-08T12:11:15Z","updated_at":"2018-04-08T12:11:19Z","pushed_at":"2018-11-14T10:08:24Z","git_url":"git://github.com/asartori86/meson.git","ssh_url":"git@github.com:asartori86/meson.git","clone_url":"https://github.com/asartori86/meson.git","svn_url":"https://github.com/asartori86/meson","homepage":"http://mesonbuild.com","size":16549,"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","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mesonbuild:master","ref":"master","sha":"de175aac0051b5625e21aeb5b9864ae7c376f9d7","user":{"login":"mesonbuild","id":12551236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNTUxMjM2","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,"node_id":"MDEwOlJlcG9zaXRvcnkxOTc4NDIzMg==","name":"meson","full_name":"mesonbuild/meson","private":false,"owner":{"login":"mesonbuild","id":12551236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNTUxMjM2","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},"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-11-13T20:25:19Z","pushed_at":"2018-11-14T02:40:25Z","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":19437,"stargazers_count":1745,"watchers_count":1745,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":467,"mirror_url":null,"archived":false,"open_issues_count":873,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":467,"open_issues":873,"watchers":1745,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/4512"},"html":{"href":"https://github.com/mesonbuild/meson/pull/4512"},"issue":{"href":"https://api.github.com/repos/mesonbuild/meson/issues/4512"},"comments":{"href":"https://api.github.com/repos/mesonbuild/meson/issues/4512/comments"},"review_comments":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/4512/comments"},"review_comment":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesonbuild/meson/pulls/4512/commits"},"statuses":{"href":"https://api.github.com/repos/mesonbuild/meson/statuses/72354c6d4214969b26456f5c5b379aafd02fb47c"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":42,"deletions":0,"changed_files":5}}
{"actor":{"display_login":"asartori86"}}