How to build proxmox rust parts?

Nov 22, 2020
80
11
13
51
Hi,

In order to work on https://bugzilla.proxmox.com/show_bug.cgi?id=2370#c17 starting with a PVE 8.2 system I was able to rebuild proxmox-firewall program as follows:

Code:
echo "deb http://download.proxmox.com/debian/devel bookworm main" >> /etc/apt/sources.list
apt-get update
apt-get dist-upgrade
apt-get install git emacs-nox debcargo cargo
apt-get install librust-anyhow-dev librust-nix-dev librust-proxmox-schema-dev librust-proxmox-sys-dev librust-proxmox-sortable-macro-dev librust-proxmox-serde_plain librust-serde-plain-dev librust-serde-with-dev librust-thiserror-dev librust-env-logger-dev librust-signal-hook-dev librust-insta-dev
git clone git://git.proxmox.com/git/proxmox-firewall.git
cd proxmox-firewall
cargo build
cp ./target/debug/proxmox-firewall ...

A few questions:

- I could not find a reference giving the above instructions, may be I missed something? The wiki page https://pve.proxmox.com/wiki/Developer_Documentation#Rust has no build instructions.
- Is there a debian/proxmox tool to apt-get install all the librust-*-dev pakages from a Cargo.toml ?
- make test works but make deb fails the testing part and so does not produce .deb files, not sure how to fix that.

Thanks!
 
  • Like
Reactions: Gilou
- Is there a debian/proxmox tool to apt-get install all the librust-*-dev pakages from a Cargo.toml ?
You should be able to run mk-build-deps --install in order to install all the required packages (including cargo, ...) for a given project. This command is included in devscripts (see below).

The only packages you could need besides the ones installed via mk-build-deps can be installed via the following command:

Code:
apt install build-essential devscripts git


- make test works but make deb fails the testing part and so does not produce .deb files, not sure how to fix that.
That seems a bit odd, do you have the output for the failed test runs? We have a snapshot testing tool for the firewall, so if something changes with the generated firewall commands one has to update the snapshots used for the integration tests (via cargo insta review). That's the only thing I could imagine failing, but I could be missing something.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!