DiamondLovesYou / rust-ppapi

Rust idiomatic bindings to the Pepper API.
Mozilla Public License 2.0
14 stars 0 forks source link

Can't find crate for `std` #1

Closed danielrh closed 10 years ago

danielrh commented 10 years ago

Hi- I tried building your rust-ppapi code and got the following error:

make[1]: Entering directory `/home/daniel/dev/rust-ppapi/deps/rust-openssl'
/home/daniel/Downloads/pnacl-rust/bin/rustc -C cross-path=/home/daniel/Downloads/nacl_sdk/nacl_sdk/pepper_canary -C nacl-flavor=pnacl --target=le32-unknown-nacl -L /home/daniel/dev/rust-ppapi/deps/rust-http --sysroot=/home/daniel/Downloads/pnacl-rust --cfg ndebug -O --cfg ndebug  --dep-info build/openssl.d --out-dir build lib.rs
lib.rs:1:1: 1:1 error: can't find crate for `std`
lib.rs:1 #![feature(struct_variant, macro_rules)]
         ^
error: aborting due to previous error
make[1]: *** [build/libopenssl-06cd96fd-0.0.so] Error 101
make[1]: Leaving directory `/home/daniel/dev/rust-ppapi/deps/rust-openssl'
make: *** [deps/openssl.stamp] Error 2

This is after I built your modified rustc using modified jemalloc (had to run ./configure manually and tell it to prepend je to mallocx) and modified llvm

Any thoughts on what could be going on here? do I need to set some env variable?

DiamondLovesYou commented 10 years ago

You shouldn't need any env var. Did you configure Rust with --target=le32-unknown-nacl? As for the Jemalloc issue, I had forgotten to add configure to the repo. That part should be fixed now.

danielrh commented 10 years ago

Thanks for the tip: that got me past the first problem... it then complained about missing ppapi and I specified the paths I just built at... (in the rust-pnacl-hello-world repo home I ran)

NACL_SDK=/home/daniel/Downloads/nacl_sdk/nacl_sdk/pepper_canary SYSROOT=/home/daniel/Downloads/pnacl-rust TOOLCHAIN=/home/daniel/Downloads/nacl_sdk/nacl_sdk/pepper_canary/toolchain/linux_pnacl/ make SYSROOT=/home/daniel/Downloads/pnacl-rust TOOLCHAIN=/home/daniel/Downloads/nacl_sdk/nacl_sdk/pepper_canary/toolchain/linux_pnacl/ NACL_SDK=/home/daniel/Downloads/nacl_sdk/nacl_sdk/pepper_canary

And I got a error message in the console NativeClient: PnaclCoordinator: link failed. (index):1

the build is at http://graphics.stanford.edu/~danielrh/rust-pnacl-hello-world/ I also had to change the symlink from debug.nmf to point to manifest.nmf
perhaps that was why it failed? otherwise it complained that NativeClient: could not load manifest url.

DiamondLovesYou commented 10 years ago

Oh the make vars should be provided as program arguments, and not envs. I see you figured that out, but the envs are unnecessary.

Ah, I accidentally used absolute paths for the symbolic links. Fixed!

Apropos to debug.nmf: debug.nmf is there because Chome has an option to wait for a connection from gdb when the manifest has "debug" in it.

Yes, linking is currently broken. The toolchain actually runs all optimizations post link; this is a problem for Rust because the std crates are fairly large (at the LLVM module level), causing simple, basically one-liner programs to take over two minutes (!!) to compile. Additionally, our newer LLVM was crashing their LLVM vexingly often, particularly with regard to clashing debug info versions. In order to alleviate these issues so one could actually run the tests overnight (at the very least), I wrote a hack (hammer style) of a linker so rustc could 1, bypass pnacl-clang in the toolchain and 2, bring the link time down to under 30 seconds, so I could then run the tests. Unfortunately, the process for ensuring valid PNaCl IR whilst keeping link-times down isn't clear cut, and is partially trial and error. It's my top priority though.

DiamondLovesYou commented 10 years ago

As of https://github.com/DiamondLovesYou/rust/commit/cd9fab73f8a17eee51c37930f356c1c716828a20, linking issues should (as far as I can tell) be resolved.

At any rate, this issue is a bit off topic, and I'm going to close it. Feel free to open a new issue if you have one.