----- Original Message -----
> From: "André Pang" <oz...@algorithm.com.au>
> To: "Brian Anderson" <bander...@mozilla.com>
> Cc: rust-dev@mozilla.org
> Sent: Sunday, February 5, 2012 7:24:23 PM
> Subject: Re: [rust-dev] error: can't find crate for 'core'
> 
> On Feb 5, 2012, at 4:04 PM, Brian Anderson wrote:
> 
> >> Hi!  I'm trying out rust for the first time, and successfully
> >> compiled and installed rustc.  I hit this error attempting to
> >> compile "hello world":
> >> 
> >>> ~ % cat hello.rs
> >>> use std;
> >>> fn main(args: [str]) {
> >>>    std::io::println("hello world from '" + args[0] + "'!");
> >>> }
> >>> ~ % rustc hello.rs
> >>> hello.rs:1:0: 1:0 error: can't find crate for 'core'
> >>> hello.rs:1 use std;
> >>>           ^
> > 
> > If you run again with "RUST_LOG=rustc::metadata::creader" you
> > should get a bunch of information about where rustc is looking for
> > the core crate. For example, when I compile something I see the
> > following:
> > 
> > ...
> > rust: "inspecting file
> > /home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustc.so"
> > rust: "skipping
> > /home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustc.so,
> > doesn't look like libcore-*.
> > so"
> > rust: "inspecting file
> > /home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore-14bd852465126fe7-0.1.so"
> > rust:
> > "/home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore-14bd852465126fe7-0.1.so
> > is a candidate"
> > rust: "matching 0 metadata requirements against 4 items"
> > rust: "crate metadata:"
> > rust: "  name = "core""
> > rust: "  vers = "0.1""
> > rust: "  uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8""
> > rust: "  url = "http://rust-lang.org/src/core"";
> > rust: "found
> > /home/banderson/Dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore-14bd852465126fe7-0.1.so
> > with matching metadata"
> 
> Hmm, I get something rather odd if I try this:
> 
> ~ % RUST_LOG=rustc::metadata::creader rustc ~/hello.rs
> /Users/andre/hello.rs:1:0: 1:0 error: can't find crate for 'core'
> /Users/andre/hello.rs:1 use std;
>                         ^
> rust: upcall fail 'explicit failure',
> src/comp/driver/diagnostic.rs:52
> rust: upcall fail 'explicit failure', src/comp/driver/rustc.rs:184
> rust: domain main @0x10182be00 root task failed
> 
> I tried it with the compiler built at x86_64-apple-darwin/stage3/bin/
> too; same result.

OK. That's unexpected. I'm not sure what the next thing you should do is. If 
you write '#[no_core];' at the top of the file it will not try to link to 
libcore. At least then you could see if it manages to find libstd successfully.

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to