Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B33E0C433F5 for ; Fri, 22 Oct 2021 06:41:22 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 84B9C60F50 for ; Fri, 22 Oct 2021 06:41:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 84B9C60F50 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=prevas.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9496383459; Fri, 22 Oct 2021 08:41:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="DpSG+qra"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7EDC3831CA; Fri, 22 Oct 2021 08:41:15 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0719.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::719]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DB8B083423 for ; Fri, 22 Oct 2021 08:41:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LrQnliLaXUrznS6U3sciqykaMsAmrJlCSaZ4gdAiHhVcIgJHgCJNBilbPlcolEm7HeTEeMt5pQaXtQpOKQjkfBYk1Gq+8cmIx2GibMiXRQQgEquQ7wAereyBZZ5lJvsU2RPHv293kXBi5xBMmmqEhO3WwMHyQIA4FxJqXshOpp96DVthMwxKQml/FG+O6+qnAcC3N+S0JVc1GrGT+/YrdcM6fwGHV4j6VxuayDnLw2KmwEhxTCzMMtQ5O8XtnZ/MbLPgUeZvdVB38pFgvSeZWkN11Xp75WGgX2vzPlt+CdARa/vyacwhAQtXLIa6nszXCvlhYQfdWHJgApPEY1Q+fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0uhpyoF0TEVAoX5FdOdhSg5nyI4lnywbvJJlj4Xjn/Q=; b=dT4zv/86Qzv2whmoh6N6WbqVqFEdFZmOEee3/Rl9cu3dJ26mNDbGTrxq3bKgo9Hg2vsNealIHJt7rrkkf+wYJWlAmzWJdR0NsQ2V1aoaWz0z890w3JtnSA6eiNnJ2S+rFEyEGDY94LuwownikoDlhmiQWl+09gzZ/cPdSMl0QXDF7HaKl1ERG0ymOtHdbnZFRXctaJLrKdzd5btEhRsbavIEixvJWdsui0v4xRb0HGwKg/KYL2SfEiKsOQYpimvDM3E/cKv73VOM9wtq4zq87sQmh2M0QkJFwMEWrH32GEb3PDWCeBlrA/ZEL7eZKoIpwWi+aSbRdLqNpjQUPnpqDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0uhpyoF0TEVAoX5FdOdhSg5nyI4lnywbvJJlj4Xjn/Q=; b=DpSG+qraCH2icWR1O8Xicagm0Rc1Rcw6tCTkFn+wv8ebQXlD6Ae0VZPw4IyN/G1TJ0vl+SozniJK5Kh1Zw78AT0V+5siH8QT4ShrOrrKDWJ2vv/0KFutb3Hm8/zO6rqKCIEbZM+anUF0w+B/ikhITl/ke/cV3cFLV19IDpuMliA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=prevas.dk; Received: from HE1PR1001MB1355.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:3:f5::16) by HE1PR1001MB1067.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:3:6f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Fri, 22 Oct 2021 06:41:03 +0000 Received: from HE1PR1001MB1355.EURPRD10.PROD.OUTLOOK.COM ([fe80::1574:9b9b:be30:c18d]) by HE1PR1001MB1355.EURPRD10.PROD.OUTLOOK.COM ([fe80::1574:9b9b:be30:c18d%12]) with mapi id 15.20.4608.018; Fri, 22 Oct 2021 06:41:02 +0000 Subject: Re: [PATCH v9 3/7] env: Allow U-Boot scripts to be placed in a .env file To: Tom Rini , Simon Glass Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , Wolfgang Denk , U-Boot Mailing List , Heinrich Schuchardt , Joe Hershberger References: <20211019224422.1447059-1-sjg@chromium.org> <20211019164418.v9.3.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid> <3682215.1634809802@gemini.denx.de> <20211021122325.GX7964@bill-the-cat> <3695947.1634821611@gemini.denx.de> <20211021152537.441c37b9@thinkpad> <20211021152831.15524883@thinkpad> <20211021160311.GC3577824@bill-the-cat> From: Rasmus Villemoes Message-ID: <4a7d69cd-b4d0-779d-d3f3-2ddfc3e15d27@prevas.dk> Date: Fri, 22 Oct 2021 08:40:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <20211021160311.GC3577824@bill-the-cat> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: HE1P18901CA0016.EURP189.PROD.OUTLOOK.COM (2603:10a6:3:8b::26) To HE1PR1001MB1355.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:3:f5::16) MIME-Version: 1.0 Received: from [192.168.1.149] (80.208.69.72) by HE1P18901CA0016.EURP189.PROD.OUTLOOK.COM (2603:10a6:3:8b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Fri, 22 Oct 2021 06:41:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b2bc33d-f042-4a87-0134-08d99526ea93 X-MS-TrafficTypeDiagnostic: HE1PR1001MB1067: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +lvgS2YWCjOw+UOQl2ptAdC0aWPC2OELHgUJz3cO9pXKocvzUBdWflAkt/BBDSs8uaFeaHae+yYEVPWyuzdfZba+JUIWZK7/WR2LDfNTQ1BPOmGWoEHniy3OwOiQcgVv+BEKC07iSbgvJ+3e7QTJb7RnnVx/9lwJz1Vfn7OL7/B1xR44RTmGROvCmssC7iseMJWI8CNgTv9txC72zBv8zTVPW7yP3EdylCy/hTm6AKp43CbNaVdun9jK5mZUby0d6YKFAR2cTtY/pVSpr8Ls0LnXAA5QQuz+3iqWZQ3so2smp19qophgdU6+bPG344EYFhCQtTROl1eyE31M3rQvhbWz31vppbOitiDcRasbdJgUvyp6rjYq82fW/qUh/R45NSATecuI2x00VPJlONDRMYdLUWF/8mfIJ7sd1KgftAC0rWSbRhhB5xvSb3/q/5vWPZHRIKKvMxXUMj3YHW7MtN89Zn1ut4D7m+f62Puk37P9Xjqf613Fq+3akk85vZx6IuAu0apo5Yfy4Op21pFHdkCW9DaLUhTn6MreAHBRlCXwaQM4MNzugagkQIxIAm8QoGgMh+U7WADucbXWKcYXZ+JhK2YKKmg9F0QWhFw6ahCNofsDmNOZjIwdXbkHFO81+OVouiDrO/rUzV36mo5IMy1Jnj+V9AtT4KrREYwaMhA4fMG4PHQ6PDb7RySSpigk+t3EnMgRPdxaawXjoSVcbo+5jaOjD+o1CZ762NZE+xoXbwOJRqB5o0jLG2GxNMoKOClBZba097KZqe6eUY+73qLNTJFCHiQQB5QZvoCnhvs= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HE1PR1001MB1355.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(366004)(8676002)(4326008)(6486002)(38350700002)(110136005)(31686004)(44832011)(52116002)(38100700002)(8936002)(6666004)(86362001)(54906003)(316002)(16576012)(66574015)(508600001)(5660300002)(66556008)(956004)(31696002)(8976002)(66476007)(26005)(186003)(36756003)(66946007)(2616005)(83380400001)(2906002)(142923001)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?Windows-1252?Q?g9q+bkZnygO8n6vq/u13Gz6FYVJVWOGBY8U9PrwoxoA7N7ddVaaiGiNt?= =?Windows-1252?Q?foY0LajqwxZ0Q5sJwt7AOVt/7mwMwS13pI1mZS64REoQFkhtEh85yBT8?= =?Windows-1252?Q?iwnYZ0fiLAxXydPenNKXjj1kX/GkJvUZi3dZd4WWMZUyV0N048tkzo6C?= =?Windows-1252?Q?wdgn9pfoNwWKX1UVL5iy35qYlyKXu2PiuaUQfKyFfl9+I1MuRku1FZ5f?= =?Windows-1252?Q?G2C1khqllqt6PyPL8kbLUIF5BKvkqHQaA+jAGNJAho/FfhAW1iVtwLoB?= =?Windows-1252?Q?ZEs0BnoNnspBU3Tm6bKaSuaNRZ5yjlh32FwPfCNIdZBPYkLqrd4Xlcy+?= =?Windows-1252?Q?0tDFC7y0QoIOV1ljCCyxRy7kNEyxVs9Ksg6OZLnOTU1nhr+KMOT6efQT?= =?Windows-1252?Q?IFX/9PimhIoWmb9RBKXkqre/2/d23OvqFAYMK8GXfgfR9yVSsYmUMMov?= =?Windows-1252?Q?Bw0pHtAq3EzhVQZUADm6s8w0YYYC9+9IVsHZKo7DIUTKHuo/YLnYa818?= =?Windows-1252?Q?9VwmZzIb4WwKnZNc3umDoEDOM6tszt1smkhT4pnxXcUY8ZQ8WvSYW7vR?= =?Windows-1252?Q?tY5FRvLF8Jr0ZZW1QMEEsvS60mtjKXdOAYk4FCtPhzUS489lOUizvBE6?= =?Windows-1252?Q?W59YvrZTRazhp7rdPPxGqdUUelUEEfPutUu4KKTumycuBPqyKc9cGBHf?= =?Windows-1252?Q?R/aMUd2NL4pOqAjeFLLeAUkxPaM0TzIawRqZO0EitLRaSXtjNu1Cmnft?= =?Windows-1252?Q?p7LXwyCWEB+1q62BCIvTMB40CaeWHksb0Q1mSKeJ0LTouHC1I33L9Egs?= =?Windows-1252?Q?uQZSQR3hqMY09zWxOyouuExlCQxCh18DPrLjsntcF2fqKIjBifacyen2?= =?Windows-1252?Q?Gk7SFkucK+UNcIKy3MMxqPIz9Ysi0Z0o2nXzhxrWPWtWOjxFaIW3jItY?= =?Windows-1252?Q?j0D93RJzFkCCLUqhkIwZP+dTrLfWFKar0MOj1Boav/uZKNf0FSZKLAyJ?= =?Windows-1252?Q?2qjWcDS4G7Bp2EebX8j/I1rgrPpywnZTMq7aESKUkxFb8a6pDeLGpoRt?= =?Windows-1252?Q?+FlJOjyfZXhcyngmgHBVzhRE366Gioze5bUP6DLz+dOuER4Z6QgvhAY0?= =?Windows-1252?Q?8eKGZT0DtNMHtdaoCPVjKpcX+LXK6+MwRfQwun+Ud4B/4r68jTdgMGLO?= =?Windows-1252?Q?UhFabIWVYKzZI7CJdqWxA9sqMhDaSFGmI0qVQWJWkwqUkwIP1I9R3I68?= =?Windows-1252?Q?9Kqkem8hy32iZFjc0kTmU1Ch9WSpeyY1NbD4l6UTn2DRUndAb64aXSy5?= =?Windows-1252?Q?JicZT2t6dGchXEmG6eIidbjckv00Mc8YnF/yyD5gUgcou/W65sVxludM?= =?Windows-1252?Q?x4zYzeohP4AwPYOa+4UiGmU9uu2uQod43Ep7+4j9oaz2XVD/pm87OGBz?= =?Windows-1252?Q?trVtNYh6zXcbkamB4OLrZrnsHAnPO6DQpuiRziam9GwvLDN3ObxIpIWs?= =?Windows-1252?Q?RNAM+0KEJb4WHoP18s2EQB9WBwijD7XMLJ1dMWPexX+E8tXcjsTlL6Op?= =?Windows-1252?Q?gZfrhlBgHGVL2zrQ?= X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 2b2bc33d-f042-4a87-0134-08d99526ea93 X-MS-Exchange-CrossTenant-AuthSource: HE1PR1001MB1355.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2021 06:41:02.8073 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Rasmus.Villemoes@prevas.dk X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR1001MB1067 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 21/10/2021 18.03, Tom Rini wrote: > On Thu, Oct 21, 2021 at 09:59:38AM -0600, Simon Glass wrote: >> Hi Marek, >> >> On Thu, 21 Oct 2021 at 07:28, Marek Behún wrote: >>> >>> On Thu, 21 Oct 2021 15:25:37 +0200 >>> Marek Behún wrote: >>> >>>> Hello, >>>> >>>> On Thu, 21 Oct 2021 15:06:51 +0200 >>>> Wolfgang Denk wrote: >>>> >>>>> I confirm that '+=' looks better. But '+=" is technically broken. >>>> >>>> a bit of my opinion: >>>> I think =+ will confuse far more people than + as last character of var >>>> name working weirdly. But I also think that + should be supported as >>>> last character. Therefore I propose backslash escaping in variable name, >>>> i.e. >>>> var+=value >>>> appends value to var, while >>>> var\+=value >>>> sets variable with name "var+" >> >> My first preference is to disallow + at the end of an end var. Perhaps >> we can start printing a warning if people do it, for a few releases. >> >> My distance second preference is what Marek has here, using a >> backslash to escape the + character. > > How bad does it make the parser look if we allow trailing + in variable > names, by escaping them? It's seemingly the substantive objection at > this point. > So I don't understand all the bruhahaha around a + at the end of the varname. Nobody suggests (that I have seen) changing anything about how U-Boot at runtime interprets and handles variables, so all variable names that used to be valid continue to be so. It's just that this _new_ method of generating the environment places certain restrictions on what can be done. The old-fashioned ways (mkenvimage, good'ol CONFIG_ENV_EXTRA_SETTINGS with all its warts, and run-time 'env set') continue to allow people to define whatever env vars they want. This new method is meant for transitioning in-tree boards' default environment, and no in-tree boards need anything exotic. Also, completely independent of whether the subsequent parser is implemented in awk or python or rust, or what syntax it accepts and the semantics of that syntax, the fact that we first pass the input through cpp already means some things just won't work the same way as when given to mkenvimage, and that applies to both sides of the =: printf 'x/* huh */y=/* where did this go ? */\nmsg=I like unix\nfive spaces=5spaces\n' | gcc -E -P -x assembler-with-cpp - x y= msg=I like 1 five spaces=5spaces [In case its broken by the email, there are actually five spaces in the printf string between the words "five" and "spaces", the above should illustrate that cpp collapses those to a single space]. So, I'd much rather we do a cleaner break, and accept (and ignore) whitespace on either side of the assignment operator - that's how Make variable assignments work IIRC. And since a lot of people making use of this will already be familiar with Yocto, I think we should have two compound assignment operators, .= and +=. That still allows one to use any non-whitespace, non-= characters (modulo the restrictions imposed by the whole thing passing through cpp) in variable names, so foo+=abc means foo+ = abc while could append to foo by saying foo += abc That whitespace around the assignment operators would also make the input files somewhat more readable - there really is no point in having human-readable, human-editable text files having a format almost-but-not-quite be that of the on-disk format. Rasmus