From nobody Thu May 11 13:22:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QHCJ71DYJz4BDqG for ; Thu, 11 May 2023 13:23:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QHCJ671w1z4F0t for ; Thu, 11 May 2023 13:23:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9661a1ff1e9so963591566b.1 for ; Thu, 11 May 2023 06:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1683811381; x=1686403381; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NGKBBacg1IJsmR/esSasiQf1OjopprxS/1WyzmALvO0=; b=b6C+Cnrg07G86DCnSmkIhIa4i0xZ1RjgmR9tL1S0FesHYrmJUAMLKlBMaYgro1dpiU 3elpEKnP7d3QqFrJvO5Z8z4uCco/lk0b1EFm5ucwNOupP20nMw5sqWvue74OA3FPP0PD tL6nZT7LppBS8zw+cGaTuSofQyO+HhNIeig6Qu0EFzBkuHh3TpzvWBTcr+GadF88DvEc tp9DbRpIAKBwROJbqHhd03DHaTYFyH0PVt2dgnpfXgNZY23Jf8e/OmOTHzZ62CoI1Frm OCZ/y5UMyWn2Da4dGsqgryGaV5QTy7z9Yh65lAjmRiQy4EbXozrGT+fV2QRvZ5+ghJcY uylg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683811381; x=1686403381; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NGKBBacg1IJsmR/esSasiQf1OjopprxS/1WyzmALvO0=; b=LizcOC38URtL/HMJLqrYbNCMZmc3lDDW6jbzUfVFQjFlKhI0o6BfkQ5c0Ns/GrB3t1 wSmLe7k/ed3oY2RZGvtwAdw+emK8uBCrfwjyCgPDY/0PB1Vz7ScwPbumU2zcSMlmFZVp USj84BY/7viF3r0hslDQ0RWItjum9Ys36BqvmIhJ/1r87qMwuFlaIyO2AIzxtvEFSbSu 6X5JEp2lp/YAiiBbxJMPziLLp8kQ9mXmhv8K66UWVJvi+H8Nmaoe2PELM1fnaJQey1q7 mqs5QrrJ33fRDFjONYhvn/JY5TRfigsKg9l/SIMUq8rThngA51+Cu/B69gUiFgBC0JH6 g/DQ== X-Gm-Message-State: AC+VfDz3BCeRzanZ2xUlxi2b3E60ldTC6VYHBjPJmDeLVX9vjUzjpmix 5x59U1z1iLHuMdpqpYmiRv4UXr0mbM8fWPI51ljcmA== X-Google-Smtp-Source: ACHHUZ4voqroGZ8xEarO6vVj7SqeNxkCpBMGizifBXo4UX+chdFiNOy7Z2v3Lp4QirKw0woRkYTC+8JfU7L2/5olkz0= X-Received: by 2002:a17:907:36c3:b0:96a:3811:f589 with SMTP id bj3-20020a17090736c300b0096a3811f589mr4630787ejc.10.1683811380870; Thu, 11 May 2023 06:23:00 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202305110411.34B4BFEE047146@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 11 May 2023 07:22:49 -0600 Message-ID: Subject: Re: git: 3cb2f5f369ec - main - lualoader: add support for .lua configuration files To: Mark Johnston Cc: Kyle Evans , src-committers , "" , "" Content-Type: multipart/alternative; boundary="00000000000039d63305fb6ae35c" X-Rspamd-Queue-Id: 4QHCJ671w1z4F0t X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000039d63305fb6ae35c Content-Type: text/plain; charset="UTF-8" On Thu, May 11, 2023, 7:19 AM Mark Johnston wrote: > On Thu, May 11, 2023 at 04:11:15AM +0000, Kyle Evans wrote: > > The branch main has been updated by kevans: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3cb2f5f369ecfd6d15aeff2b47e21866551a20de > > > > commit 3cb2f5f369ecfd6d15aeff2b47e21866551a20de > > Author: Kyle Evans > > AuthorDate: 2023-05-11 04:10:53 +0000 > > Commit: Kyle Evans > > CommitDate: 2023-05-11 04:10:53 +0000 > > > > lualoader: add support for .lua configuration files > > > > If a file is specified in loader_conf_files that ends in '.lua', > lualoader > > will now load and execute that file. These may be used in place of a > > traditional loader.conf to use more complicated logic, where some > values > > may be set based on others or based on the environment that the C > bits has > > left us with. > > > > Lua scripts are run in a limited environment. In particular, it does > not get > > access to any modules or, in-fact, anything except environment > variable. > > > > A config.buildenv hook has been added so that a local module can add > > whatever it may need to to the environment. > > > > When a global var is set in the lua script, it does not immediately > alter > > the loader environment. Instead, the script's environment is > initially > > empty and processed only if the whole script executes successfully. > > Effectively, a lua configuration file either takes effect or it does > not, > > an error will not leave it in a half-baked state. > > > > Reviewed by: bcr (manpages), imp > > Differential Revision: https://reviews.freebsd.org/D28450 > > Should this be in RELNOTES? It seems like a very useful feature. > Yes.... unless Kyle objects :) Warner > --00000000000039d63305fb6ae35c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, May 11, 2023, 7:19 AM Mark Johnston <markj@freebsd.org> wrote:
On Thu, May 11, 2023 at 04:11:15AM +0000, Kyle= Evans wrote:
> The branch main has been updated by kevans:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D3cb2f5f369ecfd6d15aeff2b47e218= 66551a20de
>
> commit 3cb2f5f369ecfd6d15aeff2b47e21866551a20de
> Author:=C2=A0 =C2=A0 =C2=A0Kyle Evans <kevans@FreeBSD.org>
> AuthorDate: 2023-05-11 04:10:53 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Kyle Evans <kevans@FreeBSD.org>
> CommitDate: 2023-05-11 04:10:53 +0000
>
>=C2=A0 =C2=A0 =C2=A0lualoader: add support for .lua configuration files=
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0If a file is specified in loader_conf_files that en= ds in '.lua', lualoader
>=C2=A0 =C2=A0 =C2=A0will now load and execute that file. These may be u= sed in place of a
>=C2=A0 =C2=A0 =C2=A0traditional loader.conf to use more complicated log= ic, where some values
>=C2=A0 =C2=A0 =C2=A0may be set based on others or based on the environm= ent that the C bits has
>=C2=A0 =C2=A0 =C2=A0left us with.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Lua scripts are run in a limited environment. In pa= rticular, it does not get
>=C2=A0 =C2=A0 =C2=A0access to any modules or, in-fact, anything except = environment variable.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0A config.buildenv hook has been added so that a loc= al module can add
>=C2=A0 =C2=A0 =C2=A0whatever it may need to to the environment.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0When a global var is set in the lua script, it does= not immediately alter
>=C2=A0 =C2=A0 =C2=A0the loader environment. Instead, the script's e= nvironment is initially
>=C2=A0 =C2=A0 =C2=A0empty and processed only if the whole script execut= es successfully.
>=C2=A0 =C2=A0 =C2=A0Effectively, a lua configuration file either takes = effect or it does not,
>=C2=A0 =C2=A0 =C2=A0an error will not leave it in a half-baked state. >=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 bcr (manpages), imp
>=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 ht= tps://reviews.freebsd.org/D28450

Should this be in RELNOTES?=C2=A0 It seems like a very useful feature.
<= /blockquote>

Yes..= .. unless Kyle objects :)

Warner
--00000000000039d63305fb6ae35c--