From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 1CCB71FF0E6 for ; Fri, 07 Aug 2026 10:49:32 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3FAC8214E7; Fri, 07 Aug 2026 10:49:38 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 07 Aug 2026 10:49:32 +0200 Message-Id: To: "Elias Huhsovitz" , From: "Max R. Carrara" Subject: Re: [PATCH proxmox-perl-rs v2] make: improve library path detection for tests X-Mailer: aerc 0.18.2-0-ge037c095a049 References: <20260714134110.335651-1-m.carrara@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1786092556479 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.821 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: UOTIXSMPK7BJD6JEJP52KKHOVGXVEQJP X-Message-ID-Hash: UOTIXSMPK7BJD6JEJP52KKHOVGXVEQJP 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: On Wed Aug 5, 2026 at 12:24 PM CEST, Elias Huhsovitz wrote: > 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 fil= e > > 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. Ah, good point! Totally forgot about that. > > 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). Yeah you are right there, I don't usually differentiate between the assignment types in Makefiles, if I'm really honest (but maybe I should start doing that). Thanks for the comments, will refresh this! > > 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-metat= data + jq > > # chain that spits out errors? > > PROXMOX_DOC_CRATES :=3D \ > > @@ -75,10 +78,6 @@ PROXMOX_DOC_URL_FLAGS =3D $(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..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