all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] building proxmox-backup-qemu
Date: Mon, 30 Nov 2020 14:00:34 +0100	[thread overview]
Message-ID: <1606739708.vvpuw8xw39.astroid@nora.none> (raw)
In-Reply-To: <AM0PR09MB2754FB20BC915616FD63E80EF2F60@AM0PR09MB2754.eurprd09.prod.outlook.com>

On November 29, 2020 11:20 am, Niko Fellner wrote:
> Hi,

thanks for your interest! there are unfortunately still some rough edges 
around building all the pieces that make up PBS.. I hope the following 
gives you enough information to continue experimenting!

> I originally posted this question in #3163#c9, but here my question is better placed:
> 
>> This is because for restore, the binary is actually created from our patched
>> 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 apply
>> the patches in 'debian/patches/series' to the 'qemu' submodule).
>>
> 
> 
> 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 
the rust part interfaces with PBS directly, which is in 
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
> 
> 
> 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 difference?)

the former is the built binary, the latter is where it is put by the 
install step run as part of building a debian package. if they differ, 
it's likely because the latter binary is stripped of debugging symbols 
(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...
> 
>> 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
> 
> 
> ... or by building it from source. I am interested about building it myself, of course. I guess this repository is what I need:
> https://git.proxmox.com/?p=proxmox-backup-qemu.git;a=summary

yes :)

> But when I do ...
> 
>> 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#c1 \
>> 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
> 
> 
> ...with the "make" I get the following error message:
> 
>> error: no matching package named `cbindgen` found
>> location searched: registry `https://github.com/rust-lang/crates.io-index`
>> perhaps you meant: bindgen
>> required by package `proxmox-backup-qemu v1.0.0 (/root/proxmox-backup-qemu)`
>> make: *** [Makefile:22: all] Fehler 101
> 
> 
> Where do I get "cbindgen" from? What's the correct way to build proxmox-backup-qemu?

$ apt install cbindgen

(after having enabled our 'devel' repo, which ships our rust toolchain, 
debcargo, lots of librust-* packages/backports, and some other build/dev 
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 
proxmox-backup (as library), but the packaging of proxmox-backup does 
not produce a library package that we can properly depend on (that 
particular refactoring is still on our todo list, as it's quite 
involved). as a result of this awkwardness, debian/control is rather 
incomplete and you need to look at Cargo.toml to get the full picture. 
besides cbindgen, you also need to install the librust-*-dev packages 
corresponding to the crates mentioned in Cargo.toml, plus those used by 
the proxmox-backup crate.

we're currently in the middle of a breaking change in the proxmox crate 
(0.8, which is not compatible with 0.7). proxmox-backup in git is 
already made compatible, so to build proxmox-backup-qemu now you need to 
point it at proxmox 0.8 and proxmox-backup git (until the next 
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 = "1.4"
 libc = "0.2"
 once_cell = "1.3.1"
 openssl = "0.10"
-proxmox = { version = "0.7.0", features = [ "sortable-macro", "api-macro" ] }
-proxmox-backup = { git = "git://git.proxmox.com/git/proxmox-backup.git", tag = "v1.0.4" }
-#proxmox-backup = { path = "../proxmox-backup" }
+proxmox = { version = "0.8.0", features = [ "sortable-macro", "api-macro" ] }
+#proxmox-backup = { git = "git://git.proxmox.com/git/proxmox-backup.git", tag = "v1.0.4" }
+proxmox-backup = { path = "../proxmox-backup" }
 serde_json = "1.0"
 tokio = { version = "0.2.9", features = [ "blocking", "fs", "io-util", "macros", "rt-threaded", "signal", "stream", "tcp", "time", "uds" ] }
 bincode = "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 
(including full error messages always helps :))




  reply	other threads:[~2020-11-30 13:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 10:20 Niko Fellner
2020-11-30 13:00 ` Fabian Grünbichler [this message]
2020-11-30 19:11 Niko Fellner
2020-12-01 10:04 ` Fabian Grünbichler
2020-12-02 19:55 Niko Fellner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1606739708.vvpuw8xw39.astroid@nora.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal