lua: build lua by default

Ticket: #4776

[Edits by Jason Ish]
- Add Lua in CI where needed
- Disable Lua for builds that don't have Lua 5.4
pull/11165/head
Jo Johnson 3 years ago committed by Jason Ish
parent 712496bb3f
commit d5c6c3a21c

@ -57,7 +57,6 @@ jobs:
git \
jansson-devel \
jq \
lua-devel \
libtool \
libyaml-devel \
libnfnetlink-devel \
@ -169,7 +168,7 @@ jobs:
git -c advice.detachedHead=false checkout FETCH_HEAD
- run: ./autogen.sh
- run: ./configure --enable-warnings
- run: ./configure --enable-warnings --disable-lua
- run: make -j ${{ env.CPUS }}
- run: python3 ./suricata-verify/run.py -q --debug-failed
- run: make install-full

@ -266,7 +266,7 @@ jobs:
CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-warnings
- run: make -j ${{ env.CPUS }} distcheck
env:
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-lua --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
MAKEFLAGS: "-j ${{ env.CPUS }}"
- run: test -e doc/userguide/suricata.1
- name: Checking includes
@ -458,7 +458,6 @@ jobs:
git \
jansson-devel \
jq \
lua-devel \
libtool \
libyaml-devel \
libnfnetlink-devel \
@ -514,7 +513,7 @@ jobs:
- name: Configuring
run: |
./autogen.sh
CFLAGS="${DEFAULT_CFLAGS}" ./configure
CFLAGS="${DEFAULT_CFLAGS}" ./configure --disable-lua
- run: make -j ${{ env.CPUS }} check
- name: Checking includes
run: |
@ -654,7 +653,6 @@ jobs:
git \
jansson-devel \
jq \
lua-devel \
libtool \
libyaml-devel \
libnfnetlink-devel \
@ -681,7 +679,7 @@ jobs:
name: dist
- run: tar zxvf suricata-*.tar.gz --strip-components=1
- name: ./configure
run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --disable-lua
- run: make -j ${{ env.CPUS }}
- run: make install
- run: make install-conf
@ -877,7 +875,7 @@ jobs:
- run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow" ./configure --disable-shared
- run: make check
- run: make distclean
- run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-warnings --enable-debug --enable-unittests --disable-shared --enable-rust-strict --enable-hiredis --enable-nfqueue --enable-lua
- run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-warnings --enable-debug --enable-unittests --disable-shared --enable-rust-strict --enable-hiredis --enable-nfqueue
env:
LDFLAGS: "-fsanitize=address"
ac_cv_func_realloc_0_nonnull: "yes"
@ -2182,7 +2180,7 @@ jobs:
chmod 755 $HOME/.cargo/bin/cbindgen
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- run: ./autogen.sh
- run: CFLAGS="$DEFAULT_CFLAGS -DNDEBUG" ./configure --enable-warnings --enable-unittests
- run: CFLAGS="$DEFAULT_CFLAGS -DNDEBUG" ./configure --enable-warnings --enable-unittests --disable-lua
- run: make -j ${{ env.CPUS }}
- run: make check
- run: make dist
@ -2312,6 +2310,7 @@ jobs:
libjansson-dev \
libevent-dev \
libevent-pthreads-2.1-7 \
liblua5.4-dev \
libpython2.7 \
make \
parallel \
@ -2402,6 +2401,7 @@ jobs:
libnfnetlink0 \
libhiredis-dev \
libjansson-dev \
liblua5.4-dev \
libpython2.7 \
make \
rustc \
@ -2472,6 +2472,7 @@ jobs:
libjansson-dev \
libevent-dev \
libevent-pthreads-2.1-7 \
liblua5.4-dev \
libpython2.7 \
make \
parallel \
@ -2563,6 +2564,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libnetfilter-queue-dev \
libnetfilter-queue1 \
@ -2714,7 +2716,7 @@ jobs:
# -j2 caused random failures during cargo vendor
- run: make distcheck
env:
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-lua --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
- run: test -e doc/userguide/suricata.1
- run: test -e doc/userguide/userguide.pdf
- name: Building Rust documentation
@ -2769,6 +2771,7 @@ jobs:
libmagic-dev \
libjansson-dev \
libjansson4 \
liblua5.4-dev \
liblz4-dev \
libssl-dev \
liblzma-dev \
@ -2888,7 +2891,7 @@ jobs:
- run: tar xf prep/suricata-update.tar.gz
- run: tar xf prep/suricata-verify.tar.gz
- run: ./autogen.sh
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-warnings --enable-unittests --enable-debug --enable-lua --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-warnings --enable-unittests --enable-debug --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk
- run: make -j ${{ env.CPUS }}
- run: make check
- name: Building Rust documentation
@ -3054,7 +3057,7 @@ jobs:
cp prep/cbindgen $HOME/.cargo/bin
chmod 755 $HOME/.cargo/bin/cbindgen
- run: ./autogen.sh
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-warnings --enable-unittests --enable-fuzztargets
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-warnings --enable-unittests --enable-fuzztargets --disable-lua
- run: make -j ${{ env.CPUS }}
- run: make check
- run: tar xf prep/suricata-verify.tar.gz
@ -3135,7 +3138,7 @@ jobs:
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool libyaml-devel pcre2-devel jansson-devel make mingw-w64-x86_64-libyaml mingw-w64-x86_64-pcre2 mingw-w64-x86_64-rust mingw-w64-x86_64-jansson unzip p7zip python-setuptools mingw-w64-x86_64-python-yaml mingw-w64-x86_64-jq mingw-w64-x86_64-libxml2
install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool libyaml-devel pcre2-devel jansson-devel make mingw-w64-x86_64-libyaml mingw-w64-x86_64-pcre2 mingw-w64-x86_64-rust mingw-w64-x86_64-jansson unzip p7zip python-setuptools mingw-w64-x86_64-python-yaml mingw-w64-x86_64-jq mingw-w64-x86_64-libxml2 mingw-w64-x86_64-lua
# hack: install our own cbindgen system wide as we can't get the
# preinstalled one to be picked up by configure
- name: cbindgen
@ -3191,7 +3194,7 @@ jobs:
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool libyaml-devel pcre2-devel jansson-devel make mingw-w64-x86_64-libyaml mingw-w64-x86_64-pcre2 mingw-w64-x86_64-rust mingw-w64-x86_64-jansson unzip p7zip python-setuptools mingw-w64-x86_64-python-yaml mingw-w64-x86_64-jq mingw-w64-x86_64-libxml2 libpcap-devel mingw-w64-x86_64-libpcap
install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool libyaml-devel pcre2-devel jansson-devel make mingw-w64-x86_64-libyaml mingw-w64-x86_64-pcre2 mingw-w64-x86_64-rust mingw-w64-x86_64-jansson unzip p7zip python-setuptools mingw-w64-x86_64-python-yaml mingw-w64-x86_64-jq mingw-w64-x86_64-libxml2 libpcap-devel mingw-w64-x86_64-libpcap mingw-w64-x86_64-lua
# hack: install our own cbindgen system wide as we can't get the
# preinstalled one to be picked up by configure
- name: cbindgen
@ -3235,7 +3238,7 @@ jobs:
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool libyaml-devel pcre2-devel jansson-devel make mingw-w64-x86_64-libyaml mingw-w64-x86_64-pcre2 mingw-w64-x86_64-rust mingw-w64-x86_64-jansson unzip p7zip python-setuptools mingw-w64-x86_64-python-yaml mingw-w64-x86_64-jq mingw-w64-x86_64-libxml2 libpcap-devel mingw-w64-x86_64-libpcap
install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool libyaml-devel pcre2-devel jansson-devel make mingw-w64-x86_64-libyaml mingw-w64-x86_64-pcre2 mingw-w64-x86_64-rust mingw-w64-x86_64-jansson unzip p7zip python-setuptools mingw-w64-x86_64-python-yaml mingw-w64-x86_64-jq mingw-w64-x86_64-libxml2 libpcap-devel mingw-w64-x86_64-libpcap mingw-w64-x86_64-lua
# hack: install our own cbindgen system wide as we can't get the
# preinstalled one to be picked up by configure
- name: cbindgen

