Compiling proxmox.git encountered error: 'The toolchain system in /root/proxmox/build/rust-toolchain is customized and not installed.'

kknd0

New Member
Dec 29, 2023
5
0
1
I'm trying to compile proxmox.git but I'm having problems with it

Here's how I did it


Bash:
echo 'deb http://download.proxmox.com/debian/devel/ bookworm main' | tee /etc/apt/sources.list.d/proxmox-devel.list

wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg

apt update

apt install -y devscripts debcargo clang


Installation of relevant compilation environments

Bash:
apt install -y devscripts  build-essential librust-openssl-sys-dev git git-email pkg-config debhelper pve-doc-generator  \
cmake bison dwarves flex libdw-dev libelf-dev libiberty-dev lz4 zstd librados-dev \
libtest-mockmodule-perl  check libcmap-dev libcorosync-common-dev libcpg-dev libfuse-dev \
libglib2.0-dev libpve-access-control libpve-apiclient-perl libquorum-dev librrd-dev librrds-perl \
libsqlite3-dev libtest-mockmodule-perl libuuid-perl rrdcached sqlite3  rsync \
libauthen-pam-perl libnet-ldap-perl  libpve-cluster-perl pve-cluster \
libjs-marked pve-eslint esbuild quilt   bash-completion dh-apparmor docbook2x libapparmor-dev libcap-dev \
libgnutls28-dev libseccomp-dev meson  libarchive-dev   libanyevent-perl   dh-python python3-all python3-setuptools python3-docutils \
liblocale-po-perl  help2man libpam0g-dev  libpve-storage-perl lxc-pve  \
libjpeg62-turbo-dev libpng-dev unifont  libspice-protocol-dev libspice-server-dev  libcap-ng-dev \
libio-multiplex-perl libjson-c-dev libpve-guest-common-perl libpve-storage-perl pve-edk2-firmware pve-firewall pve-ha-manager \
libposix-strptime-perl librados2-perl pve-qemu-kvm   zfsutils-linux \
libacl1-dev libaio-dev libattr1-dev libcap-ng-dev  libepoxy-dev libfdt-dev libgbm-dev libglusterfs-dev libiscsi-dev  libjemalloc-dev libjpeg-dev \
libnuma-dev libpixman-1-dev libproxmox-backup-qemu0-dev  librbd-dev \
libsdl1.2-dev  liburing-dev libusb-1.0-0-dev libusbredirparser-dev \
libvirglrenderer-dev libzstd-dev python3-sphinx python3-sphinx-rtd-theme texi2html xfslibs-dev \
abigail-tools  libpam0g-dev python3-cffi python3-all-dev


Installing the rust toolchain
Bash:
apt install -y cargo rustc

curl https://sh.rustup.rs -sSf | sh

rustup toolchain install nightly

cp -a ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/ ~/.rustup/toolchains/system

rustup default system


Get the source code and compile it
Bash:
git clone git://git.proxmox.com/git/proxmox.git

cd proxmox

make deb


Then I get this error

Bash:
   Doc-tests proxmox_access_control
     Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=proxmox_access_control CARGO_MANIFEST_DIR=/root/proxmox/build/proxmox-access-control CARGO_MANIFEST_PATH=/root/proxmox/build/proxmox-access-control/Cargo.toml CARGO_PKG_AUTHORS='Proxmox Support Team <support@proxmox.com>' CARGO_PKG_DESCRIPTION='A collection of utilities to implement access control management.' CARGO_PKG_HOMEPAGE='https://proxmox.com' CARGO_PKG_LICENSE=AGPL-3 CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=proxmox-access-control CARGO_PKG_README='' CARGO_PKG_REPOSITORY='https://git.proxmox.com/?p=proxmox.git' CARGO_PKG_RUST_VERSION=1.80 CARGO_PKG_VERSION=0.2.4 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=4 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH=/root/proxmox/build/proxmox-access-control/target/debug/deps rustdoc --edition=2021 --crate-type lib --color auto --crate-name proxmox_access_control --test src/lib.rs --test-run-directory /root/proxmox/build/proxmox-access-control --target x86_64-unknown-linux-gnu -L dependency=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/root/proxmox/build/proxmox-access-control/target/debug/deps --extern anyhow=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libanyhow-3b6ac37815c02b55.rlib --extern proxmox_access_control=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_access_control-fd810846cc1b2c4a.rlib --extern proxmox_auth_api=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_auth_api-2ca242245a11b087.rlib --extern proxmox_schema=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_schema-599f430af6908d57.rlib --extern proxmox_time=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_time-bb8d0de5c5b77cca.rlib --extern serde=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libserde-a33eb5c39dd83c61.rlib -C embed-bitcode=no --cfg 'feature="default"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("default", "impl"))' --error-format human`
error: Toolchain system in /root/proxmox/build/rust-toolchain is custom and not installed

Stack backtrace:
   0: anyhow::kind::Adhoc::new
   1: rustup::config::Cfg::find_override_config
   2: rustup::config::Cfg::find_or_install_override_toolchain_or_default
   3: rustup::cli::proxy_mode::main
   4: rustup_init::main
   5: std::sys_common::backtrace::__rust_begin_short_backtrace
   6: main
   7: <unknown>
   8: __libc_start_main
   9: <unknown>
error: doctest failed, to rerun pass `--doc`

Caused by:
  process didn't exit successfully: `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=proxmox_access_control CARGO_MANIFEST_DIR=/root/proxmox/build/proxmox-access-control CARGO_MANIFEST_PATH=/root/proxmox/build/proxmox-access-control/Cargo.toml CARGO_PKG_AUTHORS='Proxmox Support Team <support@proxmox.com>' CARGO_PKG_DESCRIPTION='A collection of utilities to implement access control management.' CARGO_PKG_HOMEPAGE='https://proxmox.com' CARGO_PKG_LICENSE=AGPL-3 CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=proxmox-access-control CARGO_PKG_README='' CARGO_PKG_REPOSITORY='https://git.proxmox.com/?p=proxmox.git' CARGO_PKG_RUST_VERSION=1.80 CARGO_PKG_VERSION=0.2.4 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=4 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH=/root/proxmox/build/proxmox-access-control/target/debug/deps rustdoc --edition=2021 --crate-type lib --color auto --crate-name proxmox_access_control --test src/lib.rs --test-run-directory /root/proxmox/build/proxmox-access-control --target x86_64-unknown-linux-gnu -L dependency=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/root/proxmox/build/proxmox-access-control/target/debug/deps --extern anyhow=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libanyhow-3b6ac37815c02b55.rlib --extern proxmox_access_control=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_access_control-fd810846cc1b2c4a.rlib --extern proxmox_auth_api=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_auth_api-2ca242245a11b087.rlib --extern proxmox_schema=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_schema-599f430af6908d57.rlib --extern proxmox_time=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libproxmox_time-bb8d0de5c5b77cca.rlib --extern serde=/root/proxmox/build/proxmox-access-control/target/x86_64-unknown-linux-gnu/debug/deps/libserde-a33eb5c39dd83c61.rlib -C embed-bitcode=no --cfg 'feature="default"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("default", "impl"))' --error-format human` (exit status: 1)
note: test exited abnormally; to see the full output pass --nocapture to the harness.
dh_auto_test: error: /usr/share/cargo/bin/cargo test --all returned exit code 1
make[2]: *** [debian/rules:6: override_dh_auto_test] Error 255
make[2]: Leaving directory '/root/proxmox/build/proxmox-access-control'
make[1]: *** [debian/rules:3: binary] Error 2
make[1]: Leaving directory '/root/proxmox/build/proxmox-access-control'
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make: *** [Makefile:30: proxmox-access-control-deb] Error 2


It says. error: Toolchain system in /root/proxmox/build/rust-toolchain is custom and not installed

But I think it's already installed.

Bash:
root@pve:~/proxmox# rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /root/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
system (default)

active toolchain
----------------

system (default)
rustc 1.86.0-nightly (a730edcd6 2025-01-30)

The reason I want to compile the project is that I added the PVE mirror source, but WebUI still says: No Proxmox VE repository is enabled, you do not get any updates!
I want to fix it!


1738508269824.png

Then I investigated and found out that it's the one that determines if a PVE source has been added or not, and I'd like to modify it

https://github.com/proxmox/proxmox-rs/blob/master/proxmox-apt/src/repositories/standard.rs#L147
1738508440194.png

What is this libpve_rs.so though, in the course of my investigation I found that it also contains links to the PVE sources
Bash:
root@pve:~/# grep -r "http://download.proxmox.com/debian" /usr/lib/x86_64-linux-gnu/perl5/
grep: /usr/lib/x86_64-linux-gnu/perl5/5.36/auto/libpve_rs.so: binary file matches

root@pve:~/# grep -r "http://download.proxmox.com/debian/pve" /usr/lib/x86_64-linux-gnu/perl5/
grep: /usr/lib/x86_64-linux-gnu/perl5/5.36/auto/libpve_rs.so: binary file matches

The source code for libpve_rs.so is in this project https://git.proxmox.com/?p=proxmox-perl-rs.git;a=summary
Bash:
git clone git://git.proxmox.com/git/proxmox-perl-rs.git

cd proxmox-perl-rs/

root@pve:~/proxmox-perl-rs# tree -L 2 .
.
├── common
│   ├── pkg
│   └── src
├── pmg-rs
│   ├── Cargo.toml
│   ├── common -> ../common
│   ├── debian
│   ├── Fixup.pm
│   ├── Makefile
│   ├── src
│   └── test.pl
├── pve-rs
│   ├── Cargo.toml
│   ├── common -> ../common
│   ├── debian
│   ├── Fixup.pm
│   ├── Makefile
│   ├── src
│   └── test
└── README.md

13 directories, 8 files

root@pve:~/proxmox-perl-rs# cd pve-rs && rm -r .cargo

root@pve:~/proxmox-perl-rs/pve-rs# cargo build --release
    Updating crates.io index
error: no matching package named `perlmod` found
location searched: crates.io index
required by package `pve-rs v0.9.1 (/root/proxmox-perl-rs/pve-rs)`
 
Hi!

Sorry for the delay. I hope you have found the solution to the problem already. Either way, I wanted to add some context here.

It says. error: Toolchain system in /root/proxmox/build/rust-toolchain is custom and not installed

But I think it's already installed.
Proxmox projects are based on Debian and since there Rust crates are packaged, we do so too.

Therefore, we do use rustup to install the rust toolchain, but rustc, cargo, etc. packages, so that the toolchain versions are upgraded over the same package manager as all other packages. The same applies for crates and their features, which are also packaged as individual packages, e.g. librust-serde-1+default-dev and librust-proxmox-sys-0.6+default-dev.

What is this libpve_rs.so though, in the course of my investigation I found that it also contains links to the PVE sources
This is correct!

The libpve_rs.so file is a shared object file, which is used so that the Perl code of Proxmox VE is able to run code written in Rust as we favor to write new functionality in Rust. This shared object is built by perlmod, which creates the shared object and the bindings for Perl.