{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/1197","repository_url":"https://api.github.com/repos/rust-lang/cargo","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/1197/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/1197/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/1197/events","html_url":"https://github.com/rust-lang/cargo/issues/1197","id":54832760,"node_id":"MDU6SXNzdWU1NDgzMjc2MA==","number":1197,"title":"Target-specific features","user":{"login":"alexcrichton","id":64996,"node_id":"MDQ6VXNlcjY0OTk2","avatar_url":"https://avatars1.githubusercontent.com/u/64996?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"labels":[{"id":137465458,"node_id":"MDU6TGFiZWwxMzc0NjU0NTg=","url":"https://api.github.com/repos/rust-lang/cargo/labels/A-features","name":"A-features","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2015-01-20T01:24:48Z","updated_at":"2018-10-10T13:12:34Z","closed_at":null,"author_association":"MEMBER","body":"It would be nice to support target-specific features for cases such as when certain functionality is only available on one platform or the default set of functionality should vary per-platform.\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/comments/428565844","html_url":"https://github.com/rust-lang/cargo/issues/1197#issuecomment-428565844","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/1197","id":428565844,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODU2NTg0NA==","user":{"login":"plyhun","id":25364263,"node_id":"MDQ6VXNlcjI1MzY0MjYz","avatar_url":"https://avatars2.githubusercontent.com/u/25364263?v=4","gravatar_id":"","url":"https://api.github.com/users/plyhun","html_url":"https://github.com/plyhun","followers_url":"https://api.github.com/users/plyhun/followers","following_url":"https://api.github.com/users/plyhun/following{/other_user}","gists_url":"https://api.github.com/users/plyhun/gists{/gist_id}","starred_url":"https://api.github.com/users/plyhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plyhun/subscriptions","organizations_url":"https://api.github.com/users/plyhun/orgs","repos_url":"https://api.github.com/users/plyhun/repos","events_url":"https://api.github.com/users/plyhun/events{/privacy}","received_events_url":"https://api.github.com/users/plyhun/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T13:12:34Z","updated_at":"2018-10-10T13:12:34Z","author_association":"NONE","body":"An example from my usecase:\r\n```toml\r\n[features]\r\ngtk3 = [\"ui-gtk\"]\r\nwin32 = [\"ui-win32\"]\r\ncocoa = [\"ui-cocoa\"]\r\ntype_check = []\r\ndefault = [\"type_check\"]\r\n\r\n[target.'cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\"))'.features]\r\ndefault = [\"gtk3\"]\r\n\r\n[target.'cfg(target_os = \"windows\")'.features]\r\ndefault = [\"win32\"]\r\n\r\n[target.'cfg(target_os = \"macos\")'.features]\r\ndefault = [\"cocoa\"]\r\n```\r\nIf I patch cargo to just add an extra `platform` to the feature, this example works. But I'm afraid there are corner cases which I haven't predict."}}
{"actor":{"display_login":"plyhun"}}