Giter Club home page Giter Club logo

Comments (10)

meldron avatar meldron commented on July 20, 2024

I just tried to build gstreamer-rtsp-server by itself and i got even more errors:

error[E0308]: mismatched types
  --> /home/pi/.cargo/git/checkouts/gio-a4b825b310a073b9/98d1501/src/desktop_app_info.rs:23:41
   |
23 |                 let tmp: *mut *mut i8 = *out.offset(it);
   |                                         ^^^^^^^^^^^^^^^ expected i8, found u8
   |
   = note: expected type `*mut *mut i8`
              found type `*mut *mut u8`
error[E0277]: the trait bound `std::string::String: glib::translate::FromGlibPtrArrayContainerAsVec<_, *mut *mut i8>` is not satisfied
  --> /home/pi/.cargo/git/checkouts/gio-a4b825b310a073b9/98d1501/src/desktop_app_info.rs:28:38
   |
28 |                 let v: Vec<String> = FromGlibPtrContainer::from_glib_full(tmp);
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `glib::translate::FromGlibPtrArrayContainerAsVec<_, *mut *mut i8>` is not implemented for `std::string::String`
   |
   = help: the following implementations were found:
             <std::string::String as glib::translate::FromGlibPtrArrayContainerAsVec<*const u8, *mut *const u8>>
             <std::string::String as glib::translate::FromGlibPtrArrayContainerAsVec<*const u8, *const *const u8>>
             <std::string::String as glib::translate::FromGlibPtrArrayContainerAsVec<*mut u8, *mut *mut u8>>
             <std::string::String as glib::translate::FromGlibPtrArrayContainerAsVec<*mut u8, *const *mut u8>>
   = note: required because of the requirements on the impl of `glib::translate::FromGlibPtrContainer<_, *mut *mut i8>` for `std::vec::Vec<std::string::String>`
   = note: required by `glib::translate::FromGlibPtrContainer::from_glib_full`
error[E0277]: the trait bound `std::path::Path: glib::translate::ToGlibPtr<'_, *mut i8>` is not satisfied
  --> /home/pi/.cargo/git/checkouts/gio-a4b825b310a073b9/98d1501/src/unix_socket_address.rs:56:37
   |
56 |                 Path(path) => (path.to_glib_none().0, path.as_os_str().len()),
   |                                     ^^^^^^^^^^^^ the trait `glib::translate::ToGlibPtr<'_, *mut i8>` is not implemented for `std::path::Path`
   |
   = help: the following implementations were found:
             <std::path::Path as glib::translate::ToGlibPtr<'a, *const u8>>
             <std::path::Path as glib::translate::ToGlibPtr<'a, *mut u8>>
error[E0308]: mismatched types
  --> /home/pi/.cargo/git/checkouts/gio-a4b825b310a073b9/98d1501/src/unix_socket_address.rs:61:84
   |
61 |             SocketAddress::from_glib_full(ffi::g_unix_socket_address_new_with_type(path, len as i32, type_.to_glib()))
   |                                                                                    ^^^^ expected u8, found i8
   |
   = note: expected type `*mut u8`
              found type `*mut i8`
error[E0308]: mismatched types
   --> gstreamer/src/tags.rs:197:39   
    |
197 |                 ffi::gst_tag_get_type(tag_name.as_ptr() as *const i8)
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    |
    = note: expected type `*const u8` 
               found type `*const i8` 

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: Could not compile `gstreamer`. 
warning: build failed, waiting for other jobs to finish...
error: aborting due to 4 previous errors

Some errors occurred: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: Could not compile `gio`.

from gio.

sdroege avatar sdroege commented on July 20, 2024

Ok, mismatch between signed and unsigned everywhere. See
https://github.com/rust-lang/libc/blob/master/src/unix/notbsd/linux/musl/b32/arm.rs#L1
vs
https://github.com/rust-lang/libc/blob/master/src/unix/notbsd/linux/musl/b64/x86_64.rs#L1
for example.

We need to consistently use c_char I guess

from gio.

sdroege avatar sdroege commented on July 20, 2024

Hmm but we do: https://github.com/gtk-rs/glib/blob/master/src/translate.rs#L474

Can you check in your Cargo.lock is there are multiple versions of the libc crate linked in?

from gio.

meldron avatar meldron commented on July 20, 2024

In the lock file of gstreamer-rs all libc versions are 0.2.42 and in gst-rust's lock file all versions are 0.2.41.

from gio.

sdroege avatar sdroege commented on July 20, 2024

Those definitions also didn't change for years. Ok, someone will have to reproduce and follow the types. Somewhere there must be a u8 or i8 instead of c_char

error[E0308]: mismatched types
   --> gstreamer/src/tags.rs:197:39   
    |
197 |                 ffi::gst_tag_get_type(tag_name.as_ptr() as *const i8)
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    |
    = note: expected type `*const u8` 
               found type `*const i8` 

This is a bug in gstreamer-rs btw, there might be more like this there. I'll check next week unless you want to send me a PR. @meldron

from gio.

meldron avatar meldron commented on July 20, 2024

@sdroege thanks for your input, I opened an issue at sdroege/gstreamer-rs/, and i will try to look into it, but i am not sure where to look.

from gio.

sdroege avatar sdroege commented on July 20, 2024

For gstreamer it's exactly in line 197 there. See my comment in the other ticket :)

For GLib/GIO I don't know either, you'll have to look at each of the errors individually, look at the types of function arguments/return values, local variables, etc and see where exactly the i8 or u8 comes from that should actually be a c_char. Or cast accordingly if needed.

from gio.

meldron avatar meldron commented on July 20, 2024

I will look for more and submit a PR if I am successful.

from gio.

sdroege avatar sdroege commented on July 20, 2024

The GStreamer part is fixed now, I'm looking at the GTK part now and the GIO part is here: #139

from gio.

sdroege avatar sdroege commented on July 20, 2024

Oh the other part was also in GIO, added to the existing PR

from gio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.