{"thread":{"id":"64618","subject":"meson -Drust=enabled fails on macOS without GNU sed","startedAt":"2025-12-12T20:00:31Z","lastAt":"2025-12-18T23:27:11Z","messageCount":7,"participants":["D. Ben Knoble","Eric Sunshine","Patrick Steinhardt","Ben Knoble"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"532088","messageId":"CALnO6CCu7A7mkLy==K9a-u-z0kYBKLiyBz+Qq8c7PWLHO-YuNw@mail.gmail.com","threadId":"64618","inReplyTo":null,"subject":"meson -Drust=enabled fails on macOS without GNU sed","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2025-12-12T20:00:18Z","receivedAt":"2025-12-12T20:00:31Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"I think it's due to e509b5b8be (rust: support for Windows, 2025-10-15)\n[relevant folks CC'd], where we assume sed can take \"-s\" (which AFAICT\nis a GNU extension). But perhaps \"-n\" was intended with a \"p\" flag on\nthe substitution?\n\nI've been building with Rust enabled on Gentoo now for a minute and\nhaven't hit any issues, but that's perhaps because the command is\nrunning with \"-s\" and not working as intended (yet still producing the\nexpected results).\n\nThe relevant snippet is this (reformatted slightly by GMail, apologies):\n\ncase \"$(cargo -vV | sed -s 's/^host: \\(.*\\)$/\\1/')\" in\n  *-windows-*) LIBNAME=gitcore.lib;;\n  *) LIBNAME=libgitcore.a;;\nesac\n\nbut \"cargo -vV\" produces something like\n\ncargo 1.89.0 (c24e10642 2025-06-23)\nrelease: 1.89.0\ncommit-hash: c24e1064277fe51ab72011e2612e556ac56addf7\ncommit-date: 2025-06-23\nhost: x86_64-apple-darwin\nlibgit2: 1.9.0 (sys:0.20.2 vendored)\nlibcurl: 8.7.1 (sys:0.4.80+curl-8.12.1 system ssl:(SecureTransport)\nLibreSSL/3.3.6)\nssl: OpenSSL 3.5.0 8 Apr 2025\nos: Mac OS 12.7.6 [64-bit]\n\n(on my older system, on which I haven't tried the build; the failure\nis on my newer system with close-enough-to-the-same output). I'm sure\nyou can see why I don't understand why we need GNU's \"-s\" (\"consider\nfiles as separate rather than as a single, continuous long stream\")\nhere?\n"},{"id":"532089","messageId":"CAPig+cSctvQoCNvQqrsLjzLQBc7H9u2hpxeBHE19_AQsup+kFQ@mail.gmail.com","threadId":"64618","inReplyTo":"CALnO6CCu7A7mkLy==K9a-u-z0kYBKLiyBz+Qq8c7PWLHO-YuNw@mail.gmail.com","subject":"Re: meson -Drust=enabled fails on macOS without GNU sed","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2025-12-12T20:32:30Z","receivedAt":"2025-12-12T20:32:42Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Dec 12, 2025 at 3:01 PM D. Ben Knoble\n<ben.knoble+github@gmail.com> wrote:\n> I think it's due to e509b5b8be (rust: support for Windows, 2025-10-15)\n> [relevant folks CC'd], where we assume sed can take \"-s\" (which AFAICT\n> is a GNU extension). But perhaps \"-n\" was intended with a \"p\" flag on\n> the substitution?\n>\n> I've been building with Rust enabled on Gentoo now for a minute and\n> haven't hit any issues, but that's perhaps because the command is\n> running with \"-s\" and not working as intended (yet still producing the\n> expected results).\n>\n> The relevant snippet is this (reformatted slightly by GMail, apologies):\n>\n> case \"$(cargo -vV | sed -s 's/^host: \\(.*\\)$/\\1/')\" in\n>   *-windows-*) LIBNAME=gitcore.lib;;\n>   *) LIBNAME=libgitcore.a;;\n> esac\n>\n> but \"cargo -vV\" produces something like\n>\n> cargo 1.89.0 (c24e10642 2025-06-23)\n> [...]\n> host: x86_64-apple-darwin\n>\n> (on my older system, on which I haven't tried the build; the failure\n> is on my newer system with close-enough-to-the-same output). I'm sure\n> you can see why I don't understand why we need GNU's \"-s\" (\"consider\n> files as separate rather than as a single, continuous long stream\")\n> here?\n\nYup, that's a strange one. Indeed:\n\n    sed -n 's/^host: \\(.*\\)$/\\1/p'\n\nwould be the correct way to do it, while also being compatible with\nBSD-lineage `sed` (such as `sed` on macOS).\n"},{"id":"532191","messageId":"aUApKxjYHMPHNIac@pks.im","threadId":"64618","inReplyTo":"CAPig+cSctvQoCNvQqrsLjzLQBc7H9u2hpxeBHE19_AQsup+kFQ@mail.gmail.com","subject":"Re: meson -Drust=enabled fails on macOS without GNU sed","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-12-15T15:28:43Z","receivedAt":"2025-12-15T15:28:50Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Dec 12, 2025 at 03:32:30PM -0500, Eric Sunshine wrote:\n> On Fri, Dec 12, 2025 at 3:01 PM D. Ben Knoble\n> <ben.knoble+github@gmail.com> wrote:\n> > I think it's due to e509b5b8be (rust: support for Windows, 2025-10-15)\n> > [relevant folks CC'd], where we assume sed can take \"-s\" (which AFAICT\n> > is a GNU extension). But perhaps \"-n\" was intended with a \"p\" flag on\n> > the substitution?\n> >\n> > I've been building with Rust enabled on Gentoo now for a minute and\n> > haven't hit any issues, but that's perhaps because the command is\n> > running with \"-s\" and not working as intended (yet still producing the\n> > expected results).\n> >\n> > The relevant snippet is this (reformatted slightly by GMail, apologies):\n> >\n> > case \"$(cargo -vV | sed -s 's/^host: \\(.*\\)$/\\1/')\" in\n> >   *-windows-*) LIBNAME=gitcore.lib;;\n> >   *) LIBNAME=libgitcore.a;;\n> > esac\n> >\n> > but \"cargo -vV\" produces something like\n> >\n> > cargo 1.89.0 (c24e10642 2025-06-23)\n> > [...]\n> > host: x86_64-apple-darwin\n> >\n> > (on my older system, on which I haven't tried the build; the failure\n> > is on my newer system with close-enough-to-the-same output). I'm sure\n> > you can see why I don't understand why we need GNU's \"-s\" (\"consider\n> > files as separate rather than as a single, continuous long stream\")\n> > here?\n> \n> Yup, that's a strange one. Indeed:\n> \n>     sed -n 's/^host: \\(.*\\)$/\\1/p'\n> \n> would be the correct way to do it, while also being compatible with\n> BSD-lineage `sed` (such as `sed` on macOS).\n\nAh, indeed. Would one of you want to turn this into a patch?\n\nThanks for the report!\n\nPatrick\n"},{"id":"532198","messageId":"CAPig+cTrLkEPGb=7dU1pnB9ir+vMaJ2W=J3R6+9kLuHkubtS_g@mail.gmail.com","threadId":"64618","inReplyTo":"aUApKxjYHMPHNIac@pks.im","subject":"Re: meson -Drust=enabled fails on macOS without GNU sed","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2025-12-15T17:51:50Z","receivedAt":"2025-12-15T17:52:03Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Dec 15, 2025 at 10:28 AM Patrick Steinhardt <ps@pks.im> wrote:\n> On Fri, Dec 12, 2025 at 03:32:30PM -0500, Eric Sunshine wrote:\n> > On Fri, Dec 12, 2025 at 3:01 PM D. Ben Knoble\n> > <ben.knoble+github@gmail.com> wrote:\n> > > I think it's due to e509b5b8be (rust: support for Windows, 2025-10-15)\n> > > [relevant folks CC'd], where we assume sed can take \"-s\" (which AFAICT\n> > > is a GNU extension). But perhaps \"-n\" was intended with a \"p\" flag on\n> > > the substitution?\n> >\n> > Yup, that's a strange one. Indeed:\n> >\n> >     sed -n 's/^host: \\(.*\\)$/\\1/p'\n> >\n> > would be the correct way to do it, while also being compatible with\n> > BSD-lineage `sed` (such as `sed` on macOS).\n>\n> Ah, indeed. Would one of you want to turn this into a patch?\n\nI'm not likely to have the time, presently. Ben is welcome to attack\nthe task if he desires.\n"},{"id":"532404","messageId":"69EAE286-A7E8-43CE-A503-FAC707541244@gmail.com","threadId":"64618","inReplyTo":"aUApKxjYHMPHNIac@pks.im","subject":"Re: meson -Drust=enabled fails on macOS without GNU sed","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-12-18T02:56:02Z","receivedAt":"2025-12-18T02:56:14Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 15 déc. 2025 à 10:28, Patrick Steinhardt <ps@pks.im> a écrit :\n> \n> ﻿On Fri, Dec 12, 2025 at 03:32:30PM -0500, Eric Sunshine wrote:\n>>> On Fri, Dec 12, 2025 at 3:01 PM D. Ben Knoble\n>>> <ben.knoble+github@gmail.com> wrote:\n>>> I think it's due to e509b5b8be (rust: support for Windows, 2025-10-15)\n>>> [relevant folks CC'd], where we assume sed can take \"-s\" (which AFAICT\n>>> is a GNU extension). But perhaps \"-n\" was intended with a \"p\" flag on\n>>> the substitution?\n>>> \n>>> I've been building with Rust enabled on Gentoo now for a minute and\n>>> haven't hit any issues, but that's perhaps because the command is\n>>> running with \"-s\" and not working as intended (yet still producing the\n>>> expected results).\n>>> \n>>> The relevant snippet is this (reformatted slightly by GMail, apologies):\n>>> \n>>> case \"$(cargo -vV | sed -s 's/^host: \\(.*\\)$/\\1/')\" in\n>>>  *-windows-*) LIBNAME=gitcore.lib;;\n>>>  *) LIBNAME=libgitcore.a;;\n>>> esac\n>>> \n>>> but \"cargo -vV\" produces something like\n>>> \n>>> cargo 1.89.0 (c24e10642 2025-06-23)\n>>> [...]\n>>> host: x86_64-apple-darwin\n>>> \n>>> (on my older system, on which I haven't tried the build; the failure\n>>> is on my newer system with close-enough-to-the-same output). I'm sure\n>>> you can see why I don't understand why we need GNU's \"-s\" (\"consider\n>>> files as separate rather than as a single, continuous long stream\")\n>>> here?\n>> \n>> Yup, that's a strange one. Indeed:\n>> \n>>    sed -n 's/^host: \\(.*\\)$/\\1/p'\n>> \n>> would be the correct way to do it, while also being compatible with\n>> BSD-lineage `sed` (such as `sed` on macOS).\n> \n> Ah, indeed. Would one of you want to turn this into a patch?\n> \n> Thanks for the report!\n> \n> Patrick\n\nWork is ugly this week. I hope to send a patch this weekend. "},{"id":"532437","messageId":"aUOl5h-13jMOPJhD@pks.im","threadId":"64618","inReplyTo":"69EAE286-A7E8-43CE-A503-FAC707541244@gmail.com","subject":"Re: meson -Drust=enabled fails on macOS without GNU sed","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-12-18T06:57:42Z","receivedAt":"2025-12-18T06:57:49Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Dec 17, 2025 at 09:56:02PM -0500, Ben Knoble wrote:\n> \n> > Le 15 déc. 2025 à 10:28, Patrick Steinhardt <ps@pks.im> a écrit :\n> > \n> > ﻿On Fri, Dec 12, 2025 at 03:32:30PM -0500, Eric Sunshine wrote:\n> >>> On Fri, Dec 12, 2025 at 3:01 PM D. Ben Knoble\n> >>> <ben.knoble+github@gmail.com> wrote:\n> >>> I think it's due to e509b5b8be (rust: support for Windows, 2025-10-15)\n> >>> [relevant folks CC'd], where we assume sed can take \"-s\" (which AFAICT\n> >>> is a GNU extension). But perhaps \"-n\" was intended with a \"p\" flag on\n> >>> the substitution?\n> >>> \n> >>> I've been building with Rust enabled on Gentoo now for a minute and\n> >>> haven't hit any issues, but that's perhaps because the command is\n> >>> running with \"-s\" and not working as intended (yet still producing the\n> >>> expected results).\n> >>> \n> >>> The relevant snippet is this (reformatted slightly by GMail, apologies):\n> >>> \n> >>> case \"$(cargo -vV | sed -s 's/^host: \\(.*\\)$/\\1/')\" in\n> >>>  *-windows-*) LIBNAME=gitcore.lib;;\n> >>>  *) LIBNAME=libgitcore.a;;\n> >>> esac\n> >>> \n> >>> but \"cargo -vV\" produces something like\n> >>> \n> >>> cargo 1.89.0 (c24e10642 2025-06-23)\n> >>> [...]\n> >>> host: x86_64-apple-darwin\n> >>> \n> >>> (on my older system, on which I haven't tried the build; the failure\n> >>> is on my newer system with close-enough-to-the-same output). I'm sure\n> >>> you can see why I don't understand why we need GNU's \"-s\" (\"consider\n> >>> files as separate rather than as a single, continuous long stream\")\n> >>> here?\n> >> \n> >> Yup, that's a strange one. Indeed:\n> >> \n> >>    sed -n 's/^host: \\(.*\\)$/\\1/p'\n> >> \n> >> would be the correct way to do it, while also being compatible with\n> >> BSD-lineage `sed` (such as `sed` on macOS).\n> > \n> > Ah, indeed. Would one of you want to turn this into a patch?\n> > \n> > Thanks for the report!\n> > \n> > Patrick\n> \n> Work is ugly this week. I hope to send a patch this weekend. \n\nThanks! Let me know in case you don't get to it and I'll be happy to\nsend a patch myself.\n\nPatrick\n"},{"id":"532506","messageId":"CALnO6CDhe+MLK9-fvk1USZ5+8bpgHUmwLrZR7m3_SsvYPwTVLw@mail.gmail.com","threadId":"64618","inReplyTo":"aUOl5h-13jMOPJhD@pks.im","subject":"Re: meson -Drust=enabled fails on macOS without GNU sed","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-12-18T23:26:59Z","receivedAt":"2025-12-18T23:27:11Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Thu, Dec 18, 2025 at 1:57 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Wed, Dec 17, 2025 at 09:56:02PM -0500, Ben Knoble wrote:\n> >\n> > > Le 15 déc. 2025 à 10:28, Patrick Steinhardt <ps@pks.im> a écrit :\n[snip]\n> > > Ah, indeed. Would one of you want to turn this into a patch?\n> > >\n> > > Thanks for the report!\n> > >\n> > > Patrick\n> >\n> > Work is ugly this week. I hope to send a patch this weekend.\n>\n> Thanks! Let me know in case you don't get to it and I'll be happy to\n> send a patch myself.\n>\n> Patrick\n\nShould come in as\n<a33f4e5118938300bcd5b2991feeee855a1c8f86.1766100330.git.ben.knoble+github@gmail.com>\n\n-- \nD. Ben Knoble\n"}]}