From f6e0762cc059f66fd6bf4b97096f630771e801b3 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 6 Jun 2025 14:30:19 +0200 Subject: [PATCH 1/4] proxmox-backup-client: use correct value for RUSTC_TARGET Signed-off-by: Christoph Heiss --- pkgs/by-name/pr/proxmox-backup-client/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/pr/proxmox-backup-client/package.nix b/pkgs/by-name/pr/proxmox-backup-client/package.nix index e19b41c293c6..8350bd9f1684 100644 --- a/pkgs/by-name/pr/proxmox-backup-client/package.nix +++ b/pkgs/by-name/pr/proxmox-backup-client/package.nix @@ -118,7 +118,7 @@ rustPlatform.buildRustPackage { postBuild = '' make -C docs \ DEB_VERSION=${version} DEB_VERSION_UPSTREAM=${version} \ - RUSTC_TARGET=${stdenv.hostPlatform.config} \ + RUSTC_TARGET=${stdenv.targetPlatform.rust.rustcTarget} \ BUILD_MODE=release \ proxmox-backup-client.1 pxar.1 ''; From 2dc044b8f82912b85c0ae25a9f41042a5f64a2ed Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 6 Jun 2025 17:35:42 +0200 Subject: [PATCH 2/4] proxmox-backup-client: avoid `git` as buildInput The build script of the `pbs-buildcfg` crate either uses `REPOID` from the environment or runs `git rev-parse HEAD`. The latter case results in an empty string anyway, so just fast-track it. Signed-off-by: Christoph Heiss --- pkgs/by-name/pr/proxmox-backup-client/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/pr/proxmox-backup-client/package.nix b/pkgs/by-name/pr/proxmox-backup-client/package.nix index 8350bd9f1684..9ac5e32ae4f4 100644 --- a/pkgs/by-name/pr/proxmox-backup-client/package.nix +++ b/pkgs/by-name/pr/proxmox-backup-client/package.nix @@ -10,7 +10,6 @@ libuuid, acl, libxcrypt, - git, installShellFiles, sphinx, systemd, @@ -149,8 +148,10 @@ rustPlatform.buildRustPackage { doCheck = false; + # pbs-buildcfg requires this set, would be the git commit id + REPOID = ""; + nativeBuildInputs = [ - git pkg-config pkgconf rustPlatform.bindgenHook From 6bc9f0fbe3ce39abface640e00fb01484d10aa22 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 6 Jun 2025 17:35:48 +0200 Subject: [PATCH 3/4] proxmox-backup-client: drop unused `pkg-config` buildInput Signed-off-by: Christoph Heiss --- pkgs/by-name/pr/proxmox-backup-client/package.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/by-name/pr/proxmox-backup-client/package.nix b/pkgs/by-name/pr/proxmox-backup-client/package.nix index 9ac5e32ae4f4..24b5b2a23997 100644 --- a/pkgs/by-name/pr/proxmox-backup-client/package.nix +++ b/pkgs/by-name/pr/proxmox-backup-client/package.nix @@ -3,7 +3,6 @@ fetchgit, fetchFromGitHub, rustPlatform, - pkg-config, pkgconf, openssl, fuse3, @@ -152,7 +151,6 @@ rustPlatform.buildRustPackage { REPOID = ""; nativeBuildInputs = [ - pkg-config pkgconf rustPlatform.bindgenHook installShellFiles From 723612485fb7466d471f5facaf34e89244fd3458 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Tue, 10 Jun 2025 22:18:56 +0200 Subject: [PATCH 4/4] proxmox-backup-client: avoid some unnecessary buildInputs due to greedy linkage These are actually not necessary, rustc just does greedy linkage. Signed-off-by: Christoph Heiss --- .../pr/proxmox-backup-client/package.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/pr/proxmox-backup-client/package.nix b/pkgs/by-name/pr/proxmox-backup-client/package.nix index 24b5b2a23997..6bd8a0e52de4 100644 --- a/pkgs/by-name/pr/proxmox-backup-client/package.nix +++ b/pkgs/by-name/pr/proxmox-backup-client/package.nix @@ -11,9 +11,7 @@ libxcrypt, installShellFiles, sphinx, - systemd, stdenv, - fetchpatch, versionCheckHook, }: @@ -111,6 +109,13 @@ rustPlatform.buildRustPackage { cp ${./Cargo.lock} Cargo.lock rm .cargo/config.toml + + # avoid some unnecessary dependendcies, stemming from greedy linkage by rustc + # see also upstream Makefile for similar workaround + mkdir -p .dep-stubs + echo '!' >.dep-stubs/libsystemd.a + echo '!' >.dep-stubs/libuuid.a + echo '!' >.dep-stubs/libcrypt.a ''; postBuild = '' @@ -145,6 +150,8 @@ rustPlatform.buildRustPackage { "--bin=pxar" ]; + RUSTFLAGS = [ "-L.dep-stubs" ]; + doCheck = false; # pbs-buildcfg requires this set, would be the git commit id @@ -156,15 +163,15 @@ rustPlatform.buildRustPackage { installShellFiles sphinx ]; + buildInputs = [ openssl fuse3 - libuuid acl - libxcrypt - systemd.dev ]; + strictDeps = true; + doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgramArg = "version";