The number of Lua 5.1 compat hacks is increasing.
Supporting 3-4 different Lua versions isn't going to be sustainable.
List of issues (add more in comments):
* _G.unpack vs table.unpack (see everywhere)
* xpcall takes no arguments for the function (reason for util.compat/.xpcall)
* math.log missing the 'base' argument (see util.human.units)
* __len meta-method does not work on tables (see #1598)
* Missing luaL_buffinitsize (see https://hg.prosody.im/trunk/rev/712b2e6a09d9 )
1. Post heads-up / announcement to lists
2. Increase urgency of warning in util.dependencies
3. Wait for at least one nightly build
4. Update buildbot to not build trunk on 5.1
5. Drop 5.1 from debian-trunk
6. Reject 5.1 in configure
7. Drop all Lua 5.1 COMPAT
8. Add new awesome features that would have been painful before!
Many Lua 5.1 compat things can be found in the C code by seaching for LUA_VERSION_NUM, mainly in the form of #define to handle API differences.