* [PATCH] rust: build correctly without GNU sed
@ 2025-12-18 23:25 D. Ben Knoble
2025-12-19 0:53 ` Eric Sunshine
2025-12-19 6:24 ` Patrick Steinhardt
0 siblings, 2 replies; 3+ messages in thread
From: D. Ben Knoble @ 2025-12-18 23:25 UTC (permalink / raw)
To: git; +Cc: D. Ben Knoble, Eric Sunshine, Patrick Steinhardt, Junio C Hamano
From e509b5b8be (rust: support for Windows, 2025-10-15), we check
cargo's information to decide which library to build. However, that
check mistakenly used "sed -s" ("consider files as separate rather than
as a single, continuous long stream"), which is a GNU extension. The
build thus fails on macOS with "meson -Drust=enabled", which comes with
BSD-derived sed.
Instead, use the intended "sed -n" and print the matching section of the
output. This failure mode likely went unnoticed on systems with GNU sed
(common for developer machines and CI) because, in those instances, the
output being matched by case is the full cargo output (which either
contains the string "-windows-" or doesn't).
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
---
src/cargo-meson.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cargo-meson.sh b/src/cargo-meson.sh
index 3998db0435..38728a3711 100755
--- a/src/cargo-meson.sh
+++ b/src/cargo-meson.sh
@@ -26,7 +26,7 @@
exit $RET
fi
-case "$(cargo -vV | sed -s 's/^host: \(.*\)$/\1/')" in
+case "$(cargo -vV | sed -n 's/^host: \(.*\)$/\1/p')" in
*-windows-*)
LIBNAME=gitcore.lib;;
*)
--
2.52.0.rc0.365.g9bf09b728d.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rust: build correctly without GNU sed
2025-12-18 23:25 [PATCH] rust: build correctly without GNU sed D. Ben Knoble
@ 2025-12-19 0:53 ` Eric Sunshine
2025-12-19 6:24 ` Patrick Steinhardt
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sunshine @ 2025-12-19 0:53 UTC (permalink / raw)
To: D. Ben Knoble; +Cc: git, Patrick Steinhardt, Junio C Hamano
On Thu, Dec 18, 2025 at 6:26 PM D. Ben Knoble
<ben.knoble+github@gmail.com> wrote:
> From e509b5b8be (rust: support for Windows, 2025-10-15), we check
> cargo's information to decide which library to build. However, that
> check mistakenly used "sed -s" ("consider files as separate rather than
> as a single, continuous long stream"), which is a GNU extension. The
> build thus fails on macOS with "meson -Drust=enabled", which comes with
> BSD-derived sed.
>
> Instead, use the intended "sed -n" and print the matching section of the
> output. This failure mode likely went unnoticed on systems with GNU sed
> (common for developer machines and CI) because, in those instances, the
> output being matched by case is the full cargo output (which either
> contains the string "-windows-" or doesn't).
>
> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
> Helped-by: Patrick Steinhardt <ps@pks.im>
> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
> ---
> diff --git a/src/cargo-meson.sh b/src/cargo-meson.sh
> @@ -26,7 +26,7 @@
> -case "$(cargo -vV | sed -s 's/^host: \(.*\)$/\1/')" in
> +case "$(cargo -vV | sed -n 's/^host: \(.*\)$/\1/p')" in
> *-windows-*)
> LIBNAME=gitcore.lib;;
This change looks good to me. Thanks for tackling this.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rust: build correctly without GNU sed
2025-12-18 23:25 [PATCH] rust: build correctly without GNU sed D. Ben Knoble
2025-12-19 0:53 ` Eric Sunshine
@ 2025-12-19 6:24 ` Patrick Steinhardt
1 sibling, 0 replies; 3+ messages in thread
From: Patrick Steinhardt @ 2025-12-19 6:24 UTC (permalink / raw)
To: D. Ben Knoble; +Cc: git, Eric Sunshine, Junio C Hamano
On Thu, Dec 18, 2025 at 06:25:44PM -0500, D. Ben Knoble wrote:
> From e509b5b8be (rust: support for Windows, 2025-10-15), we check
> cargo's information to decide which library to build. However, that
> check mistakenly used "sed -s" ("consider files as separate rather than
> as a single, continuous long stream"), which is a GNU extension. The
> build thus fails on macOS with "meson -Drust=enabled", which comes with
> BSD-derived sed.
>
> Instead, use the intended "sed -n" and print the matching section of the
> output. This failure mode likely went unnoticed on systems with GNU sed
> (common for developer machines and CI) because, in those instances, the
> output being matched by case is the full cargo output (which either
> contains the string "-windows-" or doesn't).
Yeah, I guess that's what happened indeed. I seem to have confused "-s"
for "--silent" with "-n" when I wrote this.
> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
> Helped-by: Patrick Steinhardt <ps@pks.im>
I'd say that it was you two folks who figured this out, I didn't really
help much :) But I won't complain.
> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
> ---
> src/cargo-meson.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/cargo-meson.sh b/src/cargo-meson.sh
> index 3998db0435..38728a3711 100755
> --- a/src/cargo-meson.sh
> +++ b/src/cargo-meson.sh
> @@ -26,7 +26,7 @@
> exit $RET
> fi
>
> -case "$(cargo -vV | sed -s 's/^host: \(.*\)$/\1/')" in
> +case "$(cargo -vV | sed -n 's/^host: \(.*\)$/\1/p')" in
> *-windows-*)
> LIBNAME=gitcore.lib;;
> *)
Yup, this looks exactly like discussed. Thanks, the fix looks good to
me!
Patrick
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-19 6:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 23:25 [PATCH] rust: build correctly without GNU sed D. Ben Knoble
2025-12-19 0:53 ` Eric Sunshine
2025-12-19 6:24 ` Patrick Steinhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).