sdroege / gobject-example-rs

Example for exporting a GObject/C API from Rust
42 stars 6 forks source link

can't compile with rust 1.18 #1

Closed grindhold closed 7 years ago

grindhold commented 7 years ago

the problem below the line has been resolved by installing a newer cargo version and rust compiler.


with

cargo 0.2.0-nightly (efb482d 2015-04-30) (built 2015-04-30)

and

rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)

i receive

failed to parse manifest at `/home/grindhold/_git_archive/gobject-example-rs/Cargo.toml`

Caused by:
  expected a value of type `string` for the key `lib.name`

when entering a random string as name, (as nothing depends on the lib we build, it should not matter, right?), i receive this:

    Updating git repository `https://github.com/gtk-rs/sys`
    Updating git repository `https://github.com/gtk-rs/glib`
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading pkg-config v0.3.9
 Downloading bitflags v0.9.1
 Downloading libc v0.2.30
 Downloading lazy_static v0.2.8
   Compiling lazy_static v0.2.8
   Compiling libc v0.2.30
   Compiling bitflags v0.9.1
   Compiling pkg-config v0.3.9
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-0.2.8/src/nightly_lazy.rs:18:9: 18:14 error: expected one of `extern`, `fn`, `type`, or `unsafe`, found `const`
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-0.2.8/src/nightly_lazy.rs:18     pub const fn new() -> Self {
                                                                                                                 ^~~~~
Build failed, waiting for other jobs to finish...
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-0.9.1/src/lib.rs:219:1: 219:11 error: no_std is experimental
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-0.9.1/src/lib.rs:219 #![no_std]
                                                                                              ^~~~~~~~~~
error: aborting due to previous error
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:185:13: 185:21 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:185            .finish()
                                                                                                            ^~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:184:13: 184:42 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:184            .field("stderr", stderr_debug)
                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:183:13: 183:42 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:183            .field("stdout", stdout_debug)
                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:182:13: 182:44 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:182            .field("status", &self.0.status)
                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:181:13: 181:35 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:181         fmt.debug_struct("Output")
                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:196:19: 196:27 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:196                  .finish()
                                                                                                                  ^~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:195:19: 195:30 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:195                  .field(name)
                                                                                                                  ^~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:194:19: 194:48 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:194                 f.debug_tuple("EnvNoPkgConfig")
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:204:19: 204:27 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:204                  .finish()
                                                                                                                  ^~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:203:19: 203:40 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:203                  .field("cause", cause)
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:202:19: 202:44 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:202                  .field("command", command)
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:201:19: 201:42 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:201                 f.debug_struct("Command")
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:210:19: 210:27 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:210                  .finish()
                                                                                                                  ^~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:209:19: 209:59 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:209                  .field("output", &OutputDebugger(output))
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:208:19: 208:44 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:208                  .field("command", command)
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:207:19: 207:42 error: use of unstable library feature 'debug_builders': method was just created
/home/grindhold/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.3.9/src/lib.rs:207                 f.debug_struct("Failure")
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 16 previous errors
Could not compile `lazy_static`.

Is my setup hopelessly outdated or what am i doing wrong?

grindhold commented 7 years ago

okay, nevermind. rust 1.0.0 is really outdated and i use 1.18 now which ships with my debian testing. however i still only get this far:

error[E0308]: mismatched types
  --> src/foo/mod.rs:78:13
   |
78 | /             connect(
79 | |                 self.to_glib_none().0,
80 | |                 "incremented",
81 | |                 transmute(incremented_trampoline::<Self> as usize),
82 | |                 Box::into_raw(f) as *mut _,
83 | |             )
   | |_____________^ expected u64, found struct `glib::SignalHandlerId`
   |
   = note: expected type `u64`
              found type `glib::SignalHandlerId`

error[E0308]: mismatched types
  --> src/bar/mod.rs:71:13
   |
71 | /             connect(
72 | |                 self.to_glib_none().0,
73 | |                 "notify::number",
74 | |                 transmute(notify_number_trampoline as usize),
75 | |                 Box::into_raw(f) as *mut _,
76 | |             )
   | |_____________^ expected u64, found struct `glib::SignalHandlerId`
   |
   = note: expected type `u64`
              found type `glib::SignalHandlerId`

error: aborting due to 2 previous errors

error: Could not compile `gobject-example`.

To learn more, run the command again with --verbose.
Makefile:30: recipe for target 'target/debug/libgobject_example.so' failed
make: *** [target/debug/libgobject_example.so] Error 101

Is still still an issue related to my compiler version? i find it a bit strange, because gsignal-handler-ids are in fact uint64

sdroege commented 7 years ago

Thanks for reporting, this was caused by an API change in glib-rs

grindhold commented 7 years ago

thanks for fixing!