{"action":"created","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9189","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9189/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9189/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9189/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/9189","id":346178079,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MTA1Mjg5","number":9189,"title":"Get rid of Zephyr's prefer-later-defaults behavior","user":{"login":"ulfalizer","id":154768,"node_id":"MDQ6VXNlcjE1NDc2OA==","avatar_url":"https://avatars2.githubusercontent.com/u/154768?v=4","gravatar_id":"","url":"https://api.github.com/users/ulfalizer","html_url":"https://github.com/ulfalizer","followers_url":"https://api.github.com/users/ulfalizer/followers","following_url":"https://api.github.com/users/ulfalizer/following{/other_user}","gists_url":"https://api.github.com/users/ulfalizer/gists{/gist_id}","starred_url":"https://api.github.com/users/ulfalizer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulfalizer/subscriptions","organizations_url":"https://api.github.com/users/ulfalizer/orgs","repos_url":"https://api.github.com/users/ulfalizer/repos","events_url":"https://api.github.com/users/ulfalizer/events{/privacy}","received_events_url":"https://api.github.com/users/ulfalizer/received_events","type":"User","site_admin":false},"labels":[{"id":807706246,"node_id":"MDU6TGFiZWw4MDc3MDYyNDY=","url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/labels/DNM","name":"DNM","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-31T13:03:49Z","updated_at":"2018-08-02T16:42:35Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/9189","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/9189","diff_url":"https://github.com/zephyrproject-rtos/zephyr/pull/9189.diff","patch_url":"https://github.com/zephyrproject-rtos/zephyr/pull/9189.patch"},"body":"This PR gets rid of Zephyr's prefer-later-defaults behavior for Kconfig defaults.\r\n\r\nThe commit message for `Kconfig: Use the first default with a satisfied condition` (below) gives some motivations.\r\n\r\nDocumentation updates are included as well, and `boilerplate.cmake` prints a note about the new behavior so that it's easier to discover. See the other commit messages.\r\n\r\n```\r\nKconfig: Use the first default with a satisfied condition\r\n\r\nUp until now, Zephyr has patched Kconfig to use the last 'default' with a\r\nsatisfied condition, instead of the first one. I'm not sure why the patch was\r\nadded (it predates Kconfiglib), but I suspect it's related to Kconfig.defconfig\r\nfiles.\r\n\r\nThere are at least three problems with the patch:\r\n\r\n  1. It's inconsistent with how Kconfig works in other projects, which might\r\n     confuse newcomers.\r\n\r\n  2. Due to oversights, earlier 'range' properties are still preferred, as well\r\n     as earlier 'default' properties on choices.\r\n\r\n     In addition to being inconsistent, this makes it impossible to override\r\n     'range' properties and choice 'default' properties if the base definition\r\n     of the symbol/choice already has 'range'/'default' properties.\r\n\r\n     I've seen errors caused by the inconsistency, and I suspect there are\r\n     more.\r\n\r\n  3. A fork of Kconfiglib that adds the patch needs to be maintained.\r\n\r\nGet rid of the patch and go back to standard Kconfig behavior, as follows:\r\n\r\n  1. Include the Kconfig.defconfig files first instead of last in\r\n     Kconfig.zephyr.\r\n\r\n  2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of last in\r\n     arch/Kconfig.\r\n\r\n  3. Include arch/<arch>/soc/*/Kconfig first instead of last in\r\n     arch/<arch>/Kconfig.\r\n\r\n  4. Swap a few other 'source's to preserve behavior for some scattered symbols\r\n     with multiple definitions.\r\n\r\n     Swap 'source's in some no-op cases too, where it might match the intent.\r\n\r\n  5. Reverse the defaults on symbol definitions that have more than one\r\n     default.\r\n\r\n     Skip defaults that are mutually exclusive, e.g. where each default has an\r\n     'if <some board>' condition. They are already safe.\r\n\r\n  6. Remove the prefer-later-defaults patch from Kconfiglib.\r\n\r\nTesting was done with a Python script that lists all Kconfig symbols/choices\r\nwith multiple defaults, along with a whitelist of fixed symbols. The script\r\nalso verifies that there are no \"unreachable\" defaults hidden by defaults\r\nwithout conditions\r\n\r\nAs an additional test, zephyr/.config was generated before and after the change\r\nfor several samples and checked to be identical (after sorting).\r\n\r\nThis commit includes some default-related cleanups as well:\r\n\r\n  - Simplify some symbol definitions, e.g. where a default has 'if FOO' when\r\n    the symbol already has 'depends on FOO'.\r\n\r\n  - Remove some redundant 'default \"\"' for string symbols. This is the implicit\r\n    default.\r\n\r\nPiggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and\r\nBT_L2CAP_TX_MTU (caused by confusing inconsistency).\r\n\r\nPiggyback some fixes for style nits too, e.g. unindented help texts.\r\n```"},"comment":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/comments/409991705","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/9189#issuecomment-409991705","issue_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9189","id":409991705,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTk5MTcwNQ==","user":{"login":"carlescufi","id":12450381,"node_id":"MDQ6VXNlcjEyNDUwMzgx","avatar_url":"https://avatars3.githubusercontent.com/u/12450381?v=4","gravatar_id":"","url":"https://api.github.com/users/carlescufi","html_url":"https://github.com/carlescufi","followers_url":"https://api.github.com/users/carlescufi/followers","following_url":"https://api.github.com/users/carlescufi/following{/other_user}","gists_url":"https://api.github.com/users/carlescufi/gists{/gist_id}","starred_url":"https://api.github.com/users/carlescufi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlescufi/subscriptions","organizations_url":"https://api.github.com/users/carlescufi/orgs","repos_url":"https://api.github.com/users/carlescufi/repos","events_url":"https://api.github.com/users/carlescufi/events{/privacy}","received_events_url":"https://api.github.com/users/carlescufi/received_events","type":"User","site_admin":false},"created_at":"2018-08-02T16:42:35Z","updated_at":"2018-08-02T16:42:35Z","author_association":"MEMBER","body":"@ulfalizer I am happy with this, but I'd like @nashif to approve before I merge, since this is an important change."}}
{"actor":{"display_login":"carlescufi"}}