Comments (10)
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.
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.
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.
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.
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.
@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.
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.
I will look for more and submit a PR if I am successful.
from gio.
The GStreamer part is fixed now, I'm looking at the GTK part now and the GIO part is here: #139
from gio.
Oh the other part was also in GIO, added to the existing PR
from gio.
Related Issues (20)
- Idea for "magical" strings HOT 6
- Add GPropertyAction HOT 3
- Unable to write bytes to IOStream using futures HOT 4
- How to convert Vec<GString> into Vec<String> HOT 6
- Missing Permission::new() HOT 5
- Manual bindings for functions with Cancellable args are inconsistent HOT 4
- Implement AppInfo::launch_uris_async
- Wrong mutability in UnixMountPoint HOT 1
- Don't require all users of `GioFuture` to depend on `fragile` HOT 1
- GIO is trying to list g_desktop_app_info* on macos and causing link failure HOT 1
- DataInputStream::read_until_async asserts when empty HOT 6
- Add check to ensure that no manual_trait is forgotten HOT 5
- ApplicationExt::connect_handle_local_options() is missing HOT 7
- Implement an AsyncBufRead adapter for InputStream HOT 9
- ThreadedSocketService panics while accepting connection HOT 4
- Bind GIOChannel HOT 3
- How to use async reqwest HTTP client from gio event loop? HOT 3
- InetAddress <-> standard library IpAddr* types conversion
- `TimeVal` usage is wrong and maybe shouldn't be there at all HOT 1
- No TlsBackend? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gio.