public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "D. Ben Knoble" <ben.knoble+github@gmail•com>
To: git@vger•kernel.org
Cc: "D. Ben Knoble" <ben.knoble+github@gmail•com>,
	Eric Sunshine <sunshine@sunshineco•com>,
	Patrick Steinhardt <ps@pks•im>,
	Junio C Hamano <gitster@pobox•com>
Subject: [PATCH] rust: build correctly without GNU sed
Date: Thu, 18 Dec 2025 18:25:44 -0500	[thread overview]
Message-ID: <a33f4e5118938300bcd5b2991feeee855a1c8f86.1766100330.git.ben.knoble+github@gmail.com> (raw)

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


             reply	other threads:[~2025-12-18 23:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18 23:25 D. Ben Knoble [this message]
2025-12-19  0:53 ` [PATCH] rust: build correctly without GNU sed Eric Sunshine
2025-12-19  6:24 ` Patrick Steinhardt

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=a33f4e5118938300bcd5b2991feeee855a1c8f86.1766100330.git.ben.knoble+github@gmail.com \
    --to=ben.knoble+github@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=ps@pks$(echo .)im \
    --cc=sunshine@sunshineco$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox