Using Lua libraries from within tup

I am using tup to replace a complex Makefile and I would like to reference other Lua libraries from my tup code. In particular. I would like to use luafilesystem

it yaml

to generate assembly rules as well. However, I cannot find a way to load these libraries from tup.

In particular, if I do

local lfs = require "luafilesystem"

      

(or any other traditional option for importing Lua scripts), I always get this error:

try to call global ' require

' (value nil

)

This suggests that tup does not support the usual Lua mechanisms for invoking the exernal libraries. Did I miss something?

I am using tup v0.7.3-4-g1a8d07e

+3


source to share


1 answer


As per the documentation is require

not available: "Base functions are defined, except for dofile, loadfile, load and require."



It looks like you will be able to implement your own "query" based on tup.include

that "parses and runs a Lua file along the way".

+1


source







All Articles