diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-05-13 14:51:35 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-05-13 14:51:44 -0700 |
commit | 51cf616dab63ba65c30cc58f0e5a61724aa4f731 (patch) | |
tree | 7a3f4be0a0ee7704c66c60d51b5985336ba21426 /tools/upbc.lua | |
parent | 35923b43b5f9bc65db3d2f6c5a0170a0bb816ce2 (diff) |
Changes to Lua module loading, and file generation.
This change has several parts:
1. Resurrected tools/upbc. The code was all there but the build was
broken for open-source. Now you can type "make tools/upbc" and
it will build all necessary Lua modules and create a robust shell
script for running upbc.
2. Changed Lua module loading to no longer rely on OS-level .so
dependencies. The net effect of this is that you now only need
to set LUA_PATH and LUA_CPATH; setting LD_LIBRARY_PATH or rpaths
is no longer required. Downside: this drops compatibility with
Lua 5.1, since it depends on a feature that only exists in Lua >=5.2
(and LuaJIT).
3. Since upbc works again, I fixed the re-generation of the descriptor
files (descriptor.upb.h, descriptor.upb.c). "make genfiles" will
re-generate these as well as the JIT code generator.
4. Added a Travis test target that ensures that the checked-in generated
files are not out of date. I would do this for the Ragel generated
file also, but we can't count on all versions of Ragel to necessarily
generate identical output.
5. Changed Makefile to no longer automatically run Ragel to regenerate
the JSON parser. This is unfortuante, because it's convenient when
you're developing the JSON parser. However, "git clone" sometimes
skews the timestamps a little bit so that "make" thinks it needs to
regenerate these files for a fresh "git clone." This would normally
be harmless, but if the user doesn't have Ragel installed, it makes
the build fail completely. So now you have to explicitly regenerate
the Ragel output. If you want to you can uncomment the auto-generation
during development.
Diffstat (limited to 'tools/upbc.lua')
-rw-r--r-- | tools/upbc.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/upbc.lua b/tools/upbc.lua index f68d25f..955da57 100644 --- a/tools/upbc.lua +++ b/tools/upbc.lua @@ -19,6 +19,12 @@ local upb = require "upb" local src = arg[1] local outbase = arg[2] local basename = arg[3] + +if not (src and outbase and basename) then + print("Usage: upbc <binary descriptor> <output filename base> <symbol prefix>") + return 1 +end + local hfilename = outbase .. ".upb.h" local cfilename = outbase .. ".upb.c" |