@ -52,6 +52,7 @@ jobs:
sudo apt-get install libssl-dev
sudo apt-get install libpcre2-dev
sudo apt-get install libjansson-dev
sudo apt-get install liblua5.4-dev
sudo apt-get install libpcap-dev
sudo apt-get install libnuma-dev
git clone --depth 1 https://github.com/OISF/libhtp.git

@ -88,7 +88,7 @@ jobs:
git checkout $rev
echo "Building rev ${rev}" | tee -a build_log.txt
./autogen.sh >> build_log.txt 2>&1
CC="sccache gcc" ./configure --enable-warnings --enable-unittests >> build_log.txt 2>&1
CC="sccache gcc" ./configure --enable-warnings --enable-unittests --disable-lua >> build_log.txt 2>&1
if ! make -j2 >> build_log.txt 2>&1; then
echo "::error ::Failed to build rev ${rev}"
tail -n 50 build_log.txt

@ -130,7 +130,7 @@ jobs:
shell: bash {0}
- run: git clone https://github.com/OISF/libhtp -b 0.5.x
- run: ./autogen.sh
- run: ./configure --enable-warnings --enable-unittests
- run: ./configure --enable-warnings --enable-unittests --disable-lua
- name: Check formatting
run: |
./scripts/clang-format.sh check-branch --diffstat --show-commits >> check_formatting_log.txt 2>&1

@ -1879,9 +1879,9 @@
# liblua
AC_ARG_ENABLE(lua,
AS_HELP_STRING([--enable-lua],[Enable Lua support]),
AS_HELP_STRING([--disable-lua],[Disable Lua support]),
[ enable_lua="$enableval"],
[ enable_lua="no"])
[ enable_lua="yes"])
AC_ARG_WITH(liblua_includes,
[ --with-liblua-includes=DIR liblua include directory],

@ -160,7 +160,7 @@ static int GetFlowVarByKey(lua_State *luastate, Flow *f, FlowVar **ret_fv)
LUA_ERROR("key len out of range: max 256");
}
FlowVar *fv = FlowVarGetByKey(f, (const uint8_t *)keystr, keylen);
FlowVar *fv = FlowVarGetByKey(f, (const uint8_t *)keystr, (uint16_t)keylen);
if (fv == NULL) {
LUA_ERROR("no flow var");
}
@ -272,7 +272,7 @@ static int LuaSetFlowvarById(lua_State *luastate)
memcpy(buffer, str, len);
buffer[len] = '\0';
FlowVarAddIdValue(f, idx, buffer, len);
FlowVarAddIdValue(f, idx, buffer, (uint16_t)len);
return 0;
}
@ -333,7 +333,7 @@ static int LuaSetFlowvarByKey(lua_State *luastate)
}
memcpy(keybuf, keystr, keylen);
keybuf[keylen] = '\0';
FlowVarAddKeyValue(f, keybuf, keylen, buffer, len);
FlowVarAddKeyValue(f, keybuf, (uint16_t)keylen, buffer, (uint16_t)len);
return 0;
}

Loading…
Cancel
Save