From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id E26EE1FF0C0 for ; Wed, 18 Nov 2026 10:52:00 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id F0CEB21E25; Wed, 18 Nov 2026 10:45:12 +0100 (CET) From: Lukas Wagner To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-mail-forward v2 60/63] cargo: move mail forwarder into a workspace member crate Date: Wed, 18 Nov 2026 10:43:44 +0100 Message-ID: <20261118094348.273646-61-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118094348.273646-1-l.wagner@proxmox.com> References: <20261118094348.273646-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794995042677 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.186 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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 Message-ID-Hash: OYDSDN3WFS3B5WL6GOLMWVNQ5HR6Z4DY X-Message-ID-Hash: OYDSDN3WFS3B5WL6GOLMWVNQ5HR6Z4DY X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This allows adding the notification worker daemon as a separate crate in the same workspace, so that each binary only pulls in the dependencies it actually needs. Since 'cargo install' does not support virtual workspace roots, install the binary from the Makefile directly to /usr/libexec instead of moving it there from /usr/bin in d/rules. As the debian cargo wrapper always passes '--target', include it in release builds to know where the compiled binaries end up. Signed-off-by: Lukas Wagner --- Cargo.toml | 16 +++++++++------- Makefile | 13 +++++++------ debian/rules | 4 ---- proxmox-mail-forward/Cargo.toml | 16 ++++++++++++++++ {src => proxmox-mail-forward/src}/main.rs | 0 5 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 proxmox-mail-forward/Cargo.toml rename {src => proxmox-mail-forward/src}/main.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index d6ba2ae..e6e70c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,10 @@ -[package] -name = "proxmox-mail-forward" +[workspace] +members = [ + "proxmox-mail-forward", +] +resolver = "3" + +[workspace.package] version = "1.1.0" authors = [ "Fiona Ebner ", @@ -8,15 +13,12 @@ authors = [ ] edition = "2024" license = "AGPL-3" -description = "Proxmox mail forward helper" homepage = "https://www.proxmox.com" -exclude = [ "debian" ] - -[dependencies] +[workspace.dependencies] anyhow = "1.0" nix = "0.29" proxmox-log = "1" -proxmox-notify = { version = "2", features = ["queue-submitter"] } +proxmox-notify = "2" proxmox-sys = "1" diff --git a/Makefile b/Makefile index 8b0f728..72ae89a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ include /usr/share/dpkg/pkg-info.mk include /usr/share/dpkg/architecture.mk +include /usr/share/rustc/architecture.mk PACKAGE=proxmox-mail-forward BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION) @@ -11,8 +12,8 @@ DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb DEBS=$(DEB) $(DBG_DEB) ifeq ($(BUILD_MODE), release) -CARGO_BUILD_ARGS += --release -COMPILEDIR := target/release +CARGO_BUILD_ARGS += --release --target $(DEB_HOST_RUST_TYPE) +COMPILEDIR := target/$(DEB_HOST_RUST_TYPE)/release else COMPILEDIR := target/debug endif @@ -21,7 +22,7 @@ CARGO ?= cargo $(BUILDDIR): rm -rf $@ $@.tmp && mkdir $@.tmp - cp -a debian Cargo.toml src Makefile .cargo $@.tmp + cp -a debian Cargo.toml proxmox-mail-forward Makefile .cargo $@.tmp rm -f $@.tmp/Cargo.lock find $@.tmp/debian -name "*.hint" -delete mv $@.tmp $@ @@ -49,11 +50,11 @@ dinstall: $(DEBS) .PHONY: cargo-build cargo-build: $(CARGO) build $(CARGO_BUILD_ARGS) \ - --package proxmox-mail-forward \ - --bin proxmox-mail-forward + --package proxmox-mail-forward install: cargo-build - $(CARGO) install + install -d $(DESTDIR)/usr/libexec + install -m 0755 $(COMPILEDIR)/proxmox-mail-forward $(DESTDIR)/usr/libexec/ .PHONY: upload upload: $(DEBS) diff --git a/debian/rules b/debian/rules index cc2ec17..ddde12f 100755 --- a/debian/rules +++ b/debian/rules @@ -26,11 +26,7 @@ override_dh_auto_configure: dh_auto_configure execute_after_dh_auto_install: - # Install the binary to /usr/libexec, not /usr/bin. Inspired by virtiofsd's d/rules - mkdir -p debian/proxmox-mail-forward/usr/libexec - mv debian/proxmox-mail-forward/usr/bin/proxmox-mail-forward debian/proxmox-mail-forward/usr/libexec/ chmod u+s debian/proxmox-mail-forward/usr/libexec/proxmox-mail-forward - rmdir debian/proxmox-mail-forward/usr/bin override_dh_fixperms: dh_fixperms --exclude proxmox-mail-forward diff --git a/proxmox-mail-forward/Cargo.toml b/proxmox-mail-forward/Cargo.toml new file mode 100644 index 0000000..c3f7f7d --- /dev/null +++ b/proxmox-mail-forward/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "proxmox-mail-forward" +description = "Proxmox mail forward helper" +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true + +[dependencies] +anyhow.workspace = true +nix.workspace = true + +proxmox-log.workspace = true +proxmox-notify = { workspace = true, features = ["queue-submitter"] } +proxmox-sys.workspace = true diff --git a/src/main.rs b/proxmox-mail-forward/src/main.rs similarity index 100% rename from src/main.rs rename to proxmox-mail-forward/src/main.rs -- 2.47.3