Date: Thu, 11 May 2023 11:17:28 -0500 From: Kyle Evans <kevans@freebsd.org> To: Warner Losh <imp@bsdimp.com> Cc: Mark Johnston <markj@freebsd.org>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org> Subject: Re: git: 3cb2f5f369ec - main - lualoader: add support for .lua configuration files Message-ID: <CACNAnaHtEn6edEosvAGH7d47f3wXLU3M1tHYtTnzns5n%2BEPVYA@mail.gmail.com> In-Reply-To: <CANCZdfrcggo-mto5pcGP%2B%2B1QwLGuO2RUdPs3BfG80xP4uTXHQQ@mail.gmail.com> References: <202305110411.34B4BFEE047146@gitrepo.freebsd.org> <ZFzrU2doEG3DZKrb@nuc> <CANCZdfrcggo-mto5pcGP%2B%2B1QwLGuO2RUdPs3BfG80xP4uTXHQQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 11, 2023 at 8:23=E2=80=AFAM Warner Losh <imp@bsdimp.com> wrote: > > > > 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=3D3cb2f5f369ecfd6d15aeff2= b47e21866551a20de >> > >> > commit 3cb2f5f369ecfd6d15aeff2b47e21866551a20de >> > Author: Kyle Evans <kevans@FreeBSD.org> >> > AuthorDate: 2023-05-11 04:10:53 +0000 >> > Commit: Kyle Evans <kevans@FreeBSD.org> >> > 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', l= ualoader >> > 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 do= es not get >> > access to any modules or, in-fact, anything except environment var= iable. >> > >> > A config.buildenv hook has been added so that a local module can a= dd >> > whatever it may need to to the environment. >> > >> > When a global var is set in the lua script, it does not immediatel= y alter >> > the loader environment. Instead, the script's environment is initi= ally >> > empty and processed only if the whole script executes successfully= . >> > Effectively, a lua configuration file either takes effect or it do= es 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 :) > Ah, yeah, that's a good idea. I wrote a pitch here: https://reviews.freebsd.org/D40066
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaHtEn6edEosvAGH7d47f3wXLU3M1tHYtTnzns5n%2BEPVYA>