{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/183807580","pull_request_review_id":114876505,"id":183807580,"diff_hunk":"@@ -38,27 +50,33 @@ fn deps_of<'a, 'b, 'cfg>(\n     unit: &Unit<'a>,\n     cx: &Context<'a, 'cfg>,\n     deps: &'b mut HashMap<Unit<'a>, Vec<Unit<'a>>>,\n+    profile_for: ProfileFor,","path":"src/cargo/core/compiler/context/unit_dependencies.rs","position":40,"original_position":40,"commit_id":"97268b568cb51e42b838f5ee817ad1de6c10a2b4","original_commit_id":"97268b568cb51e42b838f5ee817ad1de6c10a2b4","user":{"login":"ehuss","id":43198,"avatar_url":"https://avatars0.githubusercontent.com/u/43198?v=4","gravatar_id":"","url":"https://api.github.com/users/ehuss","html_url":"https://github.com/ehuss","followers_url":"https://api.github.com/users/ehuss/followers","following_url":"https://api.github.com/users/ehuss/following{/other_user}","gists_url":"https://api.github.com/users/ehuss/gists{/gist_id}","starred_url":"https://api.github.com/users/ehuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehuss/subscriptions","organizations_url":"https://api.github.com/users/ehuss/orgs","repos_url":"https://api.github.com/users/ehuss/repos","events_url":"https://api.github.com/users/ehuss/events{/privacy}","received_events_url":"https://api.github.com/users/ehuss/received_events","type":"User","site_admin":false},"body":"I understand what you mean.  In practice, that's never a problem for `TestDependency` since it only exists for clearing `panic`, and you'll never ask for a unit *with* panic set as a `TestDependency`.  \r\n\r\nI'm trying to think of a scenario where it would matter for `CustomBuild`, but I can't think of any.  It might matter if we later add a \"build-script\"-specific profile, and you have an override deep in a dependency chain.\r\n\r\nAdding it to the map would require a separate de-duplication phase, which I think would add ~15 lines of code.\r\n\r\nLet me know if you think it's important.  I'd lean towards not changing it unless there's a testable case.  Or to make it easier to add a build-script profile later if there's a strong chance of that.","created_at":"2018-04-24T16:57:13Z","updated_at":"2018-04-24T16:57:13Z","html_url":"https://github.com/rust-lang/cargo/pull/5384#discussion_r183807580","pull_request_url":"https://api.github.com/repos/rust-lang/cargo/pulls/5384","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/183807580"},"html":{"href":"https://github.com/rust-lang/cargo/pull/5384#discussion_r183807580"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/5384"}},"in_reply_to_id":183783775},"pull_request":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/5384","id":182349159,"html_url":"https://github.com/rust-lang/cargo/pull/5384","diff_url":"https://github.com/rust-lang/cargo/pull/5384.diff","patch_url":"https://github.com/rust-lang/cargo/pull/5384.patch","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/5384","number":5384,"state":"open","locked":false,"title":"[WIP] Profile Overrides (RFC #2282 Part 1)","user":{"login":"ehuss","id":43198,"avatar_url":"https://avatars0.githubusercontent.com/u/43198?v=4","gravatar_id":"","url":"https://api.github.com/users/ehuss","html_url":"https://github.com/ehuss","followers_url":"https://api.github.com/users/ehuss/followers","following_url":"https://api.github.com/users/ehuss/following{/other_user}","gists_url":"https://api.github.com/users/ehuss/gists{/gist_id}","starred_url":"https://api.github.com/users/ehuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehuss/subscriptions","organizations_url":"https://api.github.com/users/ehuss/orgs","repos_url":"https://api.github.com/users/ehuss/repos","events_url":"https://api.github.com/users/ehuss/events{/privacy}","received_events_url":"https://api.github.com/users/ehuss/received_events","type":"User","site_admin":false},"body":"Profile Overrides (RFC #2282 Part 1)\r\n\r\nWIP: Putting this up before I dig into writing tests, but should be mostly complete.  I also have a variety of questions below.\r\n\r\nThis implements the ability to override profiles for dependencies and build scripts.  This includes a general rework of how profiles work internally. Closes #5298.\r\n\r\nProfile overrides are available with `profile-overrides` set in `cargo-features` in the manifest.\r\n\r\nPart 2 is to implement profiles in config files (to be in a separate PR).\r\n\r\nGeneral overview of changes:\r\n\r\n- `Profiles` moved to `core/profiles.rs`. All profile selection is centralized there.\r\n- Removed Profile flags `test`, `doc`, `run_custom_build`, and `check`.\r\n- Removed `Profile` from `Unit` and replaced it with two enums: `CompileMode` and `ProfileFor`.  This is the minimum information needed to compute profiles at a later stage.\r\n- Also removed `rustc_args`/`rustdoc_args` from `Profile` and place them in `Context`.  This is currently not very elegant because it is a special case, but it works. An alternate solution I considered was to leave them in the `Profile` and add a special uber-override layer.  Let me know if you think it should change.\r\n- Did some general cleanup in `generate_targets`.\r\n\r\n## Misc Fixes\r\n- `cargo check` now honors the `--release` flag.  Fixes #5218.\r\n- `cargo build --test` will set `panic` correctly for dependences. Fixes #5369.\r\n- `cargo check --tests` will no longer include bins twice (once as a normal check, once as a `--test` check).  It only does `--test` check now.\r\n    - Similarly, `cargo check --test name` no longer implicitly checks bins.\r\n- Examples are no longer considered a \"test\".  (See #5397). Consequences:\r\n    - `cargo test` will continue to build examples as a regular build (no change).\r\n    - `cargo test --tests` will no longer build examples at all.\r\n    - `cargo test --all-targets` will no longer build examples as tests, but instead build them as a regular build (now matches `cargo test` behavior).\r\n    - `cargo check --all-targets` will no longer check examples twice (once as\r\n      normal, once as `--test`).  It now only checks it once as a normal\r\n      target.\r\n\r\n## Questions\r\n- Thumbs up/down on the general approach?\r\n- The method to detect if a package is a member of a workspace should probably be redone.  I'm uncertain of the best approach.  Maybe `Workspace.members` could be a set?\r\n- `Hash` and `PartialEq` are implemented manually for `Profile` only to avoid matching on the `name` field.  The `name` field is only there for debug purposes. Is it worth it to keep `name`?  Maybe useful for future use (like #4140)?\r\n- I'm unhappy with the `Finished` line summary that displays `[unoptimized + debuginfo]`.  It doesn't actually show what was compiled.  Currently it just picks the base \"dev\" or \"release\" profile.  I'm not sure what a good solution is (to be accurate it would need to potentially display a list of different options).  Is it ok?  (See also #4140 for the wrong profile name being printed.)\r\n- Build-dependencies use different profiles based on whether or not `--release` flag is given.  This means that if you want build-dependencies to always use a specific set of settings, you have to specify both `[profile.dev.build_override]` and `[profile.release.build_override]`.  Is that reasonable (for now)?  I've noticed some issues (like #1774, #2234, #2424) discussing having more control over how build-dependencies are handled.\r\n- `build --bench xxx` or `--benches` builds dependencies with dev profile, which may be surprising.  `--release` does the correct thing.  Perhaps print a warning when using `cargo build` that builds benchmark deps in dev mode?\r\n- Should it warn/error if you have an override for a package that does not exist?\r\n- Should it warn/error if you attempt to set `panic` on the `test` or `bench` profile?\r\n\r\n## TODO\r\n- I have a long list of tests to add.\r\n- Address a few \"TODO\" comments left behind.\r\n","created_at":"2018-04-18T02:08:13Z","updated_at":"2018-04-24T16:57:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a70cb6f7e0ff23836fae483880c35ad06b5d979","assignee":{"login":"matklad","id":1711539,"avatar_url":"https://avatars3.githubusercontent.com/u/1711539?v=4","gravatar_id":"","url":"https://api.github.com/users/matklad","html_url":"https://github.com/matklad","followers_url":"https://api.github.com/users/matklad/followers","following_url":"https://api.github.com/users/matklad/following{/other_user}","gists_url":"https://api.github.com/users/matklad/gists{/gist_id}","starred_url":"https://api.github.com/users/matklad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matklad/subscriptions","organizations_url":"https://api.github.com/users/matklad/orgs","repos_url":"https://api.github.com/users/matklad/repos","events_url":"https://api.github.com/users/matklad/events{/privacy}","received_events_url":"https://api.github.com/users/matklad/received_events","type":"User","site_admin":false},"assignees":[{"login":"matklad","id":1711539,"avatar_url":"https://avatars3.githubusercontent.com/u/1711539?v=4","gravatar_id":"","url":"https://api.github.com/users/matklad","html_url":"https://github.com/matklad","followers_url":"https://api.github.com/users/matklad/followers","following_url":"https://api.github.com/users/matklad/following{/other_user}","gists_url":"https://api.github.com/users/matklad/gists{/gist_id}","starred_url":"https://api.github.com/users/matklad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matklad/subscriptions","organizations_url":"https://api.github.com/users/matklad/orgs","repos_url":"https://api.github.com/users/matklad/repos","events_url":"https://api.github.com/users/matklad/events{/privacy}","received_events_url":"https://api.github.com/users/matklad/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/cargo/pulls/5384/commits","review_comments_url":"https://api.github.com/repos/rust-lang/cargo/pulls/5384/comments","review_comment_url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/5384/comments","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/97268b568cb51e42b838f5ee817ad1de6c10a2b4","head":{"label":"ehuss:profile-override","ref":"profile-override","sha":"97268b568cb51e42b838f5ee817ad1de6c10a2b4","user":{"login":"ehuss","id":43198,"avatar_url":"https://avatars0.githubusercontent.com/u/43198?v=4","gravatar_id":"","url":"https://api.github.com/users/ehuss","html_url":"https://github.com/ehuss","followers_url":"https://api.github.com/users/ehuss/followers","following_url":"https://api.github.com/users/ehuss/following{/other_user}","gists_url":"https://api.github.com/users/ehuss/gists{/gist_id}","starred_url":"https://api.github.com/users/ehuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehuss/subscriptions","organizations_url":"https://api.github.com/users/ehuss/orgs","repos_url":"https://api.github.com/users/ehuss/repos","events_url":"https://api.github.com/users/ehuss/events{/privacy}","received_events_url":"https://api.github.com/users/ehuss/received_events","type":"User","site_admin":false},"repo":{"id":80226738,"name":"cargo","full_name":"ehuss/cargo","owner":{"login":"ehuss","id":43198,"avatar_url":"https://avatars0.githubusercontent.com/u/43198?v=4","gravatar_id":"","url":"https://api.github.com/users/ehuss","html_url":"https://github.com/ehuss","followers_url":"https://api.github.com/users/ehuss/followers","following_url":"https://api.github.com/users/ehuss/following{/other_user}","gists_url":"https://api.github.com/users/ehuss/gists{/gist_id}","starred_url":"https://api.github.com/users/ehuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehuss/subscriptions","organizations_url":"https://api.github.com/users/ehuss/orgs","repos_url":"https://api.github.com/users/ehuss/repos","events_url":"https://api.github.com/users/ehuss/events{/privacy}","received_events_url":"https://api.github.com/users/ehuss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ehuss/cargo","description":"The Rust package manager","fork":true,"url":"https://api.github.com/repos/ehuss/cargo","forks_url":"https://api.github.com/repos/ehuss/cargo/forks","keys_url":"https://api.github.com/repos/ehuss/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehuss/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehuss/cargo/teams","hooks_url":"https://api.github.com/repos/ehuss/cargo/hooks","issue_events_url":"https://api.github.com/repos/ehuss/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/ehuss/cargo/events","assignees_url":"https://api.github.com/repos/ehuss/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/ehuss/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/ehuss/cargo/tags","blobs_url":"https://api.github.com/repos/ehuss/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehuss/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehuss/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehuss/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehuss/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/ehuss/cargo/languages","stargazers_url":"https://api.github.com/repos/ehuss/cargo/stargazers","contributors_url":"https://api.github.com/repos/ehuss/cargo/contributors","subscribers_url":"https://api.github.com/repos/ehuss/cargo/subscribers","subscription_url":"https://api.github.com/repos/ehuss/cargo/subscription","commits_url":"https://api.github.com/repos/ehuss/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehuss/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehuss/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehuss/cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ehuss/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/ehuss/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehuss/cargo/merges","archive_url":"https://api.github.com/repos/ehuss/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehuss/cargo/downloads","issues_url":"https://api.github.com/repos/ehuss/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/ehuss/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/ehuss/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/ehuss/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehuss/cargo/labels{/name}","releases_url":"https://api.github.com/repos/ehuss/cargo/releases{/id}","deployments_url":"https://api.github.com/repos/ehuss/cargo/deployments","created_at":"2017-01-27T16:56:22Z","updated_at":"2018-04-21T17:41:57Z","pushed_at":"2018-04-22T20:57:45Z","git_url":"git://github.com/ehuss/cargo.git","ssh_url":"git@github.com:ehuss/cargo.git","clone_url":"https://github.com/ehuss/cargo.git","svn_url":"https://github.com/ehuss/cargo","homepage":"https://crates.io/","size":16084,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"8f3dd18cb51db05cdf6334918d594f4fb166462d","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":17420913,"name":"cargo","full_name":"rust-lang/cargo","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/cargo","description":"The Rust package manager","fork":false,"url":"https://api.github.com/repos/rust-lang/cargo","forks_url":"https://api.github.com/repos/rust-lang/cargo/forks","keys_url":"https://api.github.com/repos/rust-lang/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/cargo/teams","hooks_url":"https://api.github.com/repos/rust-lang/cargo/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/cargo/events","assignees_url":"https://api.github.com/repos/rust-lang/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/cargo/tags","blobs_url":"https://api.github.com/repos/rust-lang/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/cargo/languages","stargazers_url":"https://api.github.com/repos/rust-lang/cargo/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/cargo/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/cargo/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/cargo/subscription","commits_url":"https://api.github.com/repos/rust-lang/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/cargo/merges","archive_url":"https://api.github.com/repos/rust-lang/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/cargo/downloads","issues_url":"https://api.github.com/repos/rust-lang/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/cargo/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/cargo/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/cargo/deployments","created_at":"2014-03-04T23:20:42Z","updated_at":"2018-04-24T15:16:30Z","pushed_at":"2018-04-24T15:16:26Z","git_url":"git://github.com/rust-lang/cargo.git","ssh_url":"git@github.com:rust-lang/cargo.git","clone_url":"https://github.com/rust-lang/cargo.git","svn_url":"https://github.com/rust-lang/cargo","homepage":"https://doc.rust-lang.org/cargo","size":18313,"stargazers_count":3102,"watchers_count":3102,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":754,"mirror_url":null,"archived":false,"open_issues_count":652,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":754,"open_issues":652,"watchers":3102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/5384"},"html":{"href":"https://github.com/rust-lang/cargo/pull/5384"},"issue":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/5384"},"comments":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/5384/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/5384/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/5384/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/cargo/statuses/97268b568cb51e42b838f5ee817ad1de6c10a2b4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ehuss"}}