I've built Lua 5.4.x from sources for the M1, and I've not seen any problems. The only issues I had were related to early versions of 'brew' which did not support all the libraries I needed for some custom Lua extensions I have written, nothing related to code coming from the Lua authors.