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

Fail to build on Ubuntu 22.04 #44

Closed
hgneng opened this issue Nov 21, 2022 · 14 comments
Closed

Fail to build on Ubuntu 22.04 #44

hgneng opened this issue Nov 21, 2022 · 14 comments
Labels
Bin Improvements to the binary program. bug Something isn't working

Comments

@hgneng
Copy link
Contributor

hgneng commented Nov 21, 2022

I get following error when build on Ubuntu 22.04:

$ cargo build --release
error: failed to parse manifest at `/home/hgneng/code/odilia/Cargo.toml`

Caused by:
  feature `strip` is required

  The package requires the Cargo feature called `strip`, but that feature is not stabilized in this version of Cargo (1.57.0).
  Consider adding `cargo-features = ["strip"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
  See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-strip-option for more information about the status of this feature.
$ cargo --version
cargo 1.57.0

After adding cargo-features = ["strip"] to the top of Cargo.toml, I get following error:

$ cargo build --release
    Updating crates.io index
error: failed to select a version for the requirement `zbus = "^3.0.0"`
candidate versions found which didn't match: 2.3.2, 2.3.1, 2.3.0, ...
location searched: crates.io index
required by package `odilia v0.0.1 (/home/hgneng/code/odilia/odilia)`

Will upgrading rust/cargo fix the build errors? What should I do?

@albertotirla
Copy link
Member

yes, try to upgrade both rustc and cargo, install them with the rustup utility for the latest versions. Technically speaking the latest version isn't required, but a recent enough one is, which ubuntu doesn't provide unfortunately. After installing rust and cargo from rustup, this is what cargo --version should output:

$ cargo --version
cargo 1.65.0 (4bc8f24d3 2022-10-20)

@TTWNO
Copy link
Member

TTWNO commented Nov 21, 2022

I highly recommend an upgrade, since a lot of what we're using is relatively new to Rust. We never use unstable features of the current version, but if Ubuntu is shipping older cargo/rustc versions, then I'd recommend using rustup instead.

@hgneng
Copy link
Contributor Author

hgneng commented Nov 22, 2022

I've upgraded Rust and fix the building issues. Thank you!

I get problem with following command:

$ cargo install --path .
error: found a virtual manifest at `/home/hgneng/code/odilia/Cargo.toml` instead of a package manifest

And I fail to run odilia binary:

$ env RUST_BACKTRACE=full ./odilia
new{}
    open{}
        0ms DEBUG Connecting to session bus
receive_msg{}
        3ms DEBUG Connected to session bus, name=":1.94"
        3ms DEBUG Getting a11y bus address from session bus
        6ms DEBUG Got a11y bus address, address=unix:path=/run/user/1000/at-spi/bus,guid=bf1bedd4b055cbb1c5801450637c2450
        7ms DEBUG Connecting to a11y bus

receive_msg{}
        12ms DEBUG Connected to a11y bus, name=":1.18"
    
    12ms DEBUG Connecting to speech-dispatcher
    85ms DEBUG speech dispatcher initialisation successful
The application panicked (crashed).
Message:  Unable to copy default config file.: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Location: odilia/src/state.rs:56

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: odilia::state::new
      at odilia/src/state.rs:25

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: __libc_start_call_main<unknown>
      at ./csu/../sysdeps/nptl/libc_start_call_main.h:58
   2: __libc_start_main_impl<unknown>
      at ./csu/../csu/libc-start.c:392

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

It seems that a default config file is missing.

@TTWNO
Copy link
Member

TTWNO commented Nov 22, 2022

Ok, got it. We'll try to add this to the install process.

@albertotirla
Copy link
Member

yes, in order to fix it, put this in ~/.config/odilia/config.toml

[speech]
rate=100
[log]
level="debug"

after that issue is fixed, it should run, as best as it can anyway

@hgneng
Copy link
Contributor Author

hgneng commented Nov 23, 2022

Thank you! Odilia successfully runs.

However, it keeps saying the content of terminal that it launches. "Control" key cannot stop it. Switching to another terminal tab or Firefox doesn't work either. Sample contents:

DEBUG Event handled without error
DEBUG Ignoring event with unknown kind, kind="showing"
DEBUG Event handled without error
DEBUG Ignoring event with unknown kind, kind="visible"
DEBUG Event handled without error
DEBUG Event handled without error
DEBUG Event handled without error
DEBUG Event handled without error
DEBUG Event handled without error

@TTWNO TTWNO added bug Something isn't working Bin Improvements to the binary program. labels Nov 23, 2022
@TTWNO
Copy link
Member

TTWNO commented Nov 24, 2022

Ok, yes you're right. We need to get the control character to stop speech ASAP. The reason I haven't noticed this bug is because my terminal emulator (foot), is not accessible, so no information is sent to Odilia when it starts.

@TTWNO TTWNO closed this as completed in 04b26e9 Nov 28, 2022
TTWNO added a commit that referenced this issue Nov 28, 2022
@TTWNO
Copy link
Member

TTWNO commented Nov 28, 2022

Please let me know if the latest version fixes this issue? Thanks.

@TTWNO TTWNO reopened this Nov 28, 2022
@hgneng
Copy link
Contributor Author

hgneng commented Nov 29, 2022

The fix seems not work for me. After git pull and rebuild, Control key still can't stop the speech at once. But odilia seems behave a bit different to previous version. I can hear it read content in another terminal.

In my case, not only control key should stop the current speech queue, any key press in the terminal or switching to another application should clear the speech queue and read new content. However, everything seems read in a non-breakable-queue.

Would it be caused by that I may be using a different speech-dispatcher to yours?

@TTWNO
Copy link
Member

TTWNO commented Nov 29, 2022

That shouldn't be a problem. You're right, Odilia will not stop talking on an application change or when you type. I'll manage these bugs separately and mention them here.

@TTWNO
Copy link
Member

TTWNO commented Nov 29, 2022

You will need to start the keyboard daemon, as well as Odilia, if you want the keys to work.
You can find this script in the ./scripts/ directory. start_sohkd.sh is what you want. It will ask you for a root password, and then you will be able to continue.

The fact that you need a process executing as root to handle the key events is already a bug we have on Github. The long-term solution requires creating a new Wayland protocol, which none of us have done before, so it's still a ways out. For now, two processes will need to be running for Odilia to function normally. See: #8

@TTWNO
Copy link
Member

TTWNO commented Dec 14, 2022

@hgneng , with some major updates and a new script to start Odilia (in ./scripts/odilia), could you try this again and let me know.

We have removed our dependence on clang, libclang, etc.

Now you just need Speech Dispatcher and a voice!! Let me know if the current main works for you?

Reminder: you need to launch both the key daemon and odilia through ./scripts/

@hgneng
Copy link
Contributor Author

hgneng commented Dec 15, 2022

Thank you! ./scripts/odilia runs better. Content of new terminal will be read at once when switching.

There are still issues:

  1. In README file, it would be better telling user to run cargo run within sohkd before running ./scripts/debug_start_sohkd.sh because the script depends on a debug version target/debug/sohkd not the release version.
  2. Config file is missing for sohkdrc. What should I do?
    $ scripts/debug_start_sohkd.sh
    ==== AUTHENTICATION COMPLETE ===
    [2022-12-15T03:18:05Z TRACE sohkd] Logger initialized.
    [2022-12-15T03:18:05Z TRACE sohkd] Invoking UID: 1000
    [2022-12-15T03:18:05Z TRACE sohkd] Setting process umask.
    [2022-12-15T03:18:05Z ERROR sohkd] XDG_RUNTIME_DIR has not been set.
    [2022-12-15T03:18:05Z DEBUG sohkd] Created runtime directory.
    [2022-12-15T03:18:05Z DEBUG sohkd] Set runtime directory to readonly.
    [2022-12-15T03:18:05Z WARN sohkd] Running sohkd as root!
    [2022-12-15T03:18:05Z DEBUG sohkd::perms] Setting initgroups...
    [2022-12-15T03:18:05Z DEBUG sohkd::perms] Setting EGID...
    [2022-12-15T03:18:05Z DEBUG sohkd::perms] Setting EUID...
    [2022-12-15T03:18:05Z DEBUG sohkd] Using config file path: "/etc/odilia/sohkdrc"
    [2022-12-15T03:18:05Z ERROR sohkd] Config Error: Config file not found.

@TTWNO
Copy link
Member

TTWNO commented Dec 15, 2022

Ah yes, we should add instructions for installing the config files. Making a new issue for that.

@TTWNO TTWNO closed this as completed Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bin Improvements to the binary program. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants