From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OApRFwBHCmSDMAEASxT56A (envelope-from ) for ; Thu, 09 Mar 2023 21:52:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cN46FwBHCmT7XQEAauVa8A (envelope-from ) for ; Thu, 09 Mar 2023 21:52:16 +0100 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 24D083E38B for ; Thu, 9 Mar 2023 21:52:15 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=wTbV54B2; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-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=1678395136; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=+0jlHeSfF5ukmCnk1AuS9nrkYgnS2awRYVrGWtso4cg=; b=FfcQ/qrL0CXweEHb4D2fYi5+BrORJA5GschfWRZjku5HTmM3FgG3qPolTdW59BK/04nt1w yZBYrHuGERBXcQ60pGkHRYbuavQKIJkPs+eqsAhEGNl9oqkNfrmZy3u5yibW71hWmeI/p9 aeYis+bMUyf7NTx94QrckrUgRvRRIa9+RO+oo3anwkHyyEcFFH0dqq4qmGJaORQ4JQbY5m gipqNd3KTGy7fx+VmiehRMRn69+jB6PIdfePPemdOetMpqdLN4lGyPfBZDhsRADz3NAbwB BVAjcMzo8PZbbLlybQJc7/MxU/6QzcVr90mWkTRomar0BF+WYCisZDSlsBO/dg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678395136; a=rsa-sha256; cv=none; b=cMZxubFt+yPB7ksQZTXQM+OjUh+BW3EYr07zcD9OtAVbFdVYV+d0GF46IZw4W7qK/g1xsp 4vBjjVj7t1pDiC+dK68cdL2qj7beDL9Xjf/sIO5va3cJTVCLKG46VqmYwUVQxK/x58Nfr8 NN7ZQi8N9gB5/SLFylU+rbEpNtHhhaNrNxEdJM+M7QlmVkwBWqXFkkCxlM5HMVsjrkCoAv 2GfnMFm47sXsjxR/8ca01bWgD/IKsg61H9V2EQu+9E2en5iB/6xGaEe9XPslDe64u93r2Y DIZY+nZYrjisDQ4aYCgySm2cXDvc59C/P4Rk40y7/PZCyhT5Ud3w8sV0vdCaMQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=wTbV54B2; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paNF6-0001JY-6e; Thu, 09 Mar 2023 15:52:04 -0500 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 1paNF4-0001J7-AP for bug-guix@gnu.org; Thu, 09 Mar 2023 15:52:02 -0500 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 1paNF4-0000SX-24 for bug-guix@gnu.org; Thu, 09 Mar 2023 15:52:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1paNF3-00059x-Oy for bug-guix@gnu.org; Thu, 09 Mar 2023 15:52:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#62051: Early detection of derivations with unreadable builder scripts Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 09 Mar 2023 20:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62051 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Christopher Baines , 62051@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 62051-submit@debbugs.gnu.org id=B62051.167839512019826 (code B ref 62051); Thu, 09 Mar 2023 20:52:01 +0000 Received: (at 62051) by debbugs.gnu.org; 9 Mar 2023 20:52:00 +0000 Received: from localhost ([127.0.0.1]:53188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paNF1-00059h-Pz for submit@debbugs.gnu.org; Thu, 09 Mar 2023 15:52:00 -0500 Received: from jpoiret.xyz ([206.189.101.64]:45626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paNEz-00059Z-9Z for 62051@debbugs.gnu.org; Thu, 09 Mar 2023 15:51:57 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 4E33F18530D; Thu, 9 Mar 2023 20:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1678395115; 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: in-reply-to:in-reply-to:references:references; bh=+0jlHeSfF5ukmCnk1AuS9nrkYgnS2awRYVrGWtso4cg=; b=wTbV54B2Bs0M96vOu8FjdFFKfQhLaHjznptsDs6vkg5999ePVL9KVBx3yqT5rZqUvG/JJB BERju1DparvRsP98XbfqBVorcNggLjLWzPbOoMWrkUPwevUdR48FdW70ySVelctsCENt4k MZoSQQk1vTME7jjHwx92Hbvy1GmrDiMz2WV8BZmXyqHCrcFFz1387x+5Pe7qvhzzsDtMDw 77lRBxSFJGDJgH7gKwF/AOz0Sadk6fIR2TLP548OKLlCWGwzxcd2928Ps6T8wwEg7kyUNy tBH51jukya8xKv5TMqzgrOB9dnPY+4flCmMKDKXLgWTiUaYWkgAJMCMzMD8soA== In-Reply-To: <87bkl3qovn.fsf@cbaines.net> References: <87bkl3qovn.fsf@cbaines.net> Date: Thu, 09 Mar 2023 21:51:51 +0100 Message-ID: <875yb9d4wo.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Josselin Poiret X-Migadu-Scanner: scn0.migadu.com X-Migadu-Queue-Id: 24D083E38B X-Spam-Score: -4.30 X-Migadu-Spam-Score: -4.30 From: Josselin Poiret via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: TUBieFL8V0me --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Chris, Christopher Baines writes: > This is part of the following builder script: > > (cons "--enable-mpi-java" #) > > from: /gnu/store/yngxnpcs4s6y8acxf4nwx5pcpj0j6q6i-java-openmpi-4.1.4-buil= der > > And when attempting to build that derivation, you get the following > error. > > ice-9/read.scm:126:4: In procedure read-expr*: > /gnu/store/yngxnpcs4s6y8acxf4nwx5pcpj0j6q6i-java-openmpi-4.1.4-builder:= 1:3820: Unknown # object: "#<" > > > It would be nice if Guix could detect this category of problems and > raise an error at the time the derivation is created, rather than the > error occuring only when you build the derivation. > > This would be helpful particularly for the Guix Data Service since > currently it ends up storing these useless derivations, often many times > since the builder includes some often changing string (7f366e0cd930 in > the example above), so this is a common cause of spurious changes > between revisions (as often noted on qa.guix.gnu.org). We could probably modify sexp->string, or the builder bind in gexp->derivation so that the sexp is sanity-checked for non-printable things (we could even work on a whitelist basis). However, the docstring of sexp->string talks about performance, and indeed "write" is pure C code and very fast. I'd be reluctant to introduce a performance hit that would be too heavy here. This particular example though was caused by non-gexp #:phase arguments, so another option could be to sanity check sexps given to sexp->gexp, but again, the docstring talks about performance, so I'm not sure what we should do here. In general, things written only with G-Exps should work well, because you can't insert random stuff into them, but S-Exps are more dangerous, hence why I think this option would be a better middle ground. Paging Ludo wrt. the performance cost of this (I can write a patch for it adding a whitelist of what is allowed in a sexp->gexp sexp). Best, =2D-=20 Josselin Poiret --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmQKRucQHGRldkBqcG9p cmV0Lnh5egAKCRBQXkC5FhcairF2C/9DvmsylO9Z3Or/uXSpK0KU0N4PHAPtct66 NvokIcLbmrtkJGVKhGU2iNPeRrbxhYr60NOo2ESU/HifFWAqun3PKLaHDEZv/R+F +X7B0Wo8/NxtjpLr1iHKU5Q7tKoVXWIO4KuQPmgPLJ7P1Tw2FNWJiNZPsbxixZBV 89XWrYjXNHMKh8SBhnWJq1lyWQH/tQNcNI2l9DDLvxh0z28oWZFASbj3WO8BOxzm TLaFzPopM9iQ76eeUVbY0RjsGtSiBG2eatB7iJxFFio3SwA7YeqjlQR5+K2/MV/f I/SPxyQa5voW5X4pasZtd4tNS8PYXervrmWZeNjPMYCbjAQ+ZtXX2LVbQi6KjR89 wI8DxL2apSopg6j4kZ8COEXtSJLwqDjiiVbJJ/ZDj0qnaiKWSMB1FR7elR+JqcmZ xUoezWj8BgCkmPxzlwfYKf8UxexfI+mwGuUc3l7bmF4xCeqqIjLVn7FOuJYEgrRv rJ2m1Hdj/5cT+UzuwHxJtRoQZmlrSg4= =29Ui -----END PGP SIGNATURE----- --=-=-=--