Page MenuHomeFreeBSD

flua: support "require" in the base system

Authored by emaste on Apr 28 2020, 5:29 PM.



Use /usr not /usr/local for base system components. Use /usr/lib/flua and /usr/share/flua (not lua) for consistency and to avoid other software accidentally finding our modules.

Also drop the version from the path, as flua represents an unspecified lua version that corresponds to the FreeBSD version it comes with.

Enable dlopen.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

emaste created this revision.

Posted initially for discussion, not a final committable change.

That said we could start using .lua modules in /usr/share/flua.

78 ↗(On Diff #71117)

This does not yet work (without changes to add some flua symbols to dynamic sym list).

211 ↗(On Diff #71117)

Yup, this is exactly what I had in mind -- we might consider only defining LUA_ROOT if it's not defined, so we have the possibility of defining it to somewhere /nonexistent (or somewhere valid) in the BOOTSTRAPPING build to make sure the bootstrap flua can't pick up host modules that may not match the flua being built.

emaste added inline comments.
211 ↗(On Diff #71117)

What's your opinion on dropping the version?

211 ↗(On Diff #71117)

Dropping the version does seem like a good idea... nothing should need to know/care as stuff installed here should be pretty tightly coupled to flua in some way, and it does reinforce the (lack of) stability guarantees, I think.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 13 2020, 12:19 AM
This revision was automatically updated to reflect the committed changes.