From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EI45BSlMd2JogAEAbAwnHQ (envelope-from ) for ; Sun, 08 May 2022 06:50:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4Aw7BSlMd2Kl/gAA9RJhRA (envelope-from ) for ; Sun, 08 May 2022 06:50:49 +0200 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 C33D92E49 for ; Sun, 8 May 2022 06:50:48 +0200 (CEST) Received: from localhost ([::1]:59422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnYsZ-00058M-W7 for larch@yhetil.org; Sun, 08 May 2022 00:50:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnYrr-00058D-QZ for guix-patches@gnu.org; Sun, 08 May 2022 00:50:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnYrr-0003Xm-G0 for guix-patches@gnu.org; Sun, 08 May 2022 00:50:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnYrr-00009o-6g for guix-patches@gnu.org; Sun, 08 May 2022 00:50:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54846] [PATCH] gnu: linux: Escape the values of string-type kconfig options Resent-From: antlers Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 May 2022 04:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54846 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 54846@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54846-submit@debbugs.gnu.org id=B54846.165198535132669 (code B ref 54846); Sun, 08 May 2022 04:50:03 +0000 Received: (at 54846) by debbugs.gnu.org; 8 May 2022 04:49:11 +0000 Received: from localhost ([127.0.0.1]:53240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnYr1-0008Uq-2x for submit@debbugs.gnu.org; Sun, 08 May 2022 00:49:11 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:33298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnYqy-0008To-Vw for 54846@debbugs.gnu.org; Sun, 08 May 2022 00:49:09 -0400 Received: by mail-pf1-f171.google.com with SMTP id p12so9616949pfn.0 for <54846@debbugs.gnu.org>; Sat, 07 May 2022 21:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=x+VPB5fJFycuZS6c22eGTrEtF17My4hia6xQQBjfIwE=; b=efHOA4JZBSbnYCVAlv1maZ8ecX/FgC9WLARjYccJD3+U9SD1qsYqHgEcWF22eSrpJG 1Al+/643ACVHedwNpNc51p1R8iglVom7gSqqZgD/j6R99546I4KR4bnBe7wYNo/dWRa+ VQUMVEKxWjQja8gz1taZyHuIGWRdHPKhwLEuXWBzl4yzKYnooccwKTTDQ8WTN95kZSHh K1O1qNxr7p/QhlIHwSKyJm4K4DvyI9eBovn0j6nSX1qv1gWqX8vJFAtn0S6eXkmR9vW8 BUisgHaOZIDws8Rp/fnfW35lHtdxBeNxhxNaGJv76jk5njLC7qGi2iycsE3CBmSDRaDC gulw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=x+VPB5fJFycuZS6c22eGTrEtF17My4hia6xQQBjfIwE=; b=LJx5f/iB0pQHVlGRqUVwgk8BLdFqi37q+2DtjrFFbFYw9+riG2YjO51JLmY2CL+OOO v69GMgJDZu94PP2MNU4tqvJAdt5tUNvCTpKVjT4jEXMHuvfAxEKgzs7fwVhQs7UZcRu6 1HO4aSmyTv3GyndpLHxW5gHwJ0Kj3rAtvD3a+XAg1x2wanaoYKYPxZFTY2oPOjwPaqsP Ay8h8kktExSJ54By0e6eTHNA8t/mmZ/9qAY4YZt68JR3Y/26vW8/bQeNXLYmtPqTlCVG 8YuTXeyWgEoXFY5ntOkMhlmVrC77P4lhAos+y1RuDlDkKRukahhGbUjgowh6oyNfA9Ge ppLw== X-Gm-Message-State: AOAM531XtRcs1qLFWNAS0yVZpVsC9JEj+GaCqRB2Qd0cDzo+6A7FVTsG EjqxPjUvGTEP8PXiBJsxVORtCYXTgMquYRsyQH5ggvNe7aI= X-Google-Smtp-Source: ABdhPJzeAl89TMFU5sB1QzYZ3/zqFi3pn4MaLrLmFP1vtPutbUGu9dC36H5oUUIAVDvkhmHCBBWUmtl6zd9no0AoalE= X-Received: by 2002:a05:6a00:1a89:b0:50d:fee4:cdb1 with SMTP id e9-20020a056a001a8900b0050dfee4cdb1mr10508440pfv.85.1651985342588; Sat, 07 May 2022 21:49:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: antlers Date: Sat, 7 May 2022 21:48:06 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651985448; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=x+VPB5fJFycuZS6c22eGTrEtF17My4hia6xQQBjfIwE=; b=GoQmDmORX/xPYO13yA/zx90hQmrb6U/VSeoZA6ii6x1oZ2cpJUFYhX7jNDvHzo9YmS0KvH ubhPsg3a1jQ+M2pibcoVT6jsP77/oS5Mgox6H3BWdQDYJCDlMrH1CP1luX4tt7/p5NWTSE pi11jTkNk6kpf6il75d8hdt4hVVFQ5cT1sSaf+hAhahGBgsDbOZIZ6wkso6jFo+PIym99d xuAjcz+e+offZdOV5TqMXxZMMfWC35SINSEUE6LKmQ3w26Y3FLsJjJDqybPEpnTaRxJrFf +tUQnL4Emt08a/5K/11EJSYNM03BAosd13mpP1Q2Ctweu31Hqt35PIoJ63YIpg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651985448; a=rsa-sha256; cv=none; b=EuKunXLG6v6pIF5TCN25TQvnW3FivDXdO7jj+bHjh3ojQ3u/5Vup9m2AFP5BOMx7uK1g/T 7LEjGn4h0u9nWReYaviPCwvVdlRau8uZzpKSyTPmZYFRtIBR0jXUMrcYaHIykqsqdphcQr 29jJ8pSsbfe14ySYOUmNrE1o4Ox/WF3lSgOXIuTS159BnQfB5IdQuW2JstenL/72l2Ad8a La+/h+YZJOEt0RSRutZH0bWDR79PjLacNeyWO3aTPPQp1+TZPxRfIos+vRZJVkIMOvbMUl 1HBDz9I9YJ1iAU71Dpcb60qns8BCfmeaPFL1jnPzQQy1cY5wRT2GUlXlR3M9mw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=efHOA4JZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 5.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=efHOA4JZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: C33D92E49 X-Spam-Score: 5.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4QgsU7WFL5ID Hi! Still a busy week, working retail will do that, but this investigation has been on the back burner long enough that it's become clear; the kernel provides no reliable heuristic for determining the appropriate escapes for a given option (least of all for out-of-tree modules). Some options are explicitly expanded in Makefiles, others aren't but become parts of filenames which are, and every special character seems to create a syntax error on a whole new layer :c I'm short on time to write anything up tonight, but have explored the 'behavior of', 'supported escapes within', and 'unsupported characters of' CONFIG_SYSTEM_*_KEYS, CONFIG_CMDLINE, CONFIG_LOCALVERSION, and CONFIG_DEFAULT_HOSTNAME (complete with associated errors for unsupported chars within the set I initially referenced), and would be glad to follow up with a brief summary purely for posterity; but there's simply no elegant or complete approach unless this were to be addressed by upstream(s). It's clearly peeved of me, and I'd take it to those Makefiles, but for similar issues in out-of-tree modules that I don't think I could address. It's been a lot of fun though. I suppose we could factor out the escapes which are common to all fields (which could be seen as eliminating /a/ layer, that of Kconfig/conf.c itself), or address only specific common options (not a serious suggestion!), but these each feel like inelegant solutions which are more likely to introduce additional confusion when an option doesn't behave correctly as transcribed out of a .config file, hence my all-or-nothing mindset. While I'm here, I once wrote a bash script which would set options via the kernel's 'config' utility (not worth using over the existing method of appending to .config, doesn't do any validation), and was having issues with some configurations because not every option I tried to set had it's dependency clauses satisfied. This isn't an issue when using menuconfig because options don't even appear until their dependencies are satisfied, but scripts can't tell whether the options they're setting are visible. At the time I just had it double-check after a run of `make oldconfig` (when validation is actually done) and emit warnings. I'm not confident that it caught every issue by just using the 'config' utility or grepping .config, but it was good enough. Now, I've got this crazy idea to compile conf.c as a shared library and link against it at runtime via Guile's FFI, in order to a) learn how that works(!), and b) use the kernels own utilities to reconstruct the options-graph (a 'menu' object) and emit correct warnings when setting options that aren't visible, or even actively ensure dependencies are satisfied. In brief, would this be Guix-y?