snarkOS: [Bug] compiling snarkvm-ledger-store fails with error snarkvm-ledger-store

πŸ› Bug Report

Executing ./build_ubuntu.sh fails with the following error. I did not find a similar report, so filing a new one

error[E0308]: mismatched types
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/snarkvm-ledger-store-0.16.11/src/helpers/rocksdb/internal/mod.rs:113:69
    |
113 |                 let primary = aleo_std::aleo_ledger_dir(network_id, dev);
    |                               -------------------------             ^^^ expected `StorageMode`, found `Option<u16>`
    |                               |
    |                               arguments to this function are incorrect
    |
    = note: expected enum `StorageMode`
               found enum `std::option::Option<u16>`
note: function defined here
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aleo-std-storage-0.1.7/src/lib.rs:89:8
    |
89  | pub fn aleo_ledger_dir(network: u16, mode: StorageMode) -> PathBuf {
    |        ^^^^^^^^^^^^^^^
help: call `Into::into` on this expression to convert `std::option::Option<u16>` into `StorageMode`
    |
113 |                 let primary = aleo_std::aleo_ledger_dir(network_id, dev.into());
    |                                                                        +++++++

Steps to Reproduce

git clone https://github.com/AleoHQ/snarkOS.git --depth 1 cd snarkOS ./build_ubuntu.sh

Expected Behavior

Compilation should work successfully

Your Environment

  • v2.2.5
  • rustc 1.75.0
  • Ubuntu 22.04.3 LTS

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 1
  • Comments: 24 (7 by maintainers)

Most upvoted comments

Executing ./build_ubuntu.sh after doing this fix fails with the following error:

Compiling aleo-std v0.1.18 error[E0432]: unresolved imports aleo_std_storage::aleo_operator_dir, aleo_st d_storage::aleo_prover_dir –> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aleo-std-0.1.18 /src/lib.rs:21:55 | 21 | …_ledger_dir, aleo_operator_dir, aleo_prover_dir}; | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ | | | | | no aleo_prover_dir in the root | | help: a similar name exists in the modul e: aleo_ledger_dir | no aleo_operator_dir in the root

error[E0432]: unresolved imports aleo_std_storage::aleo_operator_dir, aleo_st d_storage::aleo_prover_dir –> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aleo-std-0.1.18 /src/lib.rs:28:59 | 28 | …_ledger_dir, aleo_operator_dir, aleo_prover_dir}; | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ | | | | | no aleo_prover_dir in the root | | help: a similar name exists in the modul e: aleo_ledger_dir | no aleo_operator_dir in the root | = help: consider importing this unresolved item through its public re-export instead: crate::aleo_operator_dir = help: consider importing this unresolved item through its public re-export instead: crate::aleo_prover_dir

For more information about this error, try rustc --explain E0432. error: could not compile aleo-std (lib) due to 2 previous errors warning: build failed, waiting for other jobs to finish… error: failed to compile snarkos v2.2.7 (/root/snarkOS), intermediate artifact s can be found at /root/snarkOS/target. To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

The PR above updates the code to the API change, but @ljedrz change may be safer until @howardwu can look at the PR.

@osirisss11 git pull

@jhdi The warnings are not breakages, please understand the differences before filing a complaint.

@ljedrz can you evaluate each of the remove cases and decide whether shift or swap is necessary?