From owner-freebsd-current@freebsd.org Mon Feb 11 15:21:52 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA5AF14D9D72 for ; Mon, 11 Feb 2019 15:21:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EC0B7229F for ; Mon, 11 Feb 2019 15:21:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 003518896 for ; Mon, 11 Feb 2019 15:21:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f181.google.com with SMTP id g11-v6so9127511ljk.3 for ; Mon, 11 Feb 2019 07:21:51 -0800 (PST) X-Gm-Message-State: AHQUAuYu0a+9yyaEfxF/f4AoAA3Errk8zWZoYU0VecPnhbmYklqGB+sW X4mSAZtE3xVrH593UMYMBqAdji4ABjSwW+St7no= X-Google-Smtp-Source: AHgI3IbZLqDzCufomUWWuqZbBpxqnyfbBc9orpTSuSVdpnbD54xBw1rokiYdef61xQESOYNVuLccqay7gTkP/a+2DA0= X-Received: by 2002:a2e:9b52:: with SMTP id o18-v6mr21425720ljj.108.1549898510234; Mon, 11 Feb 2019 07:21:50 -0800 (PST) MIME-Version: 1.0 References: <201902111305.x1BD5bWZ011358@slippy.cwsent.com> <28B40BDE-BBA1-49F0-9EB5-22859A9812B9@cschubert.com> In-Reply-To: <28B40BDE-BBA1-49F0-9EB5-22859A9812B9@cschubert.com> From: Kyle Evans Date: Mon, 11 Feb 2019 09:20:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Lua Loader Failure to Include To: Cy Schubert Cc: FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4EC0B7229F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2019 15:21:52 -0000 On Mon, Feb 11, 2019 at 9:14 AM Cy Schubert wrote: > > On February 11, 2019 5:05:37 AM PST, Cy Schubert wrote: > >Hi, > > > >Under the old Forth loader the line: > > > > include /boot/testbed/test_sys > > > >would load the file and execute loader commands. > > > >However the the Lua loader results in the following: > > > >OK include /boot/testbed/amd64-current-r > >no error message > >OK > > > >Looking at the code, interp_include() expects to run actual Lua code > >using luaL_dofile(). Is this an intended change? > > > >The loader statements the file above is intending to execute are: > > > >echo > >echo > >echo testbed/amd64-current-r (12.0-CURRENT) loader file selected > >set bootdev=disk1s4a: > >include /boot/testbed/current.hints > >include /boot/testbed/do_load_KOMQUATS > > > >Let me know if I am to rewrite these loader statements into Lua or > >whether the Lua loader should be taught to read loader statements > >instead. > > Thinking about this while travelling to $JOB, it's probably best to leave it as is. I'll rewrite the includes into Lua. The benefit is greater flexibility and functionality. > Indeed, this is the best course of action. The translation shouldn't be too hard -- the main caveat to note is that your current.hints include likely can't be required in directly, you'll need to run it through config.load(). I intend to write up a wiki page or something for converting common Forth-isms to either portable loader.conf(5) directives or Lua-specific equivalents, depending on the feasibility of the former. Thanks, Kyle Evans