From: Patrick Steinhardt <ps@pks.im>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "D. Ben Knoble" <ben.knoble+github@gmail.com>,
Git <git@vger.kernel.org>,
Ezekiel Newren <ezekielnewren@gmail.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: meson -Drust=enabled fails on macOS without GNU sed
Date: Mon, 15 Dec 2025 16:28:43 +0100 [thread overview]
Message-ID: <aUApKxjYHMPHNIac@pks.im> (raw)
In-Reply-To: <CAPig+cSctvQoCNvQqrsLjzLQBc7H9u2hpxeBHE19_AQsup+kFQ@mail.gmail.com>
On Fri, Dec 12, 2025 at 03:32:30PM -0500, Eric Sunshine wrote:
> On Fri, Dec 12, 2025 at 3:01 PM D. Ben Knoble
> <ben.knoble+github@gmail.com> wrote:
> > I think it's due to e509b5b8be (rust: support for Windows, 2025-10-15)
> > [relevant folks CC'd], where we assume sed can take "-s" (which AFAICT
> > is a GNU extension). But perhaps "-n" was intended with a "p" flag on
> > the substitution?
> >
> > I've been building with Rust enabled on Gentoo now for a minute and
> > haven't hit any issues, but that's perhaps because the command is
> > running with "-s" and not working as intended (yet still producing the
> > expected results).
> >
> > The relevant snippet is this (reformatted slightly by GMail, apologies):
> >
> > case "$(cargo -vV | sed -s 's/^host: \(.*\)$/\1/')" in
> > *-windows-*) LIBNAME=gitcore.lib;;
> > *) LIBNAME=libgitcore.a;;
> > esac
> >
> > but "cargo -vV" produces something like
> >
> > cargo 1.89.0 (c24e10642 2025-06-23)
> > [...]
> > host: x86_64-apple-darwin
> >
> > (on my older system, on which I haven't tried the build; the failure
> > is on my newer system with close-enough-to-the-same output). I'm sure
> > you can see why I don't understand why we need GNU's "-s" ("consider
> > files as separate rather than as a single, continuous long stream")
> > here?
>
> Yup, that's a strange one. Indeed:
>
> sed -n 's/^host: \(.*\)$/\1/p'
>
> would be the correct way to do it, while also being compatible with
> BSD-lineage `sed` (such as `sed` on macOS).
Ah, indeed. Would one of you want to turn this into a patch?
Thanks for the report!
Patrick
next prev parent reply other threads:[~2025-12-15 15:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-12 20:00 meson -Drust=enabled fails on macOS without GNU sed D. Ben Knoble
2025-12-12 20:32 ` Eric Sunshine
2025-12-15 15:28 ` Patrick Steinhardt [this message]
2025-12-15 17:51 ` Eric Sunshine
2025-12-18 2:56 ` Ben Knoble
2025-12-18 6:57 ` Patrick Steinhardt
2025-12-18 23:26 ` D. Ben Knoble
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=aUApKxjYHMPHNIac@pks.im \
--to=ps@pks.im \
--cc=ben.knoble+github@gmail.com \
--cc=ezekielnewren@gmail.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=sunshine@sunshineco.com \
/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 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).