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

unable to compile leetcode_tui #8

Open
HyperAfnan opened this issue Oct 12, 2024 · 4 comments
Open

unable to compile leetcode_tui #8

HyperAfnan opened this issue Oct 12, 2024 · 4 comments

Comments

@HyperAfnan
Copy link

HyperAfnan commented Oct 12, 2024

hey ive be trying to install your tui on my android tablet within termux but i've been getting issues trying to compile native_db saying there is no Database_Builder in my root i tried to add native_model coz native_db does not work without it (written in native_db docs )
but nothing changed

this is the error i am getting

   Compiling better-panic v0.3.0
   Compiling human-panic v1.2.3
   Compiling clap v4.5.20
   Compiling leetcode-tui-shared v0.4.0
   Compiling serde_with_macros v3.11.0
   Compiling strip-ansi-escapes v0.2.0
   Compiling directories v5.0.1
   Compiling strum_macros v0.26.4
   Compiling serde_with v3.11.0
   Compiling html2text v0.12.5
   Compiling async-trait v0.1.83
   Compiling strum v0.26.3
   Compiling lru v0.12.5
   Compiling futures-executor v0.3.31
   Compiling fuzzy-matcher v0.3.7
   Compiling terminal_size v0.3.0
   Compiling kdam v0.5.2
   Compiling futures v0.3.31
   Compiling leetcode-tui-config v0.4.0
error[E0432]: unresolved import `native_db::Database_Builder`
 --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/leetcode-tui-config-0.4.0/src/clients.rs:3:27
  |
3 | use native_db::{Database, Database_Builder};
  |                           ^^^^^^^^^^^^^^^^
  |                           |
  |                           no `Database_Builder` in the root
  |                           help: a similar name exists in the module: `database_builder`

error[E0432]: unresolved import `native_db::Database_Builder`
  --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/leetcode-tui-config-0.4.0/src/lib.rs:12:5
   |
12 | use native_db::Database_Builder;
   |     ^^^^^^^^^^^----------------
   |     |          |
   |     |          help: a similar name exists in the module: `database_builder`
   |     no `Database_Builder` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `leetcode-tui-config` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `leetcode-tui-rs v0.4.0`, intermediate artifacts can be found at `/data/data/com.termux/files/home/.local/share/cargo/`.

can you help me fix this error

@dddictionary
Copy link

I've been getting this error too.

On WSL2 Ubuntu.
rustc version: 1.82.0
cargo version: 1.82.0

Any ideas?

@akarsh1995
Copy link
Owner

Could you checkout to this commit and try

3fc1931f29ac40ad68ff405c60a4a8f2ef6ba3f0

@dddictionary
Copy link

I did cargo run and it compiled fine. I uploaded by tokens into the config.toml file. When I do cargo run again, I get this error:

Backtrace (most recent call last):
  File "/home/shiro/probe/leetcode-tui/leetcode-tui-rs/src/main.rs:16", in leetui::main
    App::run().await
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/runtime.rs:349", in tokio::runtime::runtime::Runtime::block_on
    Scheduler::MultiThread(exec) => exec.block_on(&self.handle.inner, future),
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/scheduler/multi_thread/mod.rs:86", in tokio::runtime::scheduler::multi_thread::MultiThread::block_on
    crate::runtime::context::enter_runtime(handle, true, |blocking| {
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/context/runtime.rs:65", in tokio::runtime::context::runtime::enter_runtime
    return f(&mut guard.blocking);
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/scheduler/multi_thread/mod.rs:87", in tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
    blocking.block_on(future).expect("failed to park thread")
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/context/blocking.rs:66", in tokio::runtime::context::blocking::BlockingRegionGuard::block_on
    park.block_on(f)
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/park.rs:282", in tokio::runtime::park::CachedParkThread::block_on
    if let Ready(v) = crate::runtime::coop::budget(|| f.as_mut().poll(&mut cx)) {
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/coop.rs:73", in tokio::runtime::coop::budget
    with_budget(Budget::initial(), f)
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/coop.rs:107", in tokio::runtime::coop::with_budget
    f()
  File "/home/shiro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/park.rs:282", in tokio::runtime::park::CachedParkThread::block_on::{{closure}}
    if let Ready(v) = crate::runtime::coop::budget(|| f.as_mut().poll(&mut cx)) {
  File "/home/shiro/probe/leetcode-tui/leetcode-tui-rs/src/main.rs:12", in leetui::main::{{closure}}
    leetcode_tui_core::init();
  File "/home/shiro/probe/leetcode-tui/leetcode-tui-core/src/lib.rs:34", in leetcode_tui_core::init
    content::question::init();
  File "/home/shiro/probe/leetcode-tui/leetcode-tui-core/src/content/question/sol_dir.rs:15", in leetcode_tui_core::content::question::sol_dir::init
    SOLUTION_FILE_MANAGER
  File "rust:library/std/src/sync/once_lock.rs:304", in std::sync::once_lock::OnceLock<T>::get_or_init
  File "rust:library/std/src/sync/once_lock.rs:390", in std::sync::once_lock::OnceLock<T>::get_or_try_init
  File "rust:library/std/src/sync/once_lock.rs:510", in std::sync::once_lock::OnceLock<T>::initialize
  File "rust:library/std/src/sync/once.rs:217", in std::sync::once::Once::call_once_force
  File "rust:library/std/src/sys/sync/once/futex.rs:168", in std::sys::sync::once::futex::Once::call
  File "rust:library/std/src/sync/once.rs:217", in std::sync::once::Once::call_once_force::{{closure}}
  File "rust:library/std/src/sync/once_lock.rs:511", in std::sync::once_lock::OnceLock<T>::initialize::{{closure}}
  File "rust:library/std/src/sync/once_lock.rs:304", in std::sync::once_lock::OnceLock<T>::get_or_init::{{closure}}
  File "/home/shiro/probe/leetcode-tui/leetcode-tui-core/src/content/question/sol_dir.rs:16", in leetcode_tui_core::content::question::sol_dir::init::{{closure}}
    .get_or_init(|| RwLock::new(CONFIG.as_ref().solutions_dir.clone().try_into().unwrap()));
  File "rust:library/core/src/result.rs:1102", in core::result::Result<T,E>::unwrap

The application panicked (crashed).
  called `Result::unwrap()` on an `Err` value: IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
in leetcode-tui-core/src/content/question/sol_dir.rs:16
thread: main

@HyperAfnan
Copy link
Author

Could you checkout to this commit and try

3fc1931f29ac40ad68ff405c60a4a8f2ef6ba3f0

It's still showing the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants