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

Compilation error #64

Closed
kinire98 opened this issue Feb 8, 2024 · 2 comments
Closed

Compilation error #64

kinire98 opened this issue Feb 8, 2024 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kinire98
Copy link
Contributor

kinire98 commented Feb 8, 2024

I'm trying to use only the sync api, because I don't need the async one. So I don't want to pull the async runtime, and I copied the following content in my Cargo.toml, as the Docs.rs page said:
cacache = { version = "12.0.0", default-features = false, features = ["mmap"] }
And I got the following error log:

error[E0433]: failed to resolve: could not find `async_lib` in the crate root
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/index.rs:426:20
    |
426 |             crate::async_lib::remove_file(&bucket)
    |                    ^^^^^^^^^ could not find `async_lib` in the crate root

error[E0425]: cannot find function `find_async` in module `index`
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/get.rs:329:37
    |
329 |         if let Some(entry) = index::find_async(cache, key).await? {
    |                                     ^^^^^^^^^^ not found in `index`
    |
note: found an item that was configured out
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/index.rs:179:14
    |
179 | pub async fn find_async(cache: &Path, key: &str) -> Result<Option<Metadata>> {
    |              ^^^^^^^^^^

error[E0425]: cannot find function `find_async` in module `index`
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/get.rs:365:37
    |
365 |         if let Some(entry) = index::find_async(cache, key).await? {
    |                                     ^^^^^^^^^^ not found in `index`
    |
note: found an item that was configured out
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/index.rs:179:14
    |
179 | pub async fn find_async(cache: &Path, key: &str) -> Result<Option<Metadata>> {
    |              ^^^^^^^^^^

error[E0425]: cannot find function `open_async` in this scope
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/content/read.rs:166:22
    |
166 |     let mut reader = open_async(cache, sri.clone()).await?;
    |                      ^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `AsyncReadExt`
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/content/read.rs:169:20
    |
169 |         let read = AsyncReadExt::read(&mut reader, &mut buf)
    |                    ^^^^^^^^^^^^ use of undeclared type `AsyncReadExt`

error[E0425]: cannot find function `delete_async` in this scope
   --> /home/kinire98/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cacache-12.0.0/src/index.rs:423:13
    |
423 |             delete_async(cache.as_ref(), key.as_ref()).await
    |             ^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0425, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `cacache` (lib) due to 6 previous errors

This is the neofetch information of my PC if it is useful:

                     ./o.                  
                   ./sssso-                ------------------ 
                 `:osssssss+-              OS: EndeavourOS Linux x86_64 
               `:+sssssssssso/.            Host: GF63 Thin 10SCSR REV:1.0 
             `-/ossssssssssssso/.          Kernel: 6.6.10-arch1-1 
           `-/+sssssssssssssssso+:`        Uptime: 4 hours, 36 mins 
         `-:/+sssssssssssssssssso+/.       Packages: 1085 (pacman), 8 (snap) 
       `.://osssssssssssssssssssso++-      Shell: bash 5.2.21 
      .://+ssssssssssssssssssssssso++:     Resolution: 1920x1080, 1920x1080 
    .:///ossssssssssssssssssssssssso++:    DE: Xfce 4.18 
  `:////ssssssssssssssssssssssssssso+++.   WM: Xfwm4 
`-////+ssssssssssssssssssssssssssso++++-   WM Theme: Default 
 `..-+oosssssssssssssssssssssssso+++++/`   Theme: Adwaita-dark [GTK2], Arc-Dark [GTK3] 
   ./++++++++++++++++++++++++++++++/:.     Icons: Qogir-dark [GTK2/3] 
  `:::::::::::::::::::::::::------``       Terminal: xfce4-terminal 
                                           Terminal Font: Source Code Pro 10 
                                           CPU: Intel i7-10750H (12) @ 5.000GHz 
                                           GPU: Intel CometLake-H GT2 [UHD Graphics] 
                                           GPU: NVIDIA GeForce GTX 1650 Ti Mobile 
                                           Memory: 4150MiB / 31917MiB 

I don't know if I have to change something for it to work. If I just write:
cacache = "12.0.0"
works normally, but imports the whole async runtime.

@zkat
Copy link
Owner

zkat commented Feb 8, 2024

Looks like we neglected to flag some methods as being async-only. For example, https://github.com/zkat/cacache-rs/blob/main/src/index.rs#L417-L431 should have a line like https://github.com/zkat/cacache-rs/blob/main/src/index.rs#L353 on it.

How would you feel about going through these errors and feature flagging the appropriate straggler async methods? It seems to only be a couple of them.

@zkat zkat added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Feb 8, 2024
@kinire98
Copy link
Contributor Author

kinire98 commented Feb 9, 2024

Ok, I could look them up. I don't usually contribute to open source a lot. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants