Page MenuHomeFreeBSD

Lua loader: Add barebones "lfs" module
ClosedPublic

Authored by cem on Feb 17 2018, 9:57 PM.
Tags
None
Referenced Files
F168284224: D14418.id39443.diff
Thu, Aug 27, 9:52 AM
F168251593: D14418.id39443.diff
Thu, Aug 27, 4:45 AM
F168246729: D14418.id39451.diff
Thu, Aug 27, 3:59 AM
F168230373: D14418.id.diff
Thu, Aug 27, 1:49 AM
F168208865: D14418.id39452.diff
Wed, Aug 26, 10:00 PM
F168205463: D14418.diff
Wed, Aug 26, 9:28 PM
Unknown Object (File)
Mon, Aug 24, 7:43 PM
Unknown Object (File)
Mon, Aug 24, 3:08 PM
Subscribers
None

Details

Summary

Add a Lua FileSystem module, an emulation of a subset of the permissively
licensed (MIT) Lua library of the same name[0], to our loader's Lua
environment.

[0]: https://github.com/keplerproject/luafilesystem/

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 15120
Build 15213: arc lint + arc unit

Event Timeline

My lua extension fu is weak, but this looks decent to me.

stand/liblua/lfs.c
325–332

We need to do this to loader. and os., and maybe check against lua standard libraries to see if there's a more standard set of names if we're off in the weeds.

In D14418#302203, @imp wrote:

My lua extension fu is weak, but this looks decent to me.

Mine too.

stand/liblua/lfs.c
325–332

Yes, I was about to go ahead and do those cleanups now. :-)

stand/liblua/lfs.c
325–332

We should do them as modules, like the standard modules, and maybe lfs should be done that way too...

There's a bit of a mismatch between interp_lua stuff an lutils.c lstd.c stuff that likely could benefit from a good going over.

See loadedlibs[] in interp_lua for where we do the standard ones.

stand/liblua/lfs.c
325–332

Sure, there's room for additional cleanup there. Do you care about the order, cleanup vs adding this module? If I can commit this and the subsequent patch first it keeps my patch stack shorter, which I prefer.

stand/liblua/lfs.c
325–332

If it's about the same time, I don't care. I just don't want to get a mess and be stuck with it :(

Use loadlibs module registration system.

Remove now useless include

This revision is now accepted and ready to land.Feb 18 2018, 1:11 AM
This revision was automatically updated to reflect the committed changes.