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 056A41FF12C for ; Wed, 05 Aug 2026 12:24:07 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id ABD93218F9; Wed, 05 Aug 2026 12:24:06 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 05 Aug 2026 12:24:03 +0200 Message-Id: Subject: Re: [PATCH proxmox-perl-rs v2] make: improve library path detection for tests From: "Elias Huhsovitz" To: "Max R. Carrara" , X-Mailer: aerc 0.20.0 References: <20260714134110.335651-1-m.carrara@proxmox.com> In-Reply-To: <20260714134110.335651-1-m.carrara@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785925430225 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.102 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_LOW -0.7 Sender listed at https://www.dnswl.org/, low 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: TFFDOYYGD7FIDRVIZCZYHXCJNJDINPPZ X-Message-ID-Hash: TFFDOYYGD7FIDRVIZCZYHXCJNJDINPPZ X-MailFrom: e.huhsovitz@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: Nice patch. The less hacky solutions, the better! 2 small nits inline. On Tue Jul 14, 2026 at 3:41 PM CEST, Max R. Carrara wrote: > Export LD_LIBRARY_PATH containing the absolute path to the current > Rust target's directory in the top-level 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. > > Signed-off-by: Max R. Carrara > --- > Changes v1 --> v2: > * Use 'improve' instead of 'fix' in the commit message because 'fix' > implies that something was broken, which it wasn't > * Use LD_LIBRARY_PATH instead of PERL5LIB, as the latter didn't > actually work -- was a false positive on my side, as the .so file > installed on my workstation was used > > Also, tested this more thoroughly this time around by adding `panic!()` > statements in parts of the resource scheduling source code so that I > could really see that the freshly compiled library is being used. > Checked this for both `make check` and `make deb`, so the built .so file > should always get picked up. > > pve-rs/Makefile | 7 +++---- > pve-rs/test/Makefile | 2 +- > 2 files changed, 4 insertions(+), 5 deletions(-) > > diff --git a/pve-rs/Makefile b/pve-rs/Makefile > index bb1cd2d..c7f2aa4 100644 > --- a/pve-rs/Makefile > +++ b/pve-rs/Makefile > @@ -48,6 +48,9 @@ else > TARGET_DIR=3Ddebug > endif > > +# Used to tell tests where the compiled .so file resides > +export LD_LIBRARY_PATH=3D$(shell pwd)/target/$(TARGET_DIR) nit: I would use `$(CURDIR)` instead of `$(shell pwd)`, because it unaffected by the shell environment. nit: Why not use `:=3D` instead of `=3D`? The values of CURDIR and TARGET are known and should not change over the course of the Makefile (unless i missed something). e.g, I would change it to: export LD_LIBRARY_PATH:=3D$(CURDIR)/target/$(TARGET_DIR) > # better way to automate this without a massively annoying cargo-metatda= ta + jq > # chain that spits out errors? > PROXMOX_DOC_CRATES :=3D \ > @@ -75,10 +78,6 @@ PROXMOX_DOC_URL_FLAGS =3D $(foreach crate,$(PROXMOX_DO= C_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..2399b86 100644 > --- a/pve-rs/test/Makefile > +++ b/pve-rs/test/Makefile > @@ -1,5 +1,5 @@ > .PHONY: test > -test: Proxmox/Lib/PVE.pm > +test: > @echo "-- running pve-rs tests --" > perl -I. -I.. -I../.. ./resource_scheduling.pl > > -- > 2.47.3