From: Junio C Hamano <gitster@pobox.com>
To: James Le Cuirot <chewi@gentoo.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] rust: respect CARGO_BUILD_TARGET when locating build output
Date: Tue, 08 Sep 2026 09:18:38 -0700 [thread overview]
Message-ID: <xmqqo6e7yaw1.fsf@gitster.g> (raw)
In-Reply-To: <20260908152425.153131-2-chewi@gentoo.org> (James Le Cuirot's message of "Tue, 8 Sep 2026 16:24:26 +0100")
James Le Cuirot <chewi@gentoo.org> writes:
> Subject: Re: [PATCH] rust: respect CARGO_BUILD_TARGET when locating build output
>
> 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.
Nowhere in the above description I see mention of meson, but the
patch is only to cargo-meson that is referenced by src/meson.build
which invites a few questions:
* Does "make" work fine without any change similar to this?
* Shouldn't the commit title say "meson" somewhere if this change
is only for "meson" driven build?
Thanks.
>
> 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
next prev parent reply other threads:[~2026-09-08 16:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo6e7yaw1.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=chewi@gentoo.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.