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

Failed to install flawz with cargo #13

Closed
kylak opened this issue May 19, 2024 · 8 comments
Closed

Failed to install flawz with cargo #13

kylak opened this issue May 19, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@kylak
Copy link

kylak commented May 19, 2024

bug when trying to install flawz (with cargo)

error: linking with cc failed: exit status: 1
= note: /usr/bin/ld: cannot find -lsqlite3: No such file or directory
collect2: error: ld returned 1 exit status

To reproduce

  1. cargo install flawz

Expected behavior

Screenshots / Logs

Software information

  • Operating system: Ubuntu 23.10
  • Rust version: rustc 1.77.1 (7cf61ebde 2024-03-27)
  • Project version: flawz 0.1.0

Additional context

@kylak kylak added the bug Something isn't working label May 19, 2024
@orhun
Copy link
Owner

orhun commented May 19, 2024

Hey, thanks for reporting this! 🐻

Can you try installing libsqlite3-dev via apt install libsqlite3-dev and trying the same cargo install command again? I think the nvd_cve crate depends on sqlite and that's why it's failing.

Azathothas added a commit to Azathothas/Toolpacks that referenced this issue May 20, 2024
@orhun orhun changed the title bug when trying to install flawz (with cargo) Failed to install flawz with cargo May 20, 2024
@anisse
Copy link

anisse commented May 27, 2024

Hi, I hit the same thing, and while I knew what to install, the README did not document it as a requirement. Do you think it would make sense to change this issue in a doc update issue?

@orhun
Copy link
Owner

orhun commented May 27, 2024

Good idea! Are you possibly interested in submitting a PR? 👀

@anisse
Copy link

anisse commented May 29, 2024

I'm not interested, but it would make a great first issue for new contributors!

@orhun orhun removed their assignment Jun 22, 2024
@pirafrank
Copy link
Contributor

Hi, I do not know if it is the same error, yet cargo install flawz fails.

sudo apt install libsqlite3-dev didn't help.

Details below.

❯ rustc --version
rustc 1.80.0 (051478957 2024-07-21)
❯ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"

Full output below.

...
   Compiling flawz v0.2.2
error[E0277]: the trait bound `ratatui::text::line::Line<'_>: From<Vec<Span<'_>>>` is not satisfied
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flawz-0.2.2/src/tui.rs:256:13
    |
