{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/21246","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/21246/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/21246/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/21246/events","html_url":"https://github.com/rust-lang/rust/issues/21246","id":54604144,"number":21246,"title":"rustdoc --test looking for non-existent shared object","user":{"login":"mrobinson","id":13536,"avatar_url":"https://avatars.githubusercontent.com/u/13536?v=3","gravatar_id":"","url":"https://api.github.com/users/mrobinson","html_url":"https://github.com/mrobinson","followers_url":"https://api.github.com/users/mrobinson/followers","following_url":"https://api.github.com/users/mrobinson/following{/other_user}","gists_url":"https://api.github.com/users/mrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/mrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrobinson/subscriptions","organizations_url":"https://api.github.com/users/mrobinson/orgs","repos_url":"https://api.github.com/users/mrobinson/repos","events_url":"https://api.github.com/users/mrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/mrobinson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-linkage","name":"A-linkage","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-rustdoc","name":"A-rustdoc","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-16T17:49:49Z","updated_at":"2015-04-07T18:16:36Z","closed_at":"2015-04-07T17:57:22Z","body":"In Servo, we use very few rustdoc examples. In one particular crate `util` there is a single rustdoc example, so Cargo runs `rustdoc --test`.  `util` depends on an external crate `rust-layers`, which in turn depends on an external crate `rust-azure`. Although, a compiled rlib of libazure is available, rustc will try to link against both the libazure rlib and `-lazure`. Since `-lazure` doesn't exist, linking fails.\r\n\r\nThe rustdoc command-line (apologies for the long command):\r\n```\r\nrustdoc\r\n--test lib.rs\r\n--crate-name util\r\n-L /home/martin/work/servo/components/servo/target\r\n-L /home/martin/work/servo/components/servo/target/deps\r\n--extern task_info=/home/martin/work/servo/components/servo/target/deps/libtask_info-5be8a31f468e0e09.rlib\r\n--extern time=/home/martin/work/servo/components/servo/target/deps/libtime-ad4e077cbdd35a18.rlib\r\n--extern xxhash=/home/martin/work/servo/components/servo/target/deps/libxxhash-245c85292ece0c63.rlib\r\n--extern encoding-index-korean=/home/martin/work/servo/components/servo/target/deps/libencoding-index-korean-7f619e1decbc8e76.rlib\r\n--extern skia-sys=/home/martin/work/servo/components/servo/target/deps/libskia-sys-a0c97fb5e4120410.rlib\r\n--extern script_traits=/home/martin/work/servo/components/servo/target/deps/libscript_traits-4a5ed80e950d9f94.rlib\r\n--extern layers=/home/martin/work/servo/components/servo/target/deps/liblayers-d7491f1d2aeed9ac.rlib\r\n--extern io_surface=/home/martin/work/servo/components/servo/target/deps/libio_surface-5397fd6555ddcd0c.rlib\r\n--extern openssl-sys=/home/martin/work/servo/components/servo/target/deps/libopenssl-sys-8d5618621883f42c.rlib\r\n--extern encoding-index-tradchinese=/home/martin/work/servo/components/servo/target/deps/libencoding-index-tradchinese-47f074fd879a44ba.rlib\r\n--extern text_writer=/home/martin/work/servo/components/servo/target/deps/libtext_writer-83aeadef5ad6c975.rlib\r\n--extern mucell=/home/martin/work/servo/components/servo/target/deps/libmucell-15aa001c80416321.rlib\r\n--extern url=/home/martin/work/servo/components/servo/target/deps/liburl-e5595358222a824d.rlib\r\n--extern stb_image=/home/martin/work/servo/components/servo/target/deps/libstb_image-8789d241efd7f3ef.rlib\r\n--extern hyper=/home/martin/work/servo/components/servo/target/deps/libhyper-890ae9892b5e4aec.rlib\r\n--extern png=/home/martin/work/servo/components/servo/target/deps/libpng-2a5686ec81c888ef.rlib\r\n--extern glfw=/home/martin/work/servo/components/servo/target/deps/libglfw-0fe09eeb0e447723.rlib\r\n--extern html5ever_macros=/home/martin/work/servo/components/servo/target/deps/libhtml5ever_macros-eafc84b872baff98.so\r\n--extern mime=/home/martin/work/servo/components/servo/target/deps/libmime-4b114bc7d7856ad5.rlib\r\n--extern core_graphics=/home/martin/work/servo/components/servo/target/deps/libcore_graphics-68ea1861802926eb.rlib\r\n--extern cgl=/home/martin/work/servo/components/servo/target/deps/libcgl-f832515e1e91a735.rlib\r\n--extern gl_common=/home/martin/work/servo/components/servo/target/deps/libgl_common-66a5d21dea94490e.rlib\r\n--extern plugins=/home/martin/work/servo/components/servo/target/deps/libplugins-46498ed719ee555c.so\r\n--extern devtools=/home/martin/work/servo/components/servo/target/deps/libdevtools-94abee49a4652e76.rlib\r\n--extern freetype-sys=/home/martin/work/servo/components/servo/target/deps/libfreetype-sys-2000ed3efd86d8e0.rlib\r\n--extern compositing=/home/martin/work/servo/components/servo/target/deps/libcompositing-c013b590201fd820.rlib\r\n--extern core_foundation=/home/martin/work/servo/components/servo/target/deps/libcore_foundation-81f453a644bdecba.rlib\r\n--extern servo=/home/martin/work/servo/components/servo/target/libservo-855886321a28c984.rlib\r\n--extern encoding-index-japanese=/home/martin/work/servo/components/servo/target/deps/libencoding-index-japanese-78d9d2f7567be380.rlib\r\n--extern gleam=/home/martin/work/servo/components/servo/target/deps/libgleam-e5559c03c0bebfba.rlib\r\n--extern gl_generator=/home/martin/work/servo/components/servo/target/deps/libgl_generator-14b70861eb330221.so\r\n--extern unsafe-any=/home/martin/work/servo/components/servo/target/deps/libunsafe-any-3d2f45b7c92200ea.rlib\r\n--extern devtools_traits=/home/martin/work/servo/components/servo/target/deps/libdevtools_traits-8c99a10e26f4a822.rlib\r\n--extern string_cache_macros=/home/martin/work/servo/components/servo/target/deps/libstring_cache_macros-c486c481d0b8fc2d.so\r\n--extern js=/home/martin/work/servo/components/servo/target/deps/libjs-7a5e44e37945e142.rlib\r\n--extern cssparser=/home/martin/work/servo/components/servo/target/deps/libcssparser-7a9a471368ea9b30.rlib\r\n--extern lazy_static=/home/martin/work/servo/components/servo/target/deps/liblazy_static-518089d616e0fe56.rlib\r\n--extern xml-rs=/home/martin/work/servo/components/servo/target/deps/libxml-a9be98b4dd785d98.rlib\r\n--extern freetype=/home/martin/work/servo/components/servo/target/deps/libfreetype-f9e33152a2a3bfec.rlib\r\n--extern encoding=/home/martin/work/servo/components/servo/target/deps/libencoding-5d9283f8df6a2add.rlib\r\n--extern semver=/home/martin/work/servo/components/servo/target/deps/libsemver-7a9674597d634bab.rlib\r\n--extern xlib=/home/martin/work/servo/components/servo/target/deps/libxlib-ecde648e63fc4987.rlib\r\n--extern mozjs-sys=/home/martin/work/servo/components/servo/target/deps/libmozjs-sys-c58a7d09513f4944.rlib\r\n--extern cookie=/home/martin/work/servo/components/servo/target/deps/libcookie-03a3f41cb989f010.rlib\r\n--extern azure=/home/martin/work/servo/components/servo/target/deps/libazure-83ae91b5b2ebf272.rlib\r\n--extern geom=/home/martin/work/servo/components/servo/target/deps/libgeom-92d0f13f38b09c46.rlib\r\n--extern layout=/home/martin/work/servo/components/servo/target/deps/liblayout-3ca85d45132c804e.rlib\r\n--extern layout_traits=/home/martin/work/servo/components/servo/target/deps/liblayout_traits-be835a4136e0cd58.rlib\r\n--extern phf_mac=/home/martin/work/servo/components/servo/target/deps/libphf_mac-3d2c5d82d0785fb6.so\r\n--extern png-sys=/home/martin/work/servo/components/servo/target/deps/libpng-sys-ea1e7c315521d32b.rlib\r\n--extern phf=/home/martin/work/servo/components/servo/target/deps/libphf-987a440fbd694b69.rlib\r\n--extern encoding_index_tests=/home/martin/work/servo/components/servo/target/deps/libencoding_index_tests-9b89d508f8de6115.rlib\r\n--extern style=/home/martin/work/servo/components/servo/target/deps/libstyle-2978bbcc267713b3.rlib\r\n--extern glx=/home/martin/work/servo/components/servo/target/deps/libglx-525f8d390c2e2b0a.rlib\r\n--extern encoding-index-singlebyte=/home/martin/work/servo/components/servo/target/deps/libencoding-index-singlebyte-e8309dce7b73ab02.rlib\r\n--extern gcc=/home/martin/work/servo/components/servo/target/deps/libgcc-aad54793e4efcc66.rlib\r\n--extern msg=/home/martin/work/servo/components/servo/target/deps/libmsg-20eac35e27b67ccc.rlib\r\n--extern glfw-sys=/home/martin/work/servo/components/servo/target/deps/libglfw-sys-362ff9a8d4dbbbbe.rlib\r\n--extern glfw_app=/home/martin/work/servo/components/servo/target/deps/libglfw_app-788e77e5e6af1978.rlib\r\n--extern uuid=/home/martin/work/servo/components/servo/target/deps/libuuid-7c7b259bcfa9d945.rlib\r\n--extern khronos_api=/home/martin/work/servo/components/servo/target/deps/libkhronos_api-e6fe334e9439e073.rlib\r\n--extern html5ever=/home/martin/work/servo/components/servo/target/deps/libhtml5ever-80898f0002ba0361.rlib\r\n--extern encoding-index-simpchinese=/home/martin/work/servo/components/servo/target/deps/libencoding-index-simpchinese-2d7c8c32f7e9f2b2.rlib\r\n--extern script=/home/martin/work/servo/components/servo/target/deps/libscript-220adde19382d644.rlib\r\n--extern fontconfig-sys=/home/martin/work/servo/components/servo/target/deps/libfontconfig-sys-4770bf8b8048ff82.rlib\r\n--extern egl=/home/martin/work/servo/components/servo/target/deps/libegl-90ba2a473034ea1d.rlib\r\n--extern core_text=/home/martin/work/servo/components/servo/target/deps/libcore_text-4b909a19bc1f7938.rlib\r\n--extern harfbuzz=/home/martin/work/servo/components/servo/target/deps/libharfbuzz-d615f1063bc88db4.rlib\r\n--extern canvas=/home/martin/work/servo/components/servo/target/deps/libcanvas-c458de241a3c060e.rlib\r\n--extern openssl=/home/martin/work/servo/components/servo/target/deps/libopenssl-089fe2b2f27936a4.rlib\r\n--extern fontconfig=/home/martin/work/servo/components/servo/target/deps/libfontconfig-c046fa4ca41605a4.rlib\r\n--extern net=/home/martin/work/servo/components/servo/target/deps/libnet-d859c8cdb0b02e68.rlib\r\n--extern gfx=/home/martin/work/servo/components/servo/target/deps/libgfx-97756b549a7d8f02.rlib\r\n--extern pkg-config=/home/martin/work/servo/components/servo/target/deps/libpkg-config-0d932ed646ef39a5.rlib\r\n--extern string_cache=/home/martin/work/servo/components/servo/target/deps/libstring_cache-1cf14970ab03ef33.rlib\r\n--extern util=/home/martin/work/servo/components/servo/target/deps/libutil-6e3cdc53c8c7e07c.rlib\r\n--extern expat-sys=/home/martin/work/servo/components/servo/target/deps/libexpat-sys-3543c70bfcd7875f.rlib\r\n```\r\n\r\nThe failing linking line produced by rustc:\r\n```\r\nerror: linking with `cc` failed: exit code: 1 note:\r\n    cc '-Wl,--as-needed' '-m64' '-L'\r\n    '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-o' '/tmp/rs-3179-0-rustdoctest/rust-out'\r\n    '/tmp/rs-3179-0-rustdoctest/rust_out.o'\r\n    '-Wl,--whole-archive'\r\n    '-lmorestack'\r\n    '-Wl,--no-whole-archive'\r\n    '-Wl,--gc-sections'\r\n    '-pie'\r\n    '-nodefaultlibs'\r\n    '/home/martin/work/servo/components/servo/target/deps/libutil-6e3cdc53c8c7e07c.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libcssparser-7a9a471368ea9b30.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/liblayers-d7491f1d2aeed9ac.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libazure-83ae91b5b2ebf272.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libgleam-e5559c03c0bebfba.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libgl_common-66a5d21dea94490e.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libencoding-5d9283f8df6a2add.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libencoding-index-simpchinese-2d7c8c32f7e9f2b2.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libencoding-index-tradchinese-47f074fd879a44ba.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libxlib-ecde648e63fc4987.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libencoding-index-singlebyte-e8309dce7b73ab02.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libglx-525f8d390c2e2b0a.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libtext_writer-83aeadef5ad6c975.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libtime-ad4e077cbdd35a18.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/liburl-e5595358222a824d.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libencoding-index-korean-7f619e1decbc8e76.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libfreetype-f9e33152a2a3bfec.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libencoding-index-japanese-78d9d2f7567be380.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libstring_cache-1cf14970ab03ef33.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libphf-987a440fbd694b69.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libxxhash-245c85292ece0c63.rlib'\r\n    '/home/martin/work/servo/components/servo/target/deps/libgeom-92d0f13f38b09c46.rlib'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-ltest-4e7c5e5c'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-lterm-4e7c5e5c'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-lserialize-4e7c5e5c'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-llog-4e7c5e5c'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-lregex-4e7c5e5c'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-lgetopts-4e7c5e5c'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-lstd-4e7c5e5c'\r\n    '-L' '/home/martin/.servo/rust/2cfb5acb5a2751c759627377e602bac4f88f2d19/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib'\r\n    '-lrustrt-4e7c5e5c'\r\n    '-L' '/home/martin/work/servo/components/servo/target'\r\n    '-L' '/home/martin/work/servo/components/servo/target/deps'\r\n    '-L' '/home/martin/work/servo/components/util/.rust'\r\n    '-L' '/home/martin/work/servo/components/util'\r\n    '-Wl,--whole-archive'\r\n    '-Wl,-Bstatic'\r\n    '-Wl,--no-whole-archive'\r\n    '-Wl,-Bdynamic'\r\n    '-lGL'\r\n    '-lstdc++'\r\n    '-lfreetype'\r\n    '-lbz2'\r\n    '-lfontconfig'\r\n    '-lexpat'\r\n    '-lX11'\r\n    '-lazure'\r\n    '-lX11'\r\n    '-lrt'\r\n    '-lfreetype'\r\n    '-ldl'\r\n    '-lpthread'\r\n    '-lrt'\r\n    '-lgcc_s'\r\n    '-lpthread'\r\n    '-lc'\r\n    '-lm'\r\n    '-lcompiler-rt'\r\nnote: /usr/bin/ld: cannot find -lazure\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/90687236","html_url":"https://github.com/rust-lang/rust/issues/21246#issuecomment-90687236","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/21246","id":90687236,"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-04-07T18:16:36Z","updated_at":"2015-04-07T18:16:36Z","body":"Could you describe in a bit more detail how you're running tests? Are you using Cargo? (if so, which version?)"}}