From c469ca26c588918cfad439636a26fbefa2049b1d Mon Sep 17 00:00:00 2001 From: "D. Ben Knoble" Date: Thu, 18 Dec 2025 18:25:44 -0500 Subject: [PATCH] rust: build correctly without GNU sed 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 Helped-by: Patrick Steinhardt Signed-off-by: D. Ben Knoble Signed-off-by: Junio C Hamano --- 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 @@ then 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;; *)