From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#37388: can lead to syntactically invalid configs Date: Thu, 12 Sep 2019 09:57:13 +0200 Message-ID: <87d0g6q752.fsf@inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56364) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8JzO-00018Z-UW for bug-guix@gnu.org; Thu, 12 Sep 2019 03:58:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8JzO-0002Oe-0x for bug-guix@gnu.org; Thu, 12 Sep 2019 03:58:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34179) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i8JzN-0002Ny-TI for bug-guix@gnu.org; Thu, 12 Sep 2019 03:58:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i8JzN-0004OF-R1 for bug-guix@gnu.org; Thu, 12 Sep 2019 03:58:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:56303) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8Jyg-000154-GD for bug-Guix@gnu.org; Thu, 12 Sep 2019 03:57:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i8Jyg-0001kh-Cy for bug-Guix@gnu.org; Thu, 12 Sep 2019 03:57:18 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=38356 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i8Jye-0003S4-Hb for bug-Guix@gnu.org; Thu, 12 Sep 2019 03:57:17 -0400 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: bug-Guix@gnu.org Hello Guix! It=E2=80=99s nice that we have but I noticed that, un= like most or all other configuration records that we have, it=E2=80=99s possible= to create an record that leads to a syntactically invalid nginx config file. For example, if you have a location block like this: (nginx-location-configuration (uri "/manual/") (body (list "alias /srv/guix-manual"))) Guix will silently create an invalid nginx config file, which you=E2=80=99ll only notice once you=E2=80=99ve reconfigured and nginx fails to start. See why? That=E2=80=99s because we=E2=80=99re missing a semicolon in the = =E2=80=9Calias=E2=80=9D directive, and that directive is spit out directly as is. To address it, we could have record types for , , and all the directives out there; it could be tedious, unless we automate it, effectively creating a complete EDSL. Another approach would be to have an sexp representation of the nginx configuration language. That=E2=80=99d effectively replace semicolons with parentheses :-), but more importantly, that would allow us to not paste strings as-is in the resulting config file. The downside is that it=E2=80= =99s very much =E2=80=9Cfree style=E2=80=9D compared to records, but we could st= ill pattern-match the sexp to validate certain properties. Thoughts? Ludo=E2=80=99.