Cannot "cargo build" proxmox-backup-server

I am trying to build proxmox-backup-server code.

I have cloned:


> git clone https://git.proxmox.com/git/proxmox-backup.git

and tried to build:

cargo build

this is the error it gives:

D:\rust\proxmox-backup>cargo build
error: failed to get anyhow as a dependency of package pbs-api-types v0.1.0 (D:\rust\proxmox-backup\pbs-api-types)

Caused by:
failed to load source for dependency anyhow

Caused by:
Unable to update registry crates-io

Caused by:
failed to update replaced source registry crates-io

Caused by:
failed to read root of directory source: D:\usr\share\cargo\registry

Caused by:
The system cannot find the path specified. (os error 3)

I am new to rust, I have setup the environment in vs code, and able to cargo build and cargo run the hello world application which is created with the cargo new command.

What is this 'anyhow' error and how to resolve it?

Steps taken:

  1. The directory it is asking to read (D:\usr\share\cargo\registry) didn't exist, so I created it, it didn't help
  2. Stackoverflow says to delete the .cargo\registry, turns out that no such directory exists.

Check if you have CARGO_HOME env var set. echo %CARGO_HOME%. Unset it if it is.

Alternatively, reinstall Rust by running:

rustup self uninstall

and follow install instructions on https://rustup.rs