proxmox-backup-client: 3.2.2 -> 3.3.2 (#368012)

This commit is contained in:
misuzu
2024-12-31 16:10:18 +02:00
committed by GitHub
6 changed files with 1151 additions and 591 deletions
@@ -0,0 +1,209 @@
From 15345a1ca0a52f2e977361002fe984609704ec90 Mon Sep 17 00:00:00 2001
From: Christoph Heiss <christoph@c8h4.io>
Date: Tue, 24 Dec 2024 17:40:48 +0100
Subject: [PATCH 1/3] cargo: re-route dependencies not available on crates.io
to git repos
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
---
Cargo.toml | 147 ++++++++++-------------------------------------------
1 file changed, 26 insertions(+), 121 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 9354fb17..d2014429 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -42,8 +42,6 @@ members = [
"proxmox-backup-banner",
"proxmox-backup-client",
- "proxmox-file-restore",
- "proxmox-restore-daemon",
"pxar-bin",
]
@@ -112,7 +110,6 @@ pbs-tools = { path = "pbs-tools" }
# regular crates
anyhow = "1.0"
async-trait = "0.1.56"
-apt-pkg-native = "0.3.2"
base64 = "0.13"
bitflags = "2.4"
bytes = "1.0"
@@ -126,7 +123,6 @@ flate2 = "1.0"
foreign-types = "0.3"
futures = "0.3"
h2 = { version = "0.4", features = [ "stream" ] }
-handlebars = "3.0"
hex = "0.4.3"
http = "0.2"
hyper = { version = "0.14", features = [ "full" ] }
@@ -162,139 +158,48 @@ xdg = "2.2"
zstd = { version = "0.12", features = [ "bindgen" ] }
zstd-safe = "6.0"
-[dependencies]
-anyhow.workspace = true
-async-trait.workspace = true
-base64.workspace = true
-bytes.workspace = true
-cidr.workspace = true
-const_format.workspace = true
-crc32fast.workspace = true
-crossbeam-channel.workspace = true
-endian_trait.workspace = true
-futures.workspace = true
-h2.workspace = true
-hex.workspace = true
-http.workspace = true
-hyper.workspace = true
-libc.workspace = true
-log.workspace = true
-nix.workspace = true
-nom.workspace = true
-num-traits.workspace = true
-once_cell.workspace = true
-openssl.workspace = true
-percent-encoding.workspace = true
-regex.workspace = true
-rustyline.workspace = true
-serde.workspace = true
-serde_json.workspace = true
-syslog.workspace = true
-termcolor.workspace = true
-thiserror.workspace = true
-tokio = { workspace = true, features = [ "fs", "io-util", "io-std", "macros", "net", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "time" ] }
-tokio-openssl.workspace = true
-tokio-stream.workspace = true
-tokio-util = { workspace = true, features = [ "codec" ] }
-tracing.workspace = true
-udev.workspace = true
-url.workspace = true
-walkdir.workspace = true
-zstd.workspace = true
-
-#valgrind_request = { git = "https://github.com/edef1c/libvalgrind_request", version = "1.1.0", optional = true }
-
-# proxmox workspace
-proxmox-apt.workspace = true
-proxmox-apt-api-types.workspace = true
-proxmox-async.workspace = true
-proxmox-auth-api = { workspace = true, features = [ "api", "pam-authenticator" ] }
-proxmox-compression.workspace = true
-proxmox-config-digest.workspace = true
-proxmox-daemon.workspace = true
-proxmox-http = { workspace = true, features = [ "client-trait", "proxmox-async", "rate-limited-stream" ] } # pbs-client doesn't use these
-proxmox-human-byte.workspace = true
-proxmox-io.workspace = true
-proxmox-lang.workspace = true
-proxmox-log.workspace = true
-proxmox-ldap.workspace = true
-proxmox-metrics.workspace = true
-proxmox-notify = { workspace = true, features = [ "pbs-context" ] }
-proxmox-openid.workspace = true
-proxmox-rest-server = { workspace = true, features = [ "rate-limited-stream" ] }
-proxmox-router = { workspace = true, features = [ "cli", "server"] }
-proxmox-schema = { workspace = true, features = [ "api-macro" ] }
-proxmox-section-config.workspace = true
-proxmox-serde = { workspace = true, features = [ "serde_json" ] }
-proxmox-shared-cache.workspace = true
-proxmox-shared-memory.workspace = true
-proxmox-sortable-macro.workspace = true
-proxmox-subscription.workspace = true
-proxmox-sys = { workspace = true, features = [ "timer" ] }
-proxmox-systemd.workspace = true
-proxmox-tfa.workspace = true
-proxmox-time.workspace = true
-proxmox-uuid.workspace = true
-proxmox-worker-task.workspace = true
-
-# in their respective repo
-proxmox-acme.workspace = true
-pxar.workspace = true
-
-# proxmox-backup workspace/internal crates
-pbs-api-types.workspace = true
-pbs-buildcfg.workspace = true
-pbs-client.workspace = true
-pbs-config.workspace = true
-pbs-datastore.workspace = true
-pbs-key-config.workspace = true
-pbs-tape.workspace = true
-pbs-tools.workspace = true
-proxmox-rrd.workspace = true
-proxmox-rrd-api-types.workspace = true
-
# Local path overrides
# NOTE: You must run `cargo update` after changing this for it to take effect!
[patch.crates-io]
#proxmox-apt = { path = "../proxmox/proxmox-apt" }
-#proxmox-apt-api-types = { path = "../proxmox/proxmox-apt-api-types" }
-#proxmox-async = { path = "../proxmox/proxmox-async" }
-#proxmox-auth-api = { path = "../proxmox/proxmox-auth-api" }
-#proxmox-borrow = { path = "../proxmox/proxmox-borrow" }
-#proxmox-compression = { path = "../proxmox/proxmox-compression" }
-#proxmox-config-digest = { path = "../proxmox/proxmox-config-digest" }
+proxmox-apt-api-types = { path = "../proxmox/proxmox-apt-api-types" }
+proxmox-async = { path = "../proxmox/proxmox-async" }
+proxmox-auth-api = { path = "../proxmox/proxmox-auth-api" }
+proxmox-borrow = { path = "../proxmox/proxmox-borrow" }
+proxmox-compression = { path = "../proxmox/proxmox-compression" }
+proxmox-config-digest = { path = "../proxmox/proxmox-config-digest" }
#proxmox-daemon = { path = "../proxmox/proxmox-daemon" }
-#proxmox-fuse = { path = "../proxmox-fuse" }
-#proxmox-http = { path = "../proxmox/proxmox-http" }
-#proxmox-human-byte = { path = "../proxmox/proxmox-human-byte" }
-#proxmox-io = { path = "../proxmox/proxmox-io" }
-#proxmox-lang = { path = "../proxmox/proxmox-lang" }
-#proxmox-log = { path = "../proxmox/proxmox-log" }
+proxmox-fuse = { path = "../proxmox-fuse" }
+proxmox-http = { path = "../proxmox/proxmox-http" }
+proxmox-human-byte = { path = "../proxmox/proxmox-human-byte" }
+proxmox-io = { path = "../proxmox/proxmox-io" }
+proxmox-lang = { path = "../proxmox/proxmox-lang" }
+proxmox-log = { path = "../proxmox/proxmox-log" }
#proxmox-ldap = { path = "../proxmox/proxmox-ldap" }
#proxmox-metrics = { path = "../proxmox/proxmox-metrics" }
-#proxmox-notify = { path = "../proxmox/proxmox-notify" }
+proxmox-notify = { path = "../proxmox/proxmox-notify" }
#proxmox-openid = { path = "../proxmox/proxmox-openid" }
#proxmox-rest-server = { path = "../proxmox/proxmox-rest-server" }
-#proxmox-router = { path = "../proxmox/proxmox-router" }
+proxmox-router = { path = "../proxmox/proxmox-router" }
#proxmox-rrd = { path = "../proxmox/proxmox-rrd" }
#proxmox-rrd-api-types = { path = "../proxmox/proxmox-rrd-api-types" }
-#proxmox-schema = { path = "../proxmox/proxmox-schema" }
-#proxmox-section-config = { path = "../proxmox/proxmox-section-config" }
-#proxmox-serde = { path = "../proxmox/proxmox-serde" }
-#proxmox-shared-memory = { path = "../proxmox/proxmox-shared-memory" }
-#proxmox-sortable-macro = { path = "../proxmox/proxmox-sortable-macro" }
+proxmox-schema = { path = "../proxmox/proxmox-schema" }
+proxmox-section-config = { path = "../proxmox/proxmox-section-config" }
+proxmox-serde = { path = "../proxmox/proxmox-serde" }
+proxmox-shared-memory = { path = "../proxmox/proxmox-shared-memory" }
+proxmox-sortable-macro = { path = "../proxmox/proxmox-sortable-macro" }
#proxmox-subscription = { path = "../proxmox/proxmox-subscription" }
-#proxmox-sys = { path = "../proxmox/proxmox-sys" }
-#proxmox-systemd = { path = "../proxmox/proxmox-systemd" }
+proxmox-sys = { path = "../proxmox/proxmox-sys" }
+proxmox-systemd = { path = "../proxmox/proxmox-systemd" }
#proxmox-tfa = { path = "../proxmox/proxmox-tfa" }
-#proxmox-time = { path = "../proxmox/proxmox-time" }
-#proxmox-uuid = { path = "../proxmox/proxmox-uuid" }
-#proxmox-worker-task = { path = "../proxmox/proxmox-worker-task" }
+proxmox-time = { path = "../proxmox/proxmox-time" }
+proxmox-uuid = { path = "../proxmox/proxmox-uuid" }
+proxmox-worker-task = { path = "../proxmox/proxmox-worker-task" }
#proxmox-acme = { path = "../proxmox/proxmox-acme" }
-#pathpatterns = {path = "../pathpatterns" }
-#pxar = { path = "../pxar" }
+pathpatterns = {path = "../pathpatterns" }
+pxar = { path = "../pxar" }
[features]
default = []
--
2.47.0
@@ -1,33 +0,0 @@
From f8c26751c51c1618278689d8b3ce94496c579064 Mon Sep 17 00:00:00 2001
From: Christoph Heiss <christoph@c8h4.io>
Date: Fri, 10 Feb 2023 23:54:41 +0100
Subject: [PATCH] docs: Add target path fixup variable
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
---
docs/Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/docs/Makefile b/docs/Makefile
index 94130228..f4766a64 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -67,12 +67,13 @@ API_VIEWER_FILES := \
SPHINXOPTS =
SPHINXBUILD = sphinx-build
BUILDDIR = output
+RUSTC_TARGET ?=
ifeq ($(BUILD_MODE), release)
-COMPILEDIR := ../target/release
+COMPILEDIR := ../target/$(RUSTC_TARGET)/release
SPHINXOPTS += -t release
else
-COMPILEDIR := ../target/debug
+COMPILEDIR := ../target/$(RUSTC_TARGET)/debug
SPHINXOPTS += -t devbuild
endif
--
2.40.0
@@ -0,0 +1,25 @@
From fbfbc075c7451cda415fc5678cf5bce8bb11dc78 Mon Sep 17 00:00:00 2001
From: Christoph Heiss <christoph@c8h4.io>
Date: Tue, 24 Dec 2024 17:22:35 +0100
Subject: [PATCH 2/3] docs: Add target path fixup variable
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
---
docs/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/Makefile b/docs/Makefile
index 66da6037..a9939131 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -92,6 +92,7 @@ API_VIEWER_FILES := \
SPHINXOPTS = -E
SPHINXBUILD = sphinx-build
BUILDDIR = output
+DEB_HOST_RUST_TYPE ?= $(RUSTC_TARGET)
ifeq ($(BUILD_MODE), release)
COMPILEDIR := ../target/$(DEB_HOST_RUST_TYPE)/release
--
2.47.0
@@ -0,0 +1,26 @@
From 3fc7e2ab65ad6a8af360fafa84b97f551fa1b619 Mon Sep 17 00:00:00 2001
From: Christoph Heiss <christoph@c8h4.io>
Date: Tue, 24 Dec 2024 17:35:40 +0100
Subject: [PATCH 3/3] cargo: use local patched h2 dependency
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
---
Cargo.toml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Cargo.toml b/Cargo.toml
index d2014429..54f951c8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -201,6 +201,8 @@ proxmox-worker-task = { path = "../proxmox/proxmox-worker-task" }
pathpatterns = {path = "../pathpatterns" }
pxar = { path = "../pxar" }
+h2 = { path = "./h2" }
+
[features]
default = []
#valgrind = ["valgrind_request"]
--
2.47.0
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,7 @@
{
lib,
fetchgit,
fetchFromGitHub,
rustPlatform,
pkg-config,
pkgconf,
@@ -12,30 +13,28 @@
git,
installShellFiles,
sphinx,
systemd,
stdenv,
fetchpatch,
testers,
proxmox-backup-client,
versionCheckHook,
}:
let
pname = "proxmox-backup-client";
version = "3.2.2";
version = "3.3.2";
proxmox-backup_src = fetchgit {
url = "git://git.proxmox.com/git/proxmox-backup.git";
rev = "v${version}";
rev = "ed8bc69a50301ad420366d8431a7891b4992408d"; # no version tag unfortunately
name = "proxmox-backup";
hash = "sha256-9rzUGaUoc87VkB4XJUwI0BjuvxdemE6fjTIR7VRp55Y=";
hash = "sha256-0piUftzuK9e8KbOe+bc3SXWa0DlnEgk5iNGWGn4fw7Y=";
};
# Same revision as used in
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=proxmox-backup-client
proxmox_src = fetchgit {
url = "git://git.proxmox.com/git/proxmox.git";
rev = "863d7603403405ccbf8e841b875bf3c9a7a76116";
rev = "df6b705f564ff145faa14770db6493bc5da8cab3";
name = "proxmox";
hash = "sha256-aSBT0TGhmM7QDux4gDY1k4HQhAMNWvxX+IVIsq6KeuM=";
hash = "sha256-6fQVK+G5FMPy+29hScMkvQ+MQQryYs8f8oooq1YGXbg=";
};
proxmox-fuse_src = fetchgit {
@@ -47,9 +46,9 @@ let
proxmox-pxar_src = fetchgit {
url = "git://git.proxmox.com/git/pxar.git";
rev = "675ecff32fbeff0973eaea016c4b8f3877015adb";
rev = "410f326a08ef6c08141af5c7431beb2e16f0c666"; # 0.12.1
name = "pxar";
hash = "sha256-P5fblRCFq7NI1UkP/jkg38bamM1yuJYX+YhCKPgS15Y=";
hash = "sha256-USvtrWTbP3VUiy9MB9Ym6s4wXBNZ4Ooyg4MRDwRVOtU=";
};
proxmox-pathpatterns_src = fetchgit {
@@ -59,7 +58,16 @@ let
hash = "sha256-717XSlvQdvP0Q516fEx04rsrLCk3QI8frTD5NMmkSr4=";
};
aurPatchCommit = "12c04aa14ee09cb3dafcbe193da9d36a6809695d";
# needs a patched version
h2_src = fetchFromGitHub {
name = "h2";
owner = "hyperium";
repo = "h2";
rev = "v0.4.7";
hash = "sha256-GcO4321Jqt1w7jbvQKd0GXIjptyz+tlN2SuxHoBJ/9k=";
};
aurPatchCommit = "6f83f58d54bc7186211d0cfa637c652b13e0dfee";
in
rustPlatform.buildRustPackage {
@@ -71,6 +79,7 @@ rustPlatform.buildRustPackage {
proxmox-fuse_src
proxmox-pxar_src
proxmox-pathpatterns_src
h2_src
];
sourceRoot = proxmox-backup_src.name;
@@ -81,27 +90,32 @@ rustPlatform.buildRustPackage {
# A lot of Rust crates `proxmox-backup-client` depends on are only available through git (or
# Debian packages). This patch redirects all these dependencies to a local, relative path, which
# works in combination with the other three repos being checked out.
(fetchpatch {
name = "0001-re-route-dependencies-not-available-on-crates.io-to-.patch";
url = "https://aur.archlinux.org/cgit/aur.git/plain/0001-re-route-dependencies-not-available-on-crates.io-to-.patch?h=proxmox-backup-client&id=${aurPatchCommit}";
hash = "sha256-YOlC8A1FKIbNY9+q6n/gDV0efHx2i3kwsmIdZcYhf80=";
})
./0001-cargo-re-route-dependencies-not-available-on-crates..patch
# `make docs` assumes that the binaries are located under `target/{debug,release}`, but due
# to how `buildRustPackage` works, they get put under `target/$RUSTC_TARGET/{debug,release}`.
# This patch simply fixes that up.
./0002-docs-Add-target-path-fixup-variable.patch
# Need to use a patched version of the `h2` crate (with a downgraded dependency, see also postPatch).
# This overrides it in the Cargo.toml as needed.
./0003-cargo-use-local-patched-h2-dependency.patch
# This patch prevents the generation of the man-pages for other components inside the repo,
# which would require them too be built too. Thus avoid wasting resources and just skip them.
(fetchpatch {
name = "0002-docs-drop-all-but-client-man-pages.patch";
url = "https://aur.archlinux.org/cgit/aur.git/plain/0002-docs-drop-all-but-client-man-pages.patch?h=proxmox-backup-client&id=${aurPatchCommit}";
hash = "sha256-vUGDBx+g05ipL+boY9DaWDAMmstY1IDZs5nILbCIBLY=";
hash = "sha256-AlIGfJZGaZl2NBVfuFxpDL6bgyvXA2Wcz7UWSrnQa24=";
})
# `make docs` assumes that the binaries are located under `target/{debug,release}`, but due
# to how `buildRustPackage` works, they get put under `target/$RUSTC_TARGET/{debug,release}`.
# This patch simply fixes that up.
./0001-docs-Add-target-path-fixup-variable.patch
];
postPatch = ''
# need to downgrade the `http` crate for `h2`
# see https://aur.archlinux.org/cgit/aur.git/tree/0003-cargo-downgrade-http-to-0.2.12.patch?h=proxmox-backup-client
cp -r ../h2 .
chmod u+w ./h2
(cd h2 && sed -i 's/^http = "1"$/http = "0.2.12"/' Cargo.toml)
cp ${./Cargo.lock} Cargo.lock
rm .cargo/config
rm .cargo/config.toml
'';
postBuild = ''
@@ -152,17 +166,17 @@ rustPlatform.buildRustPackage {
libuuid
acl
libxcrypt
systemd.dev
];
passthru.tests.version = testers.testVersion {
package = proxmox-backup-client;
command = "${pname} version";
};
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = [ "version" ];
meta = with lib; {
description = "Command line client for Proxmox Backup Server";
homepage = "https://pbs.proxmox.com/docs/backup-client.html";
changelog = "https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=debian/changelog;hb=refs/tags/v${version}";
changelog = "https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=debian/changelog;hb=${proxmox-backup_src.rev}";
license = licenses.agpl3Only;
maintainers = with maintainers; [
cofob