{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/27686","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/27686/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/27686/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/27686/events","html_url":"https://github.com/rust-lang/rust/issues/27686","id":100466208,"number":27686,"title":"`--extern` broken for indirect dependencies","user":{"login":"JustAPerson","id":789308,"avatar_url":"https://avatars.githubusercontent.com/u/789308?v=3","gravatar_id":"","url":"https://api.github.com/users/JustAPerson","html_url":"https://github.com/JustAPerson","followers_url":"https://api.github.com/users/JustAPerson/followers","following_url":"https://api.github.com/users/JustAPerson/following{/other_user}","gists_url":"https://api.github.com/users/JustAPerson/gists{/gist_id}","starred_url":"https://api.github.com/users/JustAPerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustAPerson/subscriptions","organizations_url":"https://api.github.com/users/JustAPerson/orgs","repos_url":"https://api.github.com/users/JustAPerson/repos","events_url":"https://api.github.com/users/JustAPerson/events{/privacy}","received_events_url":"https://api.github.com/users/JustAPerson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-12T04:59:12Z","updated_at":"2015-08-12T22:13:04Z","closed_at":null,"body":"alpha.rs\r\n```rust\r\npub struct Test; \r\n```\r\n\r\nbeta.rs:\r\n```rust\r\nextern crate alpha;\r\n\r\npub use alpha::Test;\r\n```\r\n\r\ngamma.rs\r\n```rust\r\nextern crate beta;\r\n\r\npub use beta::Test;\r\n```\r\n\r\nNow, run the following\r\n```\r\nmkdir -p bin\r\nrustc alpha.rs -o bin/libalpha.rlib  --crate-type lib\r\nrustc beta.rs  -o bin/libbeta.rlib   --extern alpha=bin/libalpha.rlib --crate-type lib\r\nrustc gamma.rs -o bin/libgamma.rlib  --extern alpha=bin/libalpha.rlib --extern beta=bin/libbeta.rlib --crate-type lib\r\n```\r\n\r\nYou get the following error:\r\n```\r\ngamma.rs:1:1: 1:19 error: can't find crate for `alpha` which `beta` depends on\r\ngamma.rs:1 extern crate beta;\r\n           ^~~~~~~~~~~~~~~~~~\r\nerror: aborting due to previous error\r\n```\r\n\r\nA simple fix to this is to add `extern crate alpha;` at the beginning of gamma.rs, but that should not be unnecessary.\r\nReproduces on nightly."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/130462682","html_url":"https://github.com/rust-lang/rust/issues/27686#issuecomment-130462682","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/27686","id":130462682,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","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},"created_at":"2015-08-12T22:13:04Z","updated_at":"2015-08-12T22:13:04Z","body":"Yeah seems reasonable to leave open as a docs issue. Not sure exhaustive documentation should go into the `-h` message but the man page could certainly be beefed up.\r\n\r\n> For reference, how do you thus indicate to rust where to locate a crate whose filename does not follow the libcrate.rlib pattern? \r\n\r\nThat... can't actually be done I don't think. The only way the compiler looks for transitive dependencies is via `lib<foo>*.rlib`  where `<foo>` is the name of the crate."}}