{"action":"created","issue":{"url":"https://api.github.com/repos/ninja-build/ninja/issues/1399","repository_url":"https://api.github.com/repos/ninja-build/ninja","labels_url":"https://api.github.com/repos/ninja-build/ninja/issues/1399/labels{/name}","comments_url":"https://api.github.com/repos/ninja-build/ninja/issues/1399/comments","events_url":"https://api.github.com/repos/ninja-build/ninja/issues/1399/events","html_url":"https://github.com/ninja-build/ninja/pull/1399","id":306171211,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc1NzA5Mzk4","number":1399,"title":"Added support for environment variable NINJA_FLAGS","user":{"login":"ocroquette","id":811721,"node_id":"MDQ6VXNlcjgxMTcyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/811721?v=4","gravatar_id":"","url":"https://api.github.com/users/ocroquette","html_url":"https://github.com/ocroquette","followers_url":"https://api.github.com/users/ocroquette/followers","following_url":"https://api.github.com/users/ocroquette/following{/other_user}","gists_url":"https://api.github.com/users/ocroquette/gists{/gist_id}","starred_url":"https://api.github.com/users/ocroquette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocroquette/subscriptions","organizations_url":"https://api.github.com/users/ocroquette/orgs","repos_url":"https://api.github.com/users/ocroquette/repos","events_url":"https://api.github.com/users/ocroquette/events{/privacy}","received_events_url":"https://api.github.com/users/ocroquette/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":47,"created_at":"2018-03-17T16:46:51Z","updated_at":"2018-11-12T17:07:19Z","closed_at":"2018-04-05T17:35:27Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ninja-build/ninja/pulls/1399","html_url":"https://github.com/ninja-build/ninja/pull/1399","diff_url":"https://github.com/ninja-build/ninja/pull/1399.diff","patch_url":"https://github.com/ninja-build/ninja/pull/1399.patch"},"body":"The value of the variable is parsed like command line arguments. You can for\r\ninstance use less cores than available (-j), or limit the parallelism based\r\non the system load (-l). For instance, on a build server used by multiple\r\nusers, you may want to set `NINJA_FLAGS=-l 1` on the system level, so that\r\nthe server never gets overloaded by parallel ninja builds. Command line\r\nparameters override the flags set with NINJA_FLAGS.\r\n"},"comment":{"url":"https://api.github.com/repos/ninja-build/ninja/issues/comments/437957644","html_url":"https://github.com/ninja-build/ninja/pull/1399#issuecomment-437957644","issue_url":"https://api.github.com/repos/ninja-build/ninja/issues/1399","id":437957644,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzk1NzY0NA==","user":{"login":"jonesmz","id":755783,"node_id":"MDQ6VXNlcjc1NTc4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/755783?v=4","gravatar_id":"","url":"https://api.github.com/users/jonesmz","html_url":"https://github.com/jonesmz","followers_url":"https://api.github.com/users/jonesmz/followers","following_url":"https://api.github.com/users/jonesmz/following{/other_user}","gists_url":"https://api.github.com/users/jonesmz/gists{/gist_id}","starred_url":"https://api.github.com/users/jonesmz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonesmz/subscriptions","organizations_url":"https://api.github.com/users/jonesmz/orgs","repos_url":"https://api.github.com/users/jonesmz/repos","events_url":"https://api.github.com/users/jonesmz/events{/privacy}","received_events_url":"https://api.github.com/users/jonesmz/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T17:07:19Z","updated_at":"2018-11-12T17:07:19Z","author_association":"NONE","body":"@ocroquette\r\n\r\n> Thank you @jhasse for your understanding and the time you spend on this project. If we agree that the need to change the default for -j is legitimate and the current options are not satisfactory in general, let's think further what we can do about it.\r\n> \r\n> The proposed generic solution based on NINJA_FLAGS in reference to MAKEFLAGS is easy to implement and use, however I can accept that it is too dangerous since it can influence the build output.\r\n\r\nI don't want to be the stick in the mud... so forgive me for being contrary, but is this really a problem?\r\n\r\nHaving NINJA_FLAGS simply parse the environment variable as if it were the command line is much simpler to implement under the hood than parsing it, and then only evaluating certain options.\r\n\r\nIf a user set the environment variable to a bad setting, the only two possibilities are\r\n- They understood what they were doing\r\n- They did not understand what they were doing\r\n\r\nIn the first case, by filtering the allowed options, Ninja incurs more runtime cost (even if it is so small as to be nearly unmeasurable), and prevents the user that knows what they are doing from doing what they want to do.\r\n\r\nIf they do not understand what they are doing, all bets are off, as no amount of hand-holding is going to truly work-around a PEBKAC error.\r\n\r\nA third case is that the environment variable has been set without the user knowing about it. In which case I suspect the user is in far more trouble than whether or not ninja is working properly..."}}
{"actor":{"display_login":"jonesmz"}}