From d0754ab7835a0e426159aeb903742e8334e577f4 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 1 Oct 2026 14:12:04 -1000 Subject: Keep the Lua-less build compiling `cgit_abort_filters` unhooks the Lua write interposer under NO_LUA too, where neither the hook nor its state exists, so `make NO_LUA=1` and the default mode of `tools/release-build.sh` have not compiled since the die path learned to take stdout back from a filter. The suite now builds that variant into `build/nolua` and runs it, and a `lua:` filter in such a build is refused with a message naming the cause instead of an unknown filter type. --- source/filter.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/filter.c') diff --git a/source/filter.c b/source/filter.c index f5fb2d5..dd1eaf0 100644 --- a/source/filter.c +++ b/source/filter.c @@ -444,8 +444,10 @@ void cgit_abort_filters(void) close(running_exec->old_stdout); running_exec = NULL; } +#ifndef NO_LUA if (filter_write) unhook_write(); +#endif } static const struct { @@ -503,5 +505,9 @@ struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype) return filter_specs[i].create(colon + 1, argument_count); } +#ifdef NO_LUA + if (len == 3 && !strncmp("lua", cmd, len)) + die("Built without Lua, cannot run filter %s", cmd); +#endif die("Invalid filter type: %.*s", (int)len, cmd); } -- cgit v2.8.0