nannou-org / nannou

A Creative Coding Framework for Rust.
https://nannou.cc/
5.98k stars 304 forks source link

Issue with rusttype when running examples. #62

Closed cwervo closed 6 years ago

cwervo commented 6 years ago

This is the bottom of my output when I attempt to run cargo run --release --example simple_window, although this happens with every single example (so unfortunately I can't get anything running at the moment). I'm using cargo 0.26.0-nightly (1d6dfea44 2018-01-26). Seems like an error with rusttype?

   Compiling syn v0.11.11
   Compiling rusttype v0.4.1
   Compiling num-bigint v0.1.41
error[E0599]: no method named `units_per_em` found for type `stb_truetype::FontInfo<SharedBytes<'a>>` in the current scope
   --> /Users/andrescuervo/.cargo/registry/src/github.com-1ecc6299db9ec823/rusttype-0.4.1/src/lib.rs:361:19
    |
361 |         self.info.units_per_em()
    |                   ^^^^^^^^^^^^

error: aborting due to previous error

If you want more information on this error, try using "rustc --explain E0599"
error: Could not compile `rusttype`.
warning: build failed, waiting for other jobs to finish...
error: build failed
cwervo commented 6 years ago

@mitchmindtree any ideas here?

mitchmindtree commented 6 years ago

Hey @AndresCuervo, sorry about the delayed reply! We just got to Nepal recently for a dedicated hackathon on nannou and just wanted to finish off the geom graph #63 before switching back to master and testing this!

I've tested this on linux and josh tested this on mac and neither of us seem to be able to recreate this right now. Would you mind sharing the entire output? Also just checking - have you tried running cargo update to see if it helps? I'm testing with cargo 0.26.0-nightly (1d6dfea44 2018-01-26).

cwervo commented 6 years ago

Hmmm I ran cargo upgrade stable because I saw Rust 1.25 is out & I'm still getting the same error. I also tried switching to nightly (I'm using cargo 1.26.0-nightly (311a5eda6 2018-03-26)) to no avail. I tried reinstalling rust, deleting my cargo registry, same weird error keeps popping up. Is there anything else you could think of for me to try? Super weird for a Rust install to get into a state where I can't work with a particular dependency just in this project.

mitchmindtree commented 6 years ago

Yeah this sounds super strange! We've been testing nannou across a few different machines and have not come across this.

I haven't used cargo upgrade before, only rustup to manage my cargo and rustc installations and updates. Are you sure that cargo upgrade also updates your rustc installation as well? I'd recommend giving rustup a go if you haven't already as it seems to be the official installation method that the rust crew are advocating for these days and is quite friendly/nice to use!

You don't happen to have a .cargo file in a parent directory somewhere that overrides the version of rusttype do you?

Are you definitely using the latest commit on master?

Perhaps you could try my glium_conrod_update branch? It is very slightly ahead of master atm with some macos fixes.

git clone https://github.com/mitchmindtree/nannou
cd nannou
git checkout glium_conrod_update
cargo run --release --example simple_window

Sorry you're having issues with this, let me know if any of this helps. Will keep thinking on this in the meantime, would love to get you playing with nannou asap!

cwervo commented 6 years ago

Ah sorry I meant rustup update stable not cargo upgrade stable in that last comment. Yep, rustup is a great tool & manages upgrades just fine!

I'm definitely using the latest commit on master, yep.

And yay, the glium_conrod_update works for me! Strangely enough (presumably due to cargo caching?) when I switch back to master and try running simple_window (for example) after it works on the other branch I get:

[1]    10206 illegal hardware instruction  cargo run --release --example simple_window

after the example builds successfully, though.

I propose we keep this issue open for now (at least until glium_conrod_update gets into master, perhaps that'll fix it?) to denote that it's an active issue. Thanks for pointing me to the other branch!

cwervo commented 6 years ago

Just updated to master, seems resolved (although getting a lot of black screens despite having no errors, will investigate that more & make a new issue if necessary!)