Git development
 help / color / mirror / Atom feed
* [PATCH] rust: respect CARGO_BUILD_TARGET when locating build output
@ 2026-09-08 15:24 James Le Cuirot
  2026-09-08 16:18 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: James Le Cuirot @ 2026-09-08 15:24 UTC (permalink / raw)
  To: git; +Cc: James Le Cuirot, Junio C Hamano

When cross-compiling, Cargo always writes to a target-tuple subdirectory
determined by CARGO_BUILD_TARGET, even when it matches the native tuple.
The script looked in $BUILD_DIR/$BUILD_TYPE directly, so it failed to
find (and copy) the freshly built library.

Respect CARGO_BUILD_TARGET in the output path so the correct artifact
is located.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
 src/cargo-meson.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cargo-meson.sh b/src/cargo-meson.sh
index 75f3cd1..3a558aa 100755
--- a/src/cargo-meson.sh
+++ b/src/cargo-meson.sh
@@ -38,7 +38,7 @@ then
 	exit $RET
 fi
 
-if ! cmp "$BUILD_DIR/$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a" >/dev/null 2>&1
+if ! cmp "$BUILD_DIR/${CARGO_BUILD_TARGET-}/$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a" >/dev/null 2>&1
 then
-	cp "$BUILD_DIR/$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a"
+	cp "$BUILD_DIR/${CARGO_BUILD_TARGET-}/$BUILD_TYPE/$LIBNAME" "$BUILD_DIR/libgitcore.a"
 fi
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-10 10:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 15:24 [PATCH] rust: respect CARGO_BUILD_TARGET when locating build output James Le Cuirot
2026-09-08 16:18 ` Junio C Hamano
2026-09-08 21:53   ` [PATCH v2] " James Le Cuirot
2026-09-09 20:07     ` Junio C Hamano
2026-09-10 10:20       ` [PATCH v3] " James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox