From unknown Fri Jun 13 10:54:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62051: Early detection of derivations with unreadable builder scripts Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 08 Mar 2023 14:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62051 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62051@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167828700123250 (code B ref -1); Wed, 08 Mar 2023 14:50:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Mar 2023 14:50:01 +0000 Received: from localhost ([127.0.0.1]:48153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZv7A-00062v-PD for submit@debbugs.gnu.org; Wed, 08 Mar 2023 09:50:01 -0500 Received: from lists.gnu.org ([209.51.188.17]:57738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZv79-00062n-Jr for submit@debbugs.gnu.org; Wed, 08 Mar 2023 09:49:59 -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 1pZv78-00048c-UL for bug-guix@gnu.org; Wed, 08 Mar 2023 09:49:59 -0500 Received: from mira.cbaines.net ([212.71.252.8]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZv75-0005E3-Tz for bug-guix@gnu.org; Wed, 08 Mar 2023 09:49:58 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id 52F7E16DDD for ; Wed, 8 Mar 2023 14:49:52 +0000 (GMT) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 8b9c37cd for ; Wed, 8 Mar 2023 14:49:51 +0000 (UTC) User-agent: mu4e 1.8.13; emacs 28.2 From: Christopher Baines Date: Wed, 08 Mar 2023 14:41:55 +0000 Message-ID: <87bkl3qovn.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Currently it's quite easy to end up with packages that have builder scripts that can't be read by Guile. This is part of the following builder script: (cons "--enable-mpi-java" #) from: /gnu/store/yngxnpcs4s6y8acxf4nwx5pcpj0j6q6i-java-openmpi-4.1.4-builder 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). --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmQIoIxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XdG9hAAnMc4vEW/M14zVU7wYxZjY5TBwPQrMQrK kNv6pWdeXMcF7HZBntO+mdO6KEpS7XpplP4GrT/dwFgVdYSNr3c0G0SQLB1CTRUa ya+6Bwo29wC3+eRIEJ5mURNp1htplThcUBPRmBkTP/A+Nv3pbds01dtH+UenkaAW k7/AEPEwDGYihl6WeE00A0Kk7dHvMbb6yIx68aeXzW5sS/Kx3LTzqJRGX+2soPlk Gxdp6KJOYvsxgbcMQTAxSIqZVfg4mXlOkKAVKZJprPHgBFfb7oRtZzcfKSQpelFg ZZoacdaZcX5wMrAaWLeysXkGjIKbOvOwGfkj/BdMIbSj2xd0/O6aNNYu+tUwLxi0 zk2fMMBgsJzGFHeklEIWlGFvLa/0gd7mXIVr6xRnA6l28k+VKmWCb9XYZvEkh3HD rS72TiRTwQPr3qc5Mg1pQz8tQiKENvkKYBWcsj/9DdsQMem9Sg/zZnlLRtupnqn0 j/vwfdwd0fG7cj9IFsrIZjuJw2E4c9jWvY8AI4ENOVko06JHwhJ4n/gHLsqcyyKW hmwGdJg83zujDtERePP6o80M5EFdReBZRp2Wm+zcgFpXSeP1nbl+JwGgx7j6k4st NuZw1Qhh5fkKhH9Mx5GMn6QVsDUozL2oNW8ko2azajEHMYKNDb6hah3obQ6sBDAI LZjSO5E6tx8= =TEma -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Jun 13 10:54:39 2025 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== From: Josselin Poiret 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" Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= 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----- --=-=-=--