[SOLVED] Dev env

lperdereau

New Member
Dec 31, 2024
2
0
1
Hey :wave:,

I want to contribute a bit on this project, at least run it on my laptop.
Is there a way to setup the proxmox rust ecosystem ?

I made
Code:
git clone --remote-submodule git://git.proxmox.com/git/proxmox-datacenter-manager.git
git clone git://git.proxmox.com/git/proxmox.git

cd proxmox-datacenter-manager

# Uncomment Cargot.toml [patch.crates-io]


I style have this issue
Code:
$ cargo update
error: failed to get `anyhow` as a dependency of package `server v0.1.10 (~/proxmox-datacenter-manager/server)`

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: /usr/share/cargo/registry

Caused by:
  No such file or directory (os error 2)


Note: I'm on a MacOS M1, my first goal is to build pdmc to run localy and communicate with my PDM instance.

Thanks for you work, PDM rock!
 
Last edited:
Last edited:
  • Like
Reactions: lperdereau
Pretty much, yes. We do not publish any Rust depedencies to crates.io, but only to our development APT repo [1].

[1] deb http://repo.proxmox.com/staging/devel bookworm devel-12
I also just tried to change the number of workers and blocking threads in restore (https://github.com/proxmox/proxmox-...4454a70fc59dc58a19d5edb681/src/restore.rs#L73) to a higher number since that could be a bottleneck why I cannot utilize the full 10 Gbps connection on backup restore from Proxmox Backup Server. However I wasn't able to setup a build environment even when following the documentation. It also seems, I cannot access your repo.proxmox.com repository.

Can somebody from Proxmox provide clear instructions how to setup an environment so the community can engineer quality patches for consideration?
 
I also just tried to change the number of workers and blocking threads in restore (https://github.com/proxmox/proxmox-...4454a70fc59dc58a19d5edb681/src/restore.rs#L73) to a higher number since that could be a bottleneck why I cannot utilize the full 10 Gbps connection on backup restore from Proxmox Backup Server. However I wasn't able to setup a build environment even when following the documentation. It also seems, I cannot access your repo.proxmox.com repository.

Can somebody from Proxmox provide clear instructions how to setup an environment so the community can engineer quality patches for consideration?
I must apologize, I provided the wrong URL. I've edited my original message to include a link to the correct repo.

For a dev environment, you need a Debian Bookworm installation. Add the development repository to your sources.list, followed by an apt update. Clone the repo you want to build, use the mk-build-deps tool (from the devscripts package) to install the build dependencies (e.g. sudo mk-build-deps -ir). After that, you should be able to do a make deb to build the debian package.

Let me know if you need any more help.
 
I must apologize, I provided the wrong URL. I've edited my original message to include a link to the correct repo.

For a dev environment, you need a Debian Bookworm installation. Add the development repository to your sources.list, followed by an apt update. Clone the repo you want to build, use the mk-build-deps tool (from the devscripts package) to install the build dependencies (e.g. sudo mk-build-deps -ir). After that, you should be able to do a make deb to build the debian package.

Let me know if you need any more help.
Thank you that seems to have moved things slightly forward. After a lot of trying, there seem to be some mismatching dependencies.

Code:
error[E0308]: mismatched types
    --> submodules/proxmox-backup/pbs-client/src/http_client.rs:976:38
     |
976  |             H2Client::h2api_response(resp).await?; // raise error
     |             ------------------------ ^^^^ expected `Response<h2::RecvStream>`, found `http::response::Response<h2::RecvStream>`
     |             |
     |             arguments to this function are incorrect
     |
note: two different versions of crate `http` are being used; two types coming from two different versions of the same crate are different types even if they look the same
    --> /usr/share/cargo/registry/http-1.2.0/src/response.rs:180:1
     |
180  | pub struct Response<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^ this is the found type `http::response::Response`
     |
    ::: /usr/share/cargo/registry/http-0.2.11/src/response.rs:179:1
     |
179  | pub struct Response<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^ this is the expected type `Response`
     |
    ::: submodules/proxmox-backup/pbs-client/src/http_client.rs:7:5
     |
7    | use http::header::HeaderValue;
     |     ---- one version of crate `http` used here, as a direct dependency of the current crate
     |
    ::: submodules/proxmox-backup/pbs-client/src/catalog_shell.rs:18:5
     |
18   | use proxmox_router::cli::{self, CliCommand, CliCommandMap, CliHelper, CommandLineInterface};
     |     -------------- one version of crate `http` used here, as a dependency of crate `h2`
     = help: you can use `cargo tree` to explore your dependency tree
 
Looks like the proxmox-backup-qemu repo has not been updated in a while. What you could try is to update the proxmox-backup submodule first:

Code:
cd submodules/proxmox-backup
git pull origin master
# maybe do another sudo mk-build-deps -ir for proxmox-backup as well,
# in case you still have any deps missing

Just tried this out on my development host, here it built fine after updating the submodule.
 
Looks like the proxmox-backup-qemu repo has not been updated in a while. What you could try is to update the proxmox-backup submodule first:

Code:
cd submodules/proxmox-backup
git pull origin master
# maybe do another sudo mk-build-deps -ir for proxmox-backup as well,
# in case you still have any deps missing

Just tried this out on my development host, here it built fine after updating the submodule.
Good catch! The mk-build-deps -ir didn't catch a few dependencies:

Code:
librust-hickory-resolver-dev
librust-proxmox-systemd-dev
# = note: /usr/bin/ld: cannot find -lsystemd: No such file or directory
libsystemd-dev

But in the end this worked to build and install the package so thank you!