Skip to content

Commit

Permalink
lua: update lua crate with better header copying
Browse files Browse the repository at this point in the history
Update lua crate to 0.1.0-alpha.5. This update will rewrite the
headers if the env var SURICATA_LUA_SYS_HEADER_DST changes. This fixes
the issue where the headers may not be written.

The cause is that Rust dependencies are cached, and if your editor is
using rust-analyzer, it might cache the built without this var being
set, so these headers are not available to Suricata. This crate update
forces the re-run of the Lua build.rs if this env var changes, fixing
this issue.

This new Lua crate is also smarter about writing out the headers,
don't overwrite if the destination appears to be the same as the
source, as this can force subsequent invocations of make to rebuild
the C source.
  • Loading branch information
jasonish committed Nov 18, 2024
1 parent 5d766df commit 9f1cce7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3076,13 +3076,16 @@ jobs:
- run: CPATH="$HOMEBREW_PREFIX/include:$CPATH" LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$LIBRARY_PATH" PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-warnings --enable-unittests --prefix="$HOME/.local/"
- run: CPATH="$HOMEBREW_PREFIX/include:$CPATH" LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$LIBRARY_PATH" PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" CFLAGS="${DEFAULT_CFLAGS}" make -j2
# somehow it gets included by some C++ stdlib header (case unsensitive)
- run: rm libhtp/VERSION && make check
- run: |
rm libhtp/VERSION
CPATH="$HOMEBREW_PREFIX/include:$CPATH" LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$LIBRARY_PATH" PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" CFLAGS="${DEFAULT_CFLAGS}" make check
- run: tar xf prep/suricata-verify.tar.gz
- name: Running suricata-verify
run: |
. ./testenv/bin/activate
python3 ./suricata-verify/run.py -q --debug-failed
- run: make install
- run: |
CPATH="$HOMEBREW_PREFIX/include:$CPATH" LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$LIBRARY_PATH" PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" CFLAGS="${DEFAULT_CFLAGS}" make install
- name: Check Suricata-Update
run: |
. ./testenv/bin/activate
Expand Down
5 changes: 2 additions & 3 deletions rust/Cargo.lock.in

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ time = "~0.3.36"

suricata-derive = { path = "./derive", version = "@PACKAGE_VERSION@" }

suricata-lua-sys = { version = "0.1.0-alpha.3" }
suricata-lua-sys = { version = "0.1.0-alpha.5" }

[dev-dependencies]
test-case = "~3.3.1"

0 comments on commit 9f1cce7

Please sign in to comment.