From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Josselin Poiret via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" Newsgroups: gmane.lisp.guile.bugs Subject: bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly Date: Sat, 07 Jan 2023 17:07:01 +0100 Message-ID: <878rie9vmi.fsf@jpoiret.xyz> References: <87iligyyh9.fsf@gnu.org> <87y1qyz909.fsf_-_@gnu.org> <87v8m2jb3c.fsf@jpoiret.xyz> <87a63bxvxh.fsf@gnu.org> Reply-To: Josselin Poiret 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="37954"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52835@debbugs.gnu.org, Timothy Sample To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Jan 07 17:08:37 2023 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 1pEBkL-0009kD-Lh for guile-bugs@m.gmane-mx.org; Sat, 07 Jan 2023 17:08:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEBjn-0005az-Ul; Sat, 07 Jan 2023 11:08:03 -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 1pEBjm-0005aX-JL for bug-guile@gnu.org; Sat, 07 Jan 2023 11:08: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 1pEBjm-0000TD-6a for bug-guile@gnu.org; Sat, 07 Jan 2023 11:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEBjm-0006dP-1W for bug-guile@gnu.org; Sat, 07 Jan 2023 11:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 07 Jan 2023 16:08:02 +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.167310762625408 (code B ref 52835); Sat, 07 Jan 2023 16:08:02 +0000 Original-Received: (at 52835) by debbugs.gnu.org; 7 Jan 2023 16:07:06 +0000 Original-Received: from localhost ([127.0.0.1]:58770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEBir-0006bk-Ok for submit@debbugs.gnu.org; Sat, 07 Jan 2023 11:07:06 -0500 Original-Received: from jpoiret.xyz ([206.189.101.64]:50470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEBip-0006bc-Nk for 52835@debbugs.gnu.org; Sat, 07 Jan 2023 11:07:04 -0500 Original-Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 08DEE185306; Sat, 7 Jan 2023 16:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1673107622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eX49vjOe1RWfloU4XjSVv93vKDKHI5ktqY7yq9Mp1Ic=; b=vwWasjS7UcQUzejmew4pIU7fWqRmozJDHm+puE024GNMI+ShZ/jUdM8VydCvSUyvh2LmiE Eh1QCpnwRYnXesjyhfhjsJBb2vHFUCt8U4itaXRZ0Y9agFKsBvr2CEYCbZu8wK0JbgJq+h J1UBSqlagxrmC48K8QxK64+RQp++4xcAjpfPl/W0qR8xaZezMU5kdxGEqDtvD/VPnwREVU hyXCDipF+IbZof4QLejH9vIhbKbvsVwjQsixnzlwT8GP2NIK7b+m//z3kYx9i1JAsHQVNe w1C5L7SEpPQZA+y3l/81bEn5J0HdxiMOuS4zdsKQT2sTnMPlsJhBtOl7Pyk3Lw== In-Reply-To: <87a63bxvxh.fsf@gnu.org> Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / 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:10502 Archived-At: Hi Ludo, Happy new year! Ludovic Court=C3=A8s writes: > =E2=80=98spawn*=E2=80=99 is expressive enough, but a procedure with 6 pos= itional > 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, o= r directly use > =E2=80=98scm_c_bind_keyword_arguments=E2=80=99 right in =E2=80=98scm_spaw= n_process=E2=80=99 (info > "(guile) Keyword Procedures"), to avoid ending up with two procedures. > I=E2=80=99m fine either way. I've done the above by using the C functions to bind keyword arguments, and added the #:use-path? keyword argument. One annoying thing though is that since it uses keyword arguments, the first line of the documentation generated by SCM_DEFINE only mentions "spawn program . keyword_args". >> 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 m= e 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= new section > we=E2=80=99d add right after it, =E2=80=9CSpawning Programs=E2=80=9D. We= should 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 += exec. I've opted to put it right below primitive-fork, and slightly rewrite the part about pipes in primitive-fork's description to also mention spawn. Let me know if the documentation is not descriptive enough. WDYT? --=20 Josselin Poiret