oakes / SolidOak

An IDE for Rust
https://sekao.net/solidoak/
The Unlicense
893 stars 60 forks source link

SolidOak failed to compile with rust nightly #44

Closed alsam closed 8 years ago

alsam commented 8 years ago

Hello, SolidOak failed to compile with

rustc --version
rustc 1.6.0-dev (b6b17c989 2015-11-14)

The error message:

../.cargo/git/checkouts/cairo-571ad16295201b7a/master/src/image_surface.rs:39:37: 39:49 error: no method named `as_mut_ptr` found for type `&mut image_surface::AsyncBorrow<Box<[u8]>, F>` in the current scope
../.cargo/git/checkouts/cairo-571ad16295201b7a/master/src/image_surface.rs:39             let ptr = data.as_mut().as_mut_ptr();
                                                                                                                           ^~~~~~~~~~~~
.../.cargo/git/checkouts/cairo-571ad16295201b7a/master/src/image_surface.rs:39:37: 39:49 help: items from traits can only be used if the trait is implemented and in scope; the following trait defines an item `as_mut_ptr`, perhaps you need to implement it:
.../.cargo/git/checkouts/cairo-571ad16295201b7a/master/src/image_surface.rs:39:37: 39:49 help: candidate #1: `core::slice::SliceExt`
error: aborting due to previous error
Build failed, waiting for other jobs to finish...
Could not compile `cairo-rs`.

Thanks

alsam commented 8 years ago

Strictly speaking the error message appeared during cairo-rs compilation.

   Compiling cairo-rs v0.0.4 (https://github.com/rust-gnome/cairo#8c562274)

Follow crates.io the latest cairo-rs crate is 0.0.6 and it should compile with nightly rust. From https://github.com/gtk-rs/cairo

cairo build passing

will check it, Thanks

iuliuv commented 8 years ago

Hi, sorry for the newbee question. I have a similar issue:

$ rustc --version
rustc 1.7.0-dev (21b025f55 2016-01-06)
$ cargo --version
cargo 0.8.0 (ca37345 2016-01-06)
$ cargo build
.....
/home/iuliuv/.cargo/registry/src/github.com-88ac128001ac3a9a/rustc-serialize-0.3.15/
src/serialize.rs:201:5: 201:64 error: the trait `core::marker::Sized` is not implemented 
for the type `Self` [E0277]

looks like a problem with the serialize-0.3.15. There is a serialize-0.3.16, but I am not sure how to make SolidOak use it for compilation. The one think I tried ended in a new error:

iuliuv@blacklake:~/rust/SolidOak$ cargo update
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/oakes/neovim-rs`
    Updating git repository `https://github.com/oakes/gtk`
    Updating git repository `https://github.com/rust-gnome/gdk`
    Updating git repository `https://github.com/rust-gnome/glib`
    Updating git repository `https://github.com/rust-gnome/pango`
    Updating git repository `https://github.com/rust-gnome/cairo`
no matching package named `gdk-sys` found (required by `gtk`)
location searched: https://github.com/rust-gnome/gdk
version required: *

thank you

alsam commented 8 years ago

Hi @iuliuv, you are quite right, the same for me:

   Compiling cairo-rs v0.0.4 (https://github.com/rust-gnome/cairo#8c562274)
   Compiling libc v0.1.8
/home/asamoilo/.cargo/registry/src/github.com-88ac128001ac3a9a/rustc-serialize-0.3.15/src/serialize.rs:201:5: 201:64 error: the trait `core::marker::Sized` is not implemented for the type `Self` [E0277]
/home/asamoilo/.cargo/registry/src/github.com-88ac128001ac3a9a/rustc-serialize-0.3.15/src/serialize.rs:201     fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;
                                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/asamoilo/.cargo/registry/src/github.com-88ac128001ac3a9a/rustc-serialize-0.3.15/src/serialize.rs:201:5: 201:64 help: run `rustc --explain E0277` to see a detailed explanation
/home/asamoilo/.cargo/registry/src/github.com-88ac128001ac3a9a/rustc-serialize-0.3.15/src/serialize.rs:201:5: 201:64 note: `Self` does not have a constant size known at compile-time
/home/asamoilo/.cargo/registry/src/github.com-88ac128001ac3a9a/rustc-serialize-0.3.15/src/serialize.rs:201:5: 201:64 note: required by `core::result::Result`
error: aborting due to previous error

looking into Cargo.lock noticed

less Cargo.lock
name = "solidoak"
version = "0.1.3"
dependencies = [
 "gdk 0.1.1 (git+https://github.com/rust-gnome/gdk)",
 "glib 0.0.3 (git+https://github.com/rust-gnome/glib)",
 "gtk 0.0.3 (git+https://github.com/oakes/gtk)",
 "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "neovim-rs 0.1.0 (git+https://github.com/oakes/neovim-rs)",
 "rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
...
[[package]]
name = "rustc-serialize"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"

generally as a quick-n-dirty fix I would s/0.3.15/0.3.16/g in Cargo.lock

after it

~/work/github/SolidOak $ cargo build
unused manifest key: dependencies.libc.Libc
unused manifest key: dependencies.rustc-serialize.rustc-serialize
   Compiling rustc-serialize v0.3.16
   Compiling neovim-rs v0.1.0 (https://github.com/oakes/neovim-rs#a622fa28)
   Compiling gdk-sys v0.1.1 (https://github.com/rust-gnome/gdk#6c996c98)
   Compiling glib v0.0.3 (https://github.com/rust-gnome/glib#ccbc2696)
Build failed, waiting for other jobs to finish...
error: internal compiler error: ty_is_local invoked on unexpected type: [type error]
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', src/libsyntax/errors/mod.rs:469

so rust-serialize has the correct version 0.3.16 but anyway compilation is broken in other places. Hope this helps.

oakes commented 8 years ago

Not sure if it compiles with the nightly yet but I just updated gtk-rs and neovim-rs so it builds with the latest stable release of rust.

iuliuv commented 8 years ago

Worked brilliantly, with the latest dev, too! Thank you!!

alsam commented 8 years ago

Confirm, built ok with the nightly. Thanks a lot! Closing the issue.