From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7850F1FF14C for ; Fri, 26 Jun 2026 16:31:29 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BBF3A15C24; Fri, 26 Jun 2026 16:31:27 +0200 (CEST) From: "Max R. Carrara" To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs v1] make: fix library path detection for tests Date: Fri, 26 Jun 2026 16:31:19 +0200 Message-ID: <20260626143121.598856-1-m.carrara@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782484275439 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.080 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pve.pm,perl.org] Message-ID-Hash: TOZHCVEDJNDC3ZQA67I42XUOVO47BBZA X-Message-ID-Hash: TOZHCVEDJNDC3ZQA67I42XUOVO47BBZA X-MailFrom: m.carrara@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: Export a new variable containing the absolute path to the current Rust target's directory and pass it to PERL5LIB [0] in the tests' Makefile. This allows the bootstrap machinery in Proxmox::Lib::PVE to find the compiled .so file when testing and building. Since it's not needed anymore, remove the `sed` workaround in the `all` target. [0] https://perldoc.perl.org/perlrun#PERL5LIB Signed-off-by: Max R. Carrara --- pve-rs/Makefile | 7 +++---- pve-rs/test/Makefile | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pve-rs/Makefile b/pve-rs/Makefile index bb1cd2d..caeb248 100644 --- a/pve-rs/Makefile +++ b/pve-rs/Makefile @@ -48,6 +48,9 @@ else TARGET_DIR=debug endif +# Used to tell tests where the compiled .so file resides +export TEST_LIB_DIR=$(shell pwd)/target/$(TARGET_DIR) + # better way to automate this without a massively annoying cargo-metatdata + jq # chain that spits out errors? PROXMOX_DOC_CRATES := \ @@ -75,10 +78,6 @@ PROXMOX_DOC_URL_FLAGS = $(foreach crate,$(PROXMOX_DOC_CRATES),$(call make_rustdo all: PVE cargo build $(CARGO_BUILD_ARGS) - mkdir -p test/Proxmox/Lib - sed -r -e \ - 's@^sub libfile.*$$@sub libfile { "$(shell pwd)/target/$(TARGET_DIR)/libpve_rs.so"; }@' \ - Proxmox/Lib/PVE.pm >test/Proxmox/Lib/PVE.pm Proxmox: Proxmox/Lib/PVE.pm PVE: $(PERLMOD_PACKAGE_FILES) diff --git a/pve-rs/test/Makefile b/pve-rs/test/Makefile index 29dc955..5d27c96 100644 --- a/pve-rs/test/Makefile +++ b/pve-rs/test/Makefile @@ -1,5 +1,7 @@ +export PERL5LIB=$(TEST_LIB_DIR) + .PHONY: test -test: Proxmox/Lib/PVE.pm +test: @echo "-- running pve-rs tests --" perl -I. -I.. -I../.. ./resource_scheduling.pl -- 2.47.3