]> git.ipfire.org Git - thirdparty/suricata.git/commit
rust: put all rust/cargo env vars in CARGO_ENV 12140/head
authorJason Ish <jason.ish@oisf.net>
Tue, 19 Nov 2024 17:28:03 +0000 (11:28 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 21 Nov 2024 05:55:13 +0000 (06:55 +0100)
commit13841c0b9eb39ba245ffeb7b9e42957383e94927
tree84f2caee9f9be84d2e0df8a4298e5a7fbb838f29
parent138898f5c2b8bada9469b4276dc0636da83c66f3
rust: put all rust/cargo env vars in CARGO_ENV

To ensure that all calls to cargo use the same environment variables,
put the environment variables in CARGO_ENV so every call to cargo can
easily use the same vars.

The Cargo build system is smarter than make, it can detect a change in
an environment variable that affects the build, and the setting of
SURICATA_LUA_SYS_HEADER_DST changing could cause a rebuild.

Also update suricata-lua-sys, which is smarter about copying headers. It
will only copy if the destination does not exist, or the source header
is newer than the target, which can also prevent unnecessary rebuilds.

This is mainly to fix an issue where subsequent builds may fail,
especially when running an editor with a LSP enabled:

    Update lua crate to 0.1.0-alpha.5. This update will force a rewrite of
    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 build 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.
rust/Cargo.lock.in
rust/Cargo.toml.in
rust/Makefile.am