Project

General

Profile

Actions

Bug #6384

open

Configure seems failed to persistently detect/remember cbindgen location

Added by Aditya Nugraha 7 months ago. Updated 7 months ago.

Status:
New
Priority:
High
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

I am compiling suricata 7.0.2-DEV for OpenWrt x86-64, with 7.0.1 stable release my OpenWrt specific MakeFile for going well (compiled & run fine).

That's because the rust-bindings.h inside rust/dist dir is already on the stable release, but as per-git, I am getting the following :

make gen/rust-bindings.h
make[5]: Entering directory '/home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/suricata-7.0.2/rust'
cbindgen --config /home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/suricata-7.0.2/rust/cbindgen.toml \
    --quiet --verify --output /home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/suricata-7.0.2/rust/gen/rust-bindings.h || true
/bin/bash: line 1: cbindgen: command not found
make[5]: Leaving directory '/home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/suricata-7.0.2/rust'

As in git/7.0.2-DEV we need to generate the rust-bindings.h, I've found that configure at the stage of "make gen/rust-bindings.h" seems failed to
"remember" the previously found/installed "cbindgen" 

From Configuring :

checking for cbindgen... /home/username/works/openwrt/staging_dir/target-x86_64_glibc_custom/host/cargo/bin/cbindgen

From config.log :

ac_cv_path_CBINDGEN=/home/username/works/openwrt/staging_dir/target-x86_64_glibc_custom/host/cargo/bin/cbindgen
CBINDGEN='/home/username/works/openwrt/staging_dir/target-x86_64_glibc_custom/host/cargo/bin/cbindg
HAVE_CBINDGEN_FALSE='#'
HAVE_CBINDGEN_TRUE=''
configure:30078: checking for cbindgen
configure:30101: found /home/username/works/openwrt/staging_dir/target-x86_64_glibc_custom/host/cargo/bin/cbindgen
configure:30114: result: /home/username/works/openwrt/staging_dir/target-x86_64_glibc_custom/host/cargo/bin/cbindgen

Notable most important lines from Suricata OpenWrt package Makefile :

define Build/Configure
    ( \
        cd $(PKG_BUILD_DIR) ; \
        git clone https://github.com/OISF/libhtp.git && \
        git clone https://github.com/OISF/suricata-update.git ; \
        $(CONFIGURE_VARS) cargo install --root $(CARGO_HOME) cbindgen ; \
        cd $(PKG_BUILD_DIR) && $(CONFIGURE_VARS) ./autogen.sh && $(CONFIGURE_VARS) ./configure $(CONFIGURE_ARGS) ; \
    )
    $(call Build/Configure/Default)
endef


Files

config.log (440 KB) config.log configure log Aditya Nugraha, 10/04/2023 03:51 PM
suricata.log (220 KB) suricata.log Compilation log from OpenWrt Build System Aditya Nugraha, 10/04/2023 03:51 PM
001-cbindgen.patch (657 Bytes) 001-cbindgen.patch Fix Aditya Nugraha, 10/07/2023 02:47 AM
Actions #1

Updated by Aditya Nugraha 7 months ago

Fixed with patch file above, feel free to submit or push it upstream.

Actions

Also available in: Atom PDF