Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check.sh fails to compile speech-dispatcher #1125

Closed
juancampa opened this issue Jan 16, 2022 · 11 comments · Fixed by #2274
Closed

Check.sh fails to compile speech-dispatcher #1125

juancampa opened this issue Jan 16, 2022 · 11 comments · Fixed by #2274
Labels
bug Something is broken native-linux Problem specific to Linux

Comments

@juancampa
Copy link
Contributor

Describe the bug
check.sh fails to run ith the following compilation error

Click to expand check.sh output
  + cargo check --workspace --all-targets --all-features
      Checking egui v0.16.1 (/home/juan/git/egui/egui)
      Checking speech-dispatcher v0.9.0
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:35:13
     |
  35 |     Male1 = SPDVoiceType::SPD_MALE1,
     |             ^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:36:13
     |
  36 |     Male2 = SPDVoiceType::SPD_MALE2,
     |             ^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:37:13
     |
  37 |     Male3 = SPDVoiceType::SPD_MALE3,
     |             ^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:38:15
     |
  38 |     Female1 = SPDVoiceType::SPD_FEMALE1,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:39:15
     |
  39 |     Female2 = SPDVoiceType::SPD_FEMALE2,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:40:15
     |
  40 |     Female3 = SPDVoiceType::SPD_FEMALE3,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:41:17
     |
  41 |     ChildMale = SPDVoiceType::SPD_CHILD_MALE,
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  error[E0308]: mismatched types
    --> /home/juan/.cargo/registry/src/github.com-1ecc6299db9ec823/speech-dispatcher-0.9.0/src/lib.rs:42:19
     |
  42 |     ChildFemale = SPDVoiceType::SPD_CHILD_FEMALE,
     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  
  For more information about this error, try `rustc --explain E0308`.
  error: could not compile `speech-dispatcher` due to 8 previous errors
  warning: build failed, waiting for other jobs to finish...
  error: build failed

To Reproduce
Steps to reproduce the behavior:

  1. Clone master
  2. Run sh/check.sh
  3. Notice it finishes with errorrs

Expected behavior
It finishes without errors

Desktop (please complete the following information):

  • OS: Arch Linux with libspeechd 0.11.1-1 🚨 <-- Most likely the issue?

Additional context
Originally brought up in #1119

@juancampa juancampa added the bug Something is broken label Jan 16, 2022
@emilk
Copy link
Owner

emilk commented Jan 16, 2022

Have you run the setup code in https://github.com/emilk/egui#demo (sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev)?

@juancampa
Copy link
Contributor Author

I'm on Arch Linux, so no apt-get. But I did the equivalent for Arch using pacman. I also tried upgrading to the latest tts crate, which in turn uses the latest speech-dispatcher but that didn't help either.

@emilk
Copy link
Owner

emilk commented Apr 16, 2022

Note that you don't need speech-dispatcher - it is only for the experimental screen_reader feature.

@emilk emilk added the native-linux Problem specific to Linux label Apr 16, 2022
@Pjottos
Copy link

Pjottos commented Jun 12, 2022

Also ran into this issue on Arch Linux since it ships a more recent version of speech-dispatcher than Ubuntu.
I worked around it by temporarily updating the tts dependency in both eframe and egui-winit.

@coderedart
Copy link
Contributor

Yeah. I could not compile it on arch too. I though something was wrong with my system.

The main issue was being unable to run the CI command to check if everything was working properly. I could not use the --all-features flag as that would fail with compilation of speechd.

Had to make a commit, Check why CI failed on github, fix that and repeat .

It was so exhausting:( almost wanted to just install ubuntu on my old laptop just to deal with this

@emilk
Copy link
Owner

emilk commented Jun 13, 2022

A lot of people seems to be affected by this - anyone want to work on it? Either by disabling speech-dispatcher on Arch, or fixing speech-dispatcher upstream, or altering check.sh, or any other means necessary.

emilk added a commit that referenced this issue Jul 25, 2022
This is a small step in mitigating #1125
@emilk
Copy link
Owner

emilk commented Jul 25, 2022

I pushed a commit that makes it easier to just disable tts when you want to test on Linux. If you apply this patch, then cargo check --all-features will work:

index 2e983d9a..3df2a370 100644
--- a/eframe/Cargo.toml
+++ b/eframe/Cargo.toml
@@ -52,7 +52,6 @@ puffin = ["dep:puffin", "egui_glow?/puffin"]
 ## Enable screen reader support (requires `ctx.options().screen_reader = true;`)
 screen_reader = [
   "egui-winit/screen_reader",
-  "tts",
 ]
 
 ## Use [`wgpu`](https://docs.rs/wgpu) for painting (via [`egui_wgpu`](https://github.com/emilk/egui/tree/master/egui_wgpu)).
diff --git a/egui-winit/Cargo.toml b/egui-winit/Cargo.toml
index e76a399e..63fba4a7 100644
--- a/egui-winit/Cargo.toml
+++ b/egui-winit/Cargo.toml
@@ -34,7 +34,7 @@ links = ["webbrowser"]
 puffin = ["dep:puffin"]
 
 ## Experimental support for a screen reader.
-screen_reader = ["tts"]
+screen_reader = []
 
 ## Allow serialization of [`WindowSettings`] using [`serde`](https://docs.rs/serde).
 serde = ["egui/serde", "dep:serde"]

Still unsure what a good long-term solution is. Should we just never use tts on Linux?

@coderedart
Copy link
Contributor

after A LOT of debugging

  1. speech-dispatcher has a type mismatch issue with C FFI. which is fixed in a later version, but has one more fn pointer issue which is due to older version of bindgen.
  2. Cargo.lock relying on an older 0.60.1 version of bindgen used by the speech-dispatcher crate. that bindgen has some issue with mismatch in function pointer signature thingy which causes speech-dispatcher compilation to fail. bump to 0.61 .
  3. unfortunately, latest bindgen uses core::ffi types, and they are stabilized in 1.64 version of rust. so, gotta bump min rust version too.

after the above three changes, I got no compilation errors.

@emilk If you are okay with bumping min rust version and doing a cargo update for updating bindgen version in lockfile , this issue can be fixed.

@coderedart
Copy link
Contributor

rust 1.63 introduces a lint https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq and a lot of structs in egui implement partial_eq but not eq, so this will touch a lot of files if we want to pass the CI checks :)

@RobWalt
Copy link
Contributor

RobWalt commented Nov 9, 2022

I'm on Nixos using the latest stable version of speechd and I'm running into the same issue.

@coderedart
Copy link
Contributor

I will try making a PR tonight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken native-linux Problem specific to Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants