git: af47301dd574 - main - Mk/Uses/cargo.mk: Generate Cargo.lock in the right place

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Thu, 06 Jun 2024 07:50:58 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=af47301dd57499c05ad627d3a81048e192f14f81

commit af47301dd57499c05ad627d3a81048e192f14f81
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-06-06 07:42:39 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-06-06 07:48:24 +0000

    Mk/Uses/cargo.mk: Generate Cargo.lock in the right place
    
    Sometimes we use non-default CARGO_CARGOTOML/CARGO_CARGOLOCK, that means the
    Cargo.{toml,lock} are not under WRKSRC. Therefore, we change it from WRKSRC to
    CARGO_CARGOTOML:H in order to generate Cargo.lock in the right place.
    
    PR:             279495
    Approved by:    mikael
---
 Mk/Uses/cargo.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index b6f9af00f11b..6083ca72564a 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -385,7 +385,7 @@ cargo-crates: cargo-crates-generate-lockfile
 cargo-crates-generate-lockfile: extract
 	@if [ ! -r "${CARGO_CARGOLOCK}" ]; then \
 		${ECHO_MSG} "===> ${CARGO_CARGOLOCK} not found.  Trying to generate it..."; \
-		cd ${WRKSRC}; ${_CARGO_RUN} generate-lockfile \
+		cd ${CARGO_CARGOLOCK:H}; ${_CARGO_RUN} generate-lockfile \
 			--manifest-path ${CARGO_CARGOTOML} \
 			--verbose; \
 	fi