From debbugs-submit-bounces@debbugs.gnu.org Sun May 08 00:49:11 2022 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: Subject: Re: bug#54846: [PATCH] gnu: linux: Escape the values of string-type kconfig options To: 54846@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54846 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: -1.0 (-) 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?