255 |           let popup = Popup::new(
    |                       ---------- required by a bound introduced by this call
256 | /             vec![
257 | |                 "|".set_style(app.theme.separator),
258 | |                 cve.id.to_string().set_style(app.theme.highlight).bold(),
259 | |                 "|".set_style(app.theme.separator),
260 | |             ],
    | |_____________^ the trait `From<Vec<Span<'_>>>` is not implemented for `ratatui::text::line::Line<'_>`, which is required by `Vec<Span<'_>>: Into<ratatui::text::line::Line<'_>>`
    |
    = help: the following other types implement trait `From<T>`:
              <ratatui::text::line::Line<'a> as From<&'a str>>
              <ratatui::text::line::Line<'a> as From<Vec<ratatui::text::span::Span<'a>>>>
              <ratatui::text::line::Line<'a> as From<ratatui::text::span::Span<'a>>>
              <ratatui::text::line::Line<'a> as From<std::string::String>>
    = note: required for `Vec<Span<'_>>` to implement `Into<ratatui::text::line::Line<'_>>`
note: required by a bound in `Popup::<'content, W>::new`
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-popup-0.3.4/src/popup.rs:70:12
    |
68  |     pub fn new<L>(title: L, body: W) -> Self
    |            --- required by a bound in this associated function
69  |     where
70  |         L: Into<Line<'content>>,
    |            ^^^^^^^^^^^^^^^^^^^^ required by this bound in `Popup::<'content, W>::new`

error[E0277]: the trait bound `Paragraph<'_>: ratatui::widgets::WidgetRef` is not satisfied
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flawz-0.2.2/src/tui.rs:261:13
    |
255 |         let popup = Popup::new(
    |                     ---------- required by a bound introduced by this call
...
261 |             sized_paragraph,
    |             ^^^^^^^^^^^^^^^ the trait `ratatui::widgets::WidgetRef` is not implemented for `Paragraph<'_>`, which is required by `SizedWrapper<Paragraph<'_>>: SizedWidgetRef`
    |
help: trait impl with same name found
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/widgets/paragraph.rs:327:1
    |
327 | impl WidgetRef for Paragraph<'_> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `ratatui` are being used?
    = help: the following other types implement trait `ratatui::widgets::WidgetRef`:
              &str
              Option<W>
              Popup<'_, W>
              SizedWrapper<W>
              ratatui::text::line::Line<'_>
              ratatui::text::span::Span<'_>
              ratatui::text::text::Text<'_>
              ratatui::widgets::barchart::BarChart<'_>
            and 12 others
    = note: required for `SizedWrapper<Paragraph<'_>>` to implement `SizedWidgetRef`
note: required by a bound in `Popup::<'content, W>::new`
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-popup-0.3.4/src/popup.rs:51:19
    |
51  | impl<'content, W: SizedWidgetRef> Popup<'content, W> {
    |                   ^^^^^^^^^^^^^^ required by this bound in `Popup::<'content, W>::new`
...
68  |     pub fn new<L>(title: L, body: W) -> Self
    |            --- required by a bound in this associated function

error[E0599]: the method `style` exists for struct `Popup<'_, SizedWrapper<Paragraph<'_>>>`, but its trait bounds were not satisfied
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flawz-0.2.2/src/tui.rs:263:10
    |
255 |           let popup = Popup::new(
    |  _____________________-
256 | |             vec![
257 | |                 "|".set_style(app.theme.separator),
258 | |                 cve.id.to_string().set_style(app.theme.highlight).bold(),
...   |
262 | |         )
263 | |         .style(app.theme.background);
    | |         -^^^^^---------------------- help: remove the arguments
    | |         ||
    | |_________|field, not a method
    |
    |
   ::: /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-popup-0.3.4/src/popup.rs:102:1
    |
102 |   pub struct SizedWrapper<W: Debug> {
    |   --------------------------------- doesn't satisfy `SizedWrapper<Paragraph<'_>>: SizedWidgetRef`
    |
   ::: /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/widgets/paragraph.rs:40:1
    |
40  |   pub struct Paragraph<'a> {
    |   ------------------------ doesn't satisfy `Paragraph<'_>: ratatui::widgets::WidgetRef`
    |
    = note: the following trait bounds were not satisfied:
            `Paragraph<'_>: ratatui::widgets::WidgetRef`
            which is required by `SizedWrapper<Paragraph<'_>>: SizedWidgetRef`

error[E0277]: the trait bound `Paragraph<'_>: ratatui::widgets::WidgetRef` is not satisfied
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flawz-0.2.2/src/tui.rs:255:21
    |
255 |           let popup = Popup::new(
    |  _____________________^
256 | |             vec![
257 | |                 "|".set_style(app.theme.separator),
258 | |                 cve.id.to_string().set_style(app.theme.highlight).bold(),
...   |
261 | |             sized_paragraph,
262 | |         )
    | |_________^ the trait `ratatui::widgets::WidgetRef` is not implemented for `Paragraph<'_>`, which is required by `SizedWrapper<Paragraph<'_>>: SizedWidgetRef`
    |
help: trait impl with same name found
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/widgets/paragraph.rs:327:1
    |
327 | impl WidgetRef for Paragraph<'_> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `ratatui` are being used?
    = help: the following other types implement trait `ratatui::widgets::WidgetRef`:
              &str
              Option<W>
              Popup<'_, W>
              SizedWrapper<W>
              ratatui::text::line::Line<'_>
              ratatui::text::span::Span<'_>
              ratatui::text::text::Text<'_>
              ratatui::widgets::barchart::BarChart<'_>
            and 12 others
    = note: required for `SizedWrapper<Paragraph<'_>>` to implement `SizedWidgetRef`
note: required by a bound in `Popup`
   --> /home/francesco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-popup-0.3.4/src/popup.rs:29:31
    |
29  | pub struct Popup<'content, W: SizedWidgetRef> {
    |                               ^^^^^^^^^^^^^^ required by this bound in `Popup`

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `flawz` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `flawz v0.2.2`, intermediate artifacts can be found at `/tmp/cargo-installGCxcI6`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Tell me if you need more details.

Thanks

@orhun
Copy link
Owner

orhun commented Aug 6, 2024

Hey @pirafrank, it looks like you're hitting a mismatch between Ratatui and tui-popup versions. Can you try cargo install --locked flawz instead?

@pirafrank
Copy link
Contributor

pirafrank commented Aug 6, 2024

Hey @pirafrank, it looks like you're hitting a mismatch between Ratatui and tui-popup versions. Can you try cargo install --locked flawz instead?

This worked. Thank you.

Edit:

I may PR for the original issue about the missing instructions in readme about libsqlite3-dev then.

@orhun
Copy link
Owner

orhun commented Aug 6, 2024

Please go ahead!

We can also suggest installing via --locked as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants