{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/5162","repository_url":"https://api.github.com/repos/rust-lang/cargo","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/5162/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/5162/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/5162/events","html_url":"https://github.com/rust-lang/cargo/issues/5162","id":304072879,"number":5162,"title":"Have --dep-info generate gn-compatible dependency files","user":{"login":"rtsuk","id":314561,"avatar_url":"https://avatars3.githubusercontent.com/u/314561?v=4","gravatar_id":"","url":"https://api.github.com/users/rtsuk","html_url":"https://github.com/rtsuk","followers_url":"https://api.github.com/users/rtsuk/followers","following_url":"https://api.github.com/users/rtsuk/following{/other_user}","gists_url":"https://api.github.com/users/rtsuk/gists{/gist_id}","starred_url":"https://api.github.com/users/rtsuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtsuk/subscriptions","organizations_url":"https://api.github.com/users/rtsuk/orgs","repos_url":"https://api.github.com/users/rtsuk/repos","events_url":"https://api.github.com/users/rtsuk/events{/privacy}","received_events_url":"https://api.github.com/users/rtsuk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-10T14:01:26Z","updated_at":"2018-03-14T18:00:30Z","closed_at":"2018-03-14T18:00:30Z","author_association":"NONE","body":"In https://github.com/rust-lang/cargo/pull/3557 @raphlinus added dependency file generation to rustc. This issue is about modifying that generation so that it produces gn-compatible dependency files.\r\n\r\n[gn](https://chromium.googlesource.com/chromium/src/+/master/tools/gn/README.md) requires, in [dependency files that it is asked to consume](https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#depfile), that \"all paths must be relative to the root build directory.\" Empirically it appears that this is actually only required of the target paths.\r\n\r\nThis issue is mostly implemented already, as the [code to generate the dependency](https://github.com/rust-lang/cargo/blob/4429f4efa12dc62985d971fa3ea16e50f541e35a/src/cargo/ops/cargo_rustc/output_depinfo.rs#L73) file already has an option to make target paths relative. I tested it by hard-coding a value and it makes dependency files that gn is happy to consume. So all that's required is to provide some way to pass this value to [output_depinfo()](https://github.com/rust-lang/cargo/blob/4429f4efa12dc62985d971fa3ea16e50f541e35a/src/cargo/ops/cargo_rustc/output_depinfo.rs#L69).\r\n\r\nWhat would be the most correct way to pass such information? Something in cargo config seems easiest."}}
{"actor":{"display_login":"bors"}}