From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly Date: Sun, 25 Dec 2022 17:58:02 +0100 Message-ID: <87a63bxvxh.fsf@gnu.org> References: <87iligyyh9.fsf@gnu.org> <87y1qyz909.fsf_-_@gnu.org> <87v8m2jb3c.fsf@jpoiret.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38458"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: 52835@debbugs.gnu.org, Timothy Sample To: Josselin Poiret Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun Dec 25 17:59:41 2022 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9ULb-0009qk-V1 for guile-bugs@m.gmane-mx.org; Sun, 25 Dec 2022 17:59:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9UL2-0006F7-Ei; Sun, 25 Dec 2022 11:59:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9UL0-0006Es-OU for bug-guile@gnu.org; Sun, 25 Dec 2022 11:59:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9UL0-0002lp-8X for bug-guile@gnu.org; Sun, 25 Dec 2022 11:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9UKz-0006NQ-Uf for bug-guile@gnu.org; Sun, 25 Dec 2022 11:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 25 Dec 2022 16:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52835 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 52835-submit@debbugs.gnu.org id=B52835.167198749324430 (code B ref 52835); Sun, 25 Dec 2022 16:59:01 +0000 Original-Received: (at 52835) by debbugs.gnu.org; 25 Dec 2022 16:58:13 +0000 Original-Received: from localhost ([127.0.0.1]:50033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9UKD-0006Ly-GD for submit@debbugs.gnu.org; Sun, 25 Dec 2022 11:58:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9UKB-0006Le-Kr for 52835@debbugs.gnu.org; Sun, 25 Dec 2022 11:58:12 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9UK5-0002iK-SB; Sun, 25 Dec 2022 11:58:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=sIZAlX2uPPsRGQ5leOA2SmgW9kgJXJlb0L0qHJ1RgIE=; b=kuHIO+dkLwk6MKUq9TqT VvHGtayKHuR3Jv3kGID5Ntsz6x/3JGFun/RP6AokggcDdV8hYC0HOaU2HMCUYZnGvFewmO3YNTsmz OsZ1Ub/nTslbY5oJs2AeqCPaEGW02EuYOaDwupt/ybYjMlpFAH9EZWLZr/TnwYC64jNZ2KMOf59Md WZY7jYZwmzwo1uYDCOXoSbetb4MebSthJoqXBvuG+V54e71gFrS7yoW+niEFBxW9IPmosfytBgCR8 RZjHvi3OfGGoA0p6Oak5W8CCFBxDsLKpumB7bWPcAxCBjtjxalwNWmVf1AXtWcWY5FMgTL/vTAb+Z GGLaO4w/NNOY2Q==; Original-Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9UK5-0005Pn-9a; Sun, 25 Dec 2022 11:58:05 -0500 In-Reply-To: <87v8m2jb3c.fsf@jpoiret.xyz> (Josselin Poiret's message of "Fri, 23 Dec 2022 18:15:03 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10490 Archived-At: Hi Josselin, Josselin Poiret skribis: > I've added a convenience module (ice-9 spawn) with a `spawn` procedure > in it, which takes an optional argument list which defaults to just the > executable, and optional environment variables as well as in, out and > err ports. I also think everything in (ice-9 popen) should be migrated > on the next major release, as well as being re-implemented in terms of > `spawn` purely, so that the change is immediately noticeable. OK. > We're reaching the bike-shedding time now, but IMHO having such a > `spawn*` exposed to the user seems fine, it's a pretty simple "raw" > interface with fdes, and there is a convenience `spawn` function that is > nicer for users. =E2=80=98spawn*=E2=80=99 is expressive enough, but a procedure with 6 posit= ional arguments cannot be exposed as-is IMO. One tiny thing that=E2=80=99s missing is a boolean to choose between =E2=80=98posix_spawn=E2=80=99 and =E2=80=98posix_spawnp=E2=80=99. So we need either =E2=80=98spawn=E2=80=99 defined in Scheme as you did, or = directly use =E2=80=98scm_c_bind_keyword_arguments=E2=80=99 right in =E2=80=98scm_spawn_= process=E2=80=99 (info "(guile) Keyword Procedures"), to avoid ending up with two procedures. I=E2=80=99m fine either way. > Do we need to add a documentation page as well? Yes, please. :-) I realize I=E2=80=99m asking a lot of things, so let me = know if you=E2=80=99d like to share the workload somehow. Doc could go in the =E2=80=9CProcesses=E2=80=9D section, or possibly in a n= ew section we=E2=80=99d add right after it, =E2=80=9CSpawning Programs=E2=80=9D. We s= hould probably add a =E2=80=9C@quotation Note=E2=80=9D in the doc of =E2=80=98primitive-fork=E2= =80=99 that briefly explains why people should probably use =E2=80=98spawn=E2=80=99 rather than fork + e= xec. Some cosmetic suggestions follow=E2=80=A6 Thanks, Ludo=E2=80=99.