The sound distributed version control system

#16 Missing dependency and broken code after cloning from nest.anu.dev

Closed on November 15, 2020
lambda on November 6, 2020

I was able to cargo install anu --version 1.0.0-alpha with no problems.

If I clone the anu repository, and fix up the missing newlines in the Cargo.toml files (see #11, #13, #15), I still get a number of errors when running cargo build. Here is an excerpt:

   Compiling anu v1.0.0-alpha (/var/home/lambda/tmp/anu/anu)
error[E0432]: unresolved import `tempfile`
 --> anu/src/commands/clone.rs:5:5
  |
5 | use tempfile::TempDir;
  |     ^^^^^^^^ use of undeclared type or module `tempfile`

error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
  --> anu/src/commands/archive.rs:77:27
   |
77 |                 let txn = repo.pristine.txn_begin()?;
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `libanu::pristine::sanakirja::GenericTxn<sanakirja::transaction::Txn<std::sync::Arc<sanakirja::transaction::Env>>>`
   |
   = help: the trait `std::ops::Try` is not implemented for `libanu::pristine::sanakirja::GenericTxn<sanakirja::transaction::Txn<std::sync::Arc<sanakirja::transaction::Env>>>`
   = note: required by `std::ops::Try::into_result`

error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
   --> anu/src/remote/mod.rs:245:31
    |
245 |                     let txn = l.pristine.txn_begin()?;
    |                               ^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `libanu::pristine::sanakirja::GenericTxn<sanakirja::transaction::Txn<std::sync::Arc<sanakirja::transaction::Env>>>`
    |
    = help: the trait `std::ops::Try` is not implemented for `libanu::pristine::sanakirja::GenericTxn<sanakirja::transaction::Txn<std::sync::Arc<sanakirja::transaction::Env>>>`
    = note: required by `std::ops::Try::into_result`

error[E0698]: type inside `async fn` body must be known in this context
   --> anu/src/remote/mod.rs:271:21
    |
271 |                 let mut n = 0;
    |                     ^^^^^ cannot infer type for type `{integer}`
    |
note: the type is part of the `async fn` body because of this `await`
   --> anu/src/remote/mod.rs:272:40
    |
272 |                 while let Some(item) = stream.next().await {
    |                                        ^^^^^^^^^^^^^^^^^^^

error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
  --> anu/src/commands/pushpull.rs:31:27
   |
31 |                 let txn = repo.pristine.txn_begin()?;
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `libanu::pristine::sanakirja::GenericTxn<sanakirja::transaction::Txn<std::sync::Arc<sanakirja::transaction::Env>>>`
   |
   = help: the trait `std::ops::Try` is not implemented for `libanu::pristine::sanakirja::GenericTxn<sanakirja::transaction::Txn<std::sync::Arc<sanakirja::transaction::Env>>>`
   = note: required by `std::ops::Try::into_result`

There are a number of repeats of the Try error. The first one is simple enough to fix, by adding the tempfile dependency to Cargo.toml. The others I haven’t figured out yet.

lambda on November 6, 2020

It looks like https://nest.anu.dev/anu/anu/changes/A7JTCA76CNLA3IODP32FEZM7SQKSMAGGGE3AJ3Z6ZIVDUC3AFUMQC was responsible for adding the usage of tempdir without adding it to Cargo.toml.

It looks like https://nest.anu.dev/anu/anu/changes/IPLPLAWCIWB75ZC3D6IAQIFFYYS4DNCTPHOAFMPQWB5SX2ORSG6QC added the ? operator to a number calls to libanu::pristine::sanakirja::Pristine::txn_begin, but without updating txn_begin to return a Result.

pmeunier on November 15, 2020

Hi! Thanks for reporting. This is fixed, apparently, feel free to reopen if not.

pmeunier closed this discussion on November 15, 2020