{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10459","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10459/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10459/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10459/events","html_url":"https://github.com/RIOT-OS/RIOT/issues/10459","id":383788691,"node_id":"MDU6SXNzdWUzODM3ODg2OTE=","number":10459,"title":"make: `make clean all` does not make sense and should be removed","user":{"login":"jcarrano","id":3057851,"node_id":"MDQ6VXNlcjMwNTc4NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/3057851?v=4","gravatar_id":"","url":"https://api.github.com/users/jcarrano","html_url":"https://github.com/jcarrano","followers_url":"https://api.github.com/users/jcarrano/followers","following_url":"https://api.github.com/users/jcarrano/following{/other_user}","gists_url":"https://api.github.com/users/jcarrano/gists{/gist_id}","starred_url":"https://api.github.com/users/jcarrano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcarrano/subscriptions","organizations_url":"https://api.github.com/users/jcarrano/orgs","repos_url":"https://api.github.com/users/jcarrano/repos","events_url":"https://api.github.com/users/jcarrano/events{/privacy}","received_events_url":"https://api.github.com/users/jcarrano/received_events","type":"User","site_admin":false},"labels":[{"id":97338598,"node_id":"MDU6TGFiZWw5NzMzODU5OA==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Area:%20build%20system","name":"Area: build system","color":"6600ff","default":false},{"id":23399098,"node_id":"MDU6TGFiZWwyMzM5OTA5OA==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Type:%20bug","name":"Type: bug","color":"ffff66","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-23T11:23:11Z","updated_at":"2018-11-23T14:14:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"#### Description\r\n\r\nWhat does `make clean all` mean? How can one create a target and clean it at the same time? The answer is that it does not make sense. This ill-defined command is used extensively in RIOT.\r\n\r\nIt could seem (if one has only a superficial understanding of make) that `make clean all` means `make clean` followed by `make all`. Well, that is not how make works, and if it behaves like that in certain circumstances it is only accidental.\r\n\r\nWhat `make` does is execute all recipes needed to make the required targets, in any order, as long as dependencies are satisfied. In the case of parallel make (\"-j\") recipe execution may be simultaneous.\r\n\r\nThe reason `make clean all` works at all is because of hacks that make `all` depend on `clean`. It is a hack because under normal circumstances `all` does not depend on `clean`.\r\n\r\n#### Why is `make clean all` even used\r\n\r\nSee also: [this comment](https://github.com/RIOT-OS/RIOT/pull/10456#issuecomment-441082055)\r\n\r\nNormally, one would type make clean` followed by `make all`. The problem is that in the current implementation, the overhead of starting make is too big. This is caused mainly by the extensive use of immediate assignments (`:=`) combined with  `$(shell ...)` which means there are lots of commands run on each time make is invoked.\r\n\r\nOn a big CI build, this overhead adds up and cleaning ends up taking considerable time. For this reason a hack was devised to make it possible to run both targets in a single invocation.\r\n\r\n#### Steps to reproduce the issue\r\n\r\nThis issue is hard to reproduce, as it involves parallelism (and non-deterministic behaviour). See #10456 and #10344 to see examples.\r\n\r\n#### Steps to fix\r\n\r\nRemoving all the code needed for `make clean all`, and banning it's usage will make our build system simpler and saner.\r\n\r\nFor this we must attack the root cause: high overhead, caused by **unnecessary evaluations of variables containing costly shell invocations.**\r\n\r\nOn the other hand, in the case where those variables are needed, they should be evaluated only once.\r\n\r\nAnother cause of unnecessary evaluations is the indiscriminate use of \"export\" statements (see #10440 for an example).\r\n"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/441251159","html_url":"https://github.com/RIOT-OS/RIOT/issues/10459#issuecomment-441251159","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10459","id":441251159,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTI1MTE1OQ==","user":{"login":"jcarrano","id":3057851,"node_id":"MDQ6VXNlcjMwNTc4NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/3057851?v=4","gravatar_id":"","url":"https://api.github.com/users/jcarrano","html_url":"https://github.com/jcarrano","followers_url":"https://api.github.com/users/jcarrano/followers","following_url":"https://api.github.com/users/jcarrano/following{/other_user}","gists_url":"https://api.github.com/users/jcarrano/gists{/gist_id}","starred_url":"https://api.github.com/users/jcarrano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcarrano/subscriptions","organizations_url":"https://api.github.com/users/jcarrano/orgs","repos_url":"https://api.github.com/users/jcarrano/repos","events_url":"https://api.github.com/users/jcarrano/events{/privacy}","received_events_url":"https://api.github.com/users/jcarrano/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T14:14:17Z","updated_at":"2018-11-23T14:14:17Z","author_association":"CONTRIBUTOR","body":"> If \"clean all\" wasn't possible, and someone would PR a hack that allows it, promising 50% improvement in build times, we'd happily merge it.\r\n\r\nAnd that's how you bury yourself deeper and deeper into the tar pit."}}
{"actor":{"display_login":"jcarrano"}}