aboutsummaryrefslogtreecommitdiff
path: root/libexec/flua
Commit message (Collapse)AuthorAgeFilesLines
* Properly disable LUA_USE_DLOPEN for bootstrap fluaKyle Evans2020-08-141-3/+0
| | | | | | | | | | | | | | | | | | | | flua does have some specific bits that will include luaconf.h, but the definition of LUA_USE_DLOPEN for those won't matter. This belongs in liblua instead. To expand on my previous commit, which was a little sparse with details, it's not really safe to allow LUA_USE_DLOPEN with host lib paths being used. The host system could have an entirely different lua version and this could cause us to crash and burn. If we want to revive this later, we need to make sure to define c module paths inside OBJDIR that are compiled against whatever version we've bootstrapped. Pointy hat: kevans Notes: svn path=/head/; revision=364227
* flua: don't allow dlopen, et al., for bootstrap fluaKyle Evans2020-08-141-2/+4
| | | | | | | | There are some logistics issues that need to be sorted out here before we can actually allow this to work. Notes: svn path=/head/; revision=364226
* flua: support "require" for binary objects in the base systemEd Maste2020-08-131-0/+2
| | | | | | | | | | Export symbols from flua, and enable dlopen. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26059 Notes: svn path=/head/; revision=364222
* flua: add ucl libraryRyan Moeller2020-06-222-0/+8
| | | | | | | | | | | | | | | | | | | | | | | libucl comes with a Lua library binding. Build it into flua. This lets us parse/generate config files in the various formats supported by libucl with flua. For example, the following script will detect the format of an object written to stdin as one of UCL config, JSON, or YAML and write it to stdout as pretty-printed JSON: local ucl = require('ucl') local parser = ucl.parser() parser:parse_string(io.read('*a')) local obj = parser:get_object() print(ucl.to_format(obj, 'json')) Reviewed by: kevans, pstef Approved by: mmacy (mentor) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25009 Notes: svn path=/head/; revision=362477
* flua: follow-up to r359453, don't bother with libedit in bootstrapKyle Evans2020-03-301-1/+4
| | | | | | | | | | The bootstrap flua should not be used for REPL-like activities; exclude it to save the dependency on libedit and not waste time with it. X-MFC-With: r359453 Notes: svn path=/head/; revision=359455
* flua: enable readline bits, courtesy of libeditKyle Evans2020-03-301-0/+5
| | | | | | | | | | | This is a nicer experience when attempting to run ad-hoc lua bits in the flua REPL. PR: 245121 MFC after: 1 week Notes: svn path=/head/; revision=359453
* Add an internal liblua and use it in flua.Brooks Davis2020-03-172-808/+2
| | | | | | | | | | | | The new liblua will be used in a forthcoming import of kyua. Reviewed by: kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24090 Notes: svn path=/head/; revision=359045
* flua: implement chmodEd Maste2020-03-133-0/+40
| | | | | | | | | | | | Lua does not provide a native way to change the permission of a file. Submitted by: Yang Wang <2333@outlook.jp> Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24036 Notes: svn path=/head/; revision=358960
* flua: newer GCC complains about format-nonliteral at WARNS=2Kyle Evans2019-11-191-0/+2
| | | | | | | Disable that one, too. Notes: svn path=/head/; revision=354837
* Add flua to the base system, install to /usr/libexecKyle Evans2019-11-187-0/+1435
FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever extensions we need for base system operations. We currently support a subset of lfs and lposix that are used in the rewrite of makesyscall.sh into lua, added in r354786. flua is intentionally written such that one can install standard lua and some set of lua modules from ports and achieve the same effect. linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added in. This is similar to what we do in stand/. linit.c has been renamed to make it clear that this has flua-specific bits. luaconf has been slightly obfuscated to make extensions more difficult. Part of the problem is that flua is already hard enough to use as a bootstrap tool because it's not in PATH- attempting to do extension loading would require a special bootstrap version of flua with paths changed to protect the innocent. src.lua.mk has been added to make it easy for in-tree stuff to find flua, whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1. Reviewed by: brooks, emaste (both earlier version), imp Differential Revision: https://reviews.freebsd.org/D21893 Notes: svn path=/head/; revision=354833