From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B0BDB61913 for ; Mon, 30 Nov 2020 14:01:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9B28215CE7 for ; Mon, 30 Nov 2020 14:00:42 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id A74B515CDC for ; Mon, 30 Nov 2020 14:00:41 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7676343EEC for ; Mon, 30 Nov 2020 14:00:41 +0100 (CET) Date: Mon, 30 Nov 2020 14:00:34 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: In-Reply-To: MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1606739708.vvpuw8xw39.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] building proxmox-backup-qemu X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2020 13:01:12 -0000 On November 29, 2020 11:20 am, Niko Fellner wrote: > Hi, thanks for your interest! there are unfortunately still some rough edges=20 around building all the pieces that make up PBS.. I hope the following=20 gives you enough information to continue experimenting! > I originally posted this question in #3163#c9, but here my question is be= tter placed: >=20 >> This is because for restore, the binary is actually created from our pat= ched >> QEMU source code which just links against the Rust library, see >> 'pbs-restore.c' in our QEMU sources (i.e. clone pve-qemu repo, then appl= y >> the patches in 'debian/patches/series' to the 'qemu' submodule). >> >=20 >=20 > So if I want to build the "pbs-restore" binary, I need to make "pve-qemu"= : yes, if you want to change the qemu/C part of that binary, and not just=20 the rust part interfaces with PBS directly, which is in=20 proxmox-backup-qemu (libproxmox-backup-qemu0.so). >> cd ~ && git clone git://git.proxmox.com/git/pve-qemu.git && \ >> cd pve-qemu && apt-get install libaio-dev libcap-ng-dev libfdt-dev \ >> libglusterfs-dev libiscsi-dev libjemalloc-dev libjpeg-dev libnuma-dev \ >> libpci-dev libpixman-1-dev librbd-dev libsdl1.2-dev libseccomp-dev \ >> libspice-protocol-dev libspice-server-dev libusb-1.0-0-dev \ >> libusbredirparser-dev texi2html texinfo xfslibs-dev && \ >> mk-build-deps -ir && make >=20 >=20 > Which results in the binaries "/pve-qemu-kvm-5.1.0/pbs-restore" and "pve-= qemu-kvm-5.1.0/debian/pve-qemu-kvm/usr/bin/pbs-restore" (What's their diffe= rence?) the former is the built binary, the latter is where it is put by the=20 install step run as part of building a debian package. if they differ,=20 it's likely because the latter binary is stripped of debugging symbols=20 (which are put into a separate binary package). it basically boils down to: - build - install to tmpdir under debian/.. - do more packaging-related transformations on copy in debian/.. - take files from debian/.. to make .deb packages we do that whole process inside a(nother) temp/build dir ("pve-qemu-kvm-5.1= .0") > Making pve-qemu requires "libproxmox-backup-qemu0". > "libproxmox-backup-qemu0" is either supplied by installing PVE... >=20 >> echo 'deb http://download.proxmox.com/debian/pve buster pvetest' >> \ >> /etc/apt/sources.list.d/proxmox-devel.list && \ >> apt-get update && apt-get dist-upgrade -y && \ >> apt-get install proxmox-ve >=20 >=20 > ... or by building it from source. I am interested about building it myse= lf, of course. I guess this repository is what I need: > https://git.proxmox.com/?p=3Dproxmox-backup-qemu.git;a=3Dsummary yes :) > But when I do ... >=20 >> cd ~ && git clone git://git.proxmox.com/git/proxmox-backup-qemu.git && \ >> cd proxmox-backup-qemu && \ >> # checkout a commit which seems to be compatible for v1.0.3, see #3173#c= 1 \ >> git checkout 1e45883f00ca8b0dd04c84f4ae33752e69cfc5bb && \ >> # need to install PVE too meet the dependencies for the next one: \ >> mk-build-deps -ir && \ >> # I can't meet all dependencies for the next one: \ >> make >=20 >=20 > ...with the "make" I get the following error message: >=20 >> error: no matching package named `cbindgen` found >> location searched: registry `https://github.com/rust-lang/crates.io-inde= x` >> perhaps you meant: bindgen >> required by package `proxmox-backup-qemu v1.0.0 (/root/proxmox-backup-qe= mu)` >> make: *** [Makefile:22: all] Fehler 101 >=20 >=20 > Where do I get "cbindgen" from? What's the correct way to build proxmox-b= ackup-qemu? $ apt install cbindgen (after having enabled our 'devel' repo, which ships our rust toolchain,=20 debcargo, lots of librust-* packages/backports, and some other build/dev=20 releated tools) I just added it to the build-depends as well. proxmox-backup-qemu is a bit special/awkward in that it depends on=20 proxmox-backup (as library), but the packaging of proxmox-backup does=20 not produce a library package that we can properly depend on (that=20 particular refactoring is still on our todo list, as it's quite=20 involved). as a result of this awkwardness, debian/control is rather=20 incomplete and you need to look at Cargo.toml to get the full picture.=20 besides cbindgen, you also need to install the librust-*-dev packages=20 corresponding to the crates mentioned in Cargo.toml, plus those used by=20 the proxmox-backup crate. we're currently in the middle of a breaking change in the proxmox crate=20 (0.8, which is not compatible with 0.7). proxmox-backup in git is=20 already made compatible, so to build proxmox-backup-qemu now you need to=20 point it at proxmox 0.8 and proxmox-backup git (until the next=20 proxmox-backup version is bumped+tagged): diff --git a/Cargo.toml b/Cargo.toml index 7f29d0a..c87bf5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,9 +27,9 @@ lazy_static =3D "1.4" libc =3D "0.2" once_cell =3D "1.3.1" openssl =3D "0.10" -proxmox =3D { version =3D "0.7.0", features =3D [ "sortable-macro", "api-m= acro" ] } -proxmox-backup =3D { git =3D "git://git.proxmox.com/git/proxmox-backup.git= ", tag =3D "v1.0.4" } -#proxmox-backup =3D { path =3D "../proxmox-backup" } +proxmox =3D { version =3D "0.8.0", features =3D [ "sortable-macro", "api-m= acro" ] } +#proxmox-backup =3D { git =3D "git://git.proxmox.com/git/proxmox-backup.gi= t", tag =3D "v1.0.4" } +proxmox-backup =3D { path =3D "../proxmox-backup" } serde_json =3D "1.0" tokio =3D { version =3D "0.2.9", features =3D [ "blocking", "fs", "io-util= ", "macros", "rt-threaded", "signal", "stream", "tcp", "time", "uds" ] } bincode =3D "1.0" with proxmox-backup checked out next to proxmox-backup-qemu hope this helps, if you run into further issues don't hesitate to ask=20 (including full error messages always helps :)) =