From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id EFcPEag6OmbbbQAAe85BDQ:P1 (envelope-from ) for ; Tue, 07 May 2024 16:28:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id EFcPEag6OmbbbQAAe85BDQ (envelope-from ) for ; Tue, 07 May 2024 16:28:56 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=lvTeM+bY; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715092136; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=y4QsxVEhdTK5b6G2NdrYU93mrnpTcLr53yWpCGLIAQw=; b=MiOvER5NerkUZDIKda1Cdu8HAvS+5JMRuyaMHz0WWVFgehJtFc+Iw2SCn1amY408YLBYhX XuUolVqPxZNwHkUiLBBeysnLABxr+I6jZ+lbUA/xUnOS3nun//8z1ZDBGt2o6rU4/PCMzN 6INHGn7YgvW1v1utjViGH4w8hS/NxDRSOdwI8CDEgXsbiJym+m/wqUJ+x9IXoZfLl7n1O+ yq/gq0W8/HVl/Rgq4g5NtTB109P6nUKoyKsbZgPqRPJTTXzP0z3VqQamB2Ad3/fH+BUdGP /pGWwU6AraWfjtnIUvHU5QofluucaM48Hb+Z+z8FiidiIDVhCAX/y7x7wv3QrQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=lvTeM+bY; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715092136; a=rsa-sha256; cv=none; b=KF4IEfRvbqUmYKt2KwRQOOJGP10JHifAotB9V1Kdo+MsppHbCJhRhlgzDAVEeDKa9831KG /c9s4osiD+UpfNgezG2fdNEDKK9I86zAqYoxhkv/WG+zZPQXKnplR8AizSipBHH9L/SW6e BWNnL7yGbrWtJNE/EAAGpTiZjAOBOmYqfGw/lcMu9/7787cO4Vzwklws2W2dhYLv8kGluK GxXq5Zy8T9plwgHK6B4njoFGR5CAWpRvzK6L35viai4nZXnpadGnkd75rLT+kLN/3GJJOe dV/W18zrDDuAeFcXl3i3sG2Cg/iQtgLMWxu42c2r37TiCkgZHtXc0lu42y/iJw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 960C2210B4 for ; Tue, 7 May 2024 16:28:55 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4LoB-0000iQ-Sy; Tue, 07 May 2024 10:28:44 -0400 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 1s4Lo6-0000au-Cn for guix-patches@gnu.org; Tue, 07 May 2024 10:28:39 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4Lo5-0000QY-4G for guix-patches@gnu.org; Tue, 07 May 2024 10:28:37 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s4LoT-00089V-MU for guix-patches@gnu.org; Tue, 07 May 2024 10:29:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70494] [PATCH 03/23] syscalls: Add missing pieces for derivation build environment. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 May 2024 14:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70494 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 70494@debbugs.gnu.org Received: via spool by 70494-submit@debbugs.gnu.org id=B70494.171509208531326 (code B ref 70494); Tue, 07 May 2024 14:29:01 +0000 Received: (at 70494) by debbugs.gnu.org; 7 May 2024 14:28:05 +0000 Received: from localhost ([127.0.0.1]:42982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4LnY-00089C-N0 for submit@debbugs.gnu.org; Tue, 07 May 2024 10:28:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4LnT-00088p-Cv for 70494@debbugs.gnu.org; Tue, 07 May 2024 10:28:02 -0400 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 1s4Lmy-0000HQ-Ox; Tue, 07 May 2024 10:27:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=y4QsxVEhdTK5b6G2NdrYU93mrnpTcLr53yWpCGLIAQw=; b=lvTeM+bYtlZwaojhln3Q 5pJkUf+Xg7A8sNjbN0TZBBtKZ3Tgz5IxXQ0lKV9OFIGtR/+kWxDAgN8tY8A6YGHnXVC8U0GAlRKrM DiH1WhvJqPRX2BOMXX0gvZmkF+47hq5s2oL/n89lc+TclJXAbrOEQs8LZ1vM4eZaEyg0cfvje7022 N9tB7fpVmmpopVB3CRIJm5GmgkOdJ1o/gXCW9JRVYcGndNNQRRWSS7vQAP5Uh5ZbiBE1IZS/iYi0f qrg4EZwPWLUEWAib3uF+PoRllZq0vM08lRu3GtSbCi2zbazJpiVx3iquoTNKcHkAX8+NI24CBaCeL bwD5rKDlOMPx2Q==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <538dc2b842f748ae1b5ece7885af99dbe00bff5f.1713692561.git.mail@cbaines.net> (Christopher Baines's message of "Sun, 21 Apr 2024 10:42:21 +0100") References: <87bk632h36.fsf@cbaines.net> <538dc2b842f748ae1b5ece7885af99dbe00bff5f.1713692561.git.mail@cbaines.net> Date: Tue, 07 May 2024 16:27:22 +0200 Message-ID: <87r0ed66k5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -7.09 X-Migadu-Queue-Id: 960C2210B4 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -7.09 X-TUID: L5X3DqDtuY4F Hi! (Starting to review this patch series, it might take a while=E2=80=A6) Christopher Baines skribis: > From: Caleb Ristvedt > > * guix/build/syscalls.scm (ADDR_NO_RANDOMIZE, UNAME26, PER_LINUX32): New > variables. Flags needed for improving determinism / impersonating a 32-b= it > machine on a 64-bit machine. > (initialize-loopback, setdomainname, personality): New procedures. > (octal-escaped): New procedure. > (mount-points): Use octal-escaped to properly handle unusual characters in > mount point filenames. > > Signed-off-by: Christopher Baines > Change-Id: I2f2aa38fe8f97f2565461d20331b95040a2d7539 [...] > +(define (initialize-loopback) > + (let ((sock (socket PF_INET SOCK_DGRAM IPPROTO_IP))) > + (dynamic-wind > + (const #t) > + (lambda () > + (set-network-interface-flags sock "lo" > + (logior IFF_UP IFF_LOOPBACK IFF_RUN= NING))) > + (lambda () > + (close sock))))) Rather =E2=80=98set-loopback-interface-up=E2=80=99, by analogy with =E2=80=98set-network-interface-up=E2=80=99. Also please add a docstring an= y maybe a unit test, if possible. > +;; TODO: verify these constants are correct on platforms other than x86-= 64 > +(define ADDR_NO_RANDOMIZE #x0040000) > +(define UNAME26 #x0020000) > +(define PER_LINUX32 #x0008) > + > +(define personality > + (let ((proc (syscall->procedure int "personality" `(,unsigned-long)))) > + (lambda (persona) > + (let-values (((ret err) (proc persona))) > + (if (=3D -1 ret) > + (throw 'system-error "personality" "~A" > + (list (strerror err)) > + (list err)) > + ret))))) Please add a docstring and basic unit test. > +(define setdomainname > + (let ((proc (syscall->procedure int "setdomainname" (list '* int)))) > + (lambda (domain-name) > + (let-values (((ret err) (proc (string->pointer/utf-8 domain-name) > + (bytevector-length (string->utf8 > + domain-name))))) > + (if (=3D -1 ret) > + (throw 'system-error "setdomainname" "~A" > + (list (strerror err)) > + (list err)) > + ret))))) Ditto. Ludo=E2=80=99.