Project

General

Profile

Actions

Bug #6384

open

rust: configure fails to persistently detect/remember cbindgen location

Added by Aditya Nugraha about 1 year ago. Updated 4 months ago.

Status:
Assigned
Priority:
Normal
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 about 1 year ago

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

Actions #2

Updated by Victor Julien 4 months ago

  • Subject changed from Configure seems failed to persistently detect/remember cbindgen location to rust: configure fails to persistently detect/remember cbindgen location
  • Status changed from New to Assigned
  • Assignee changed from OISF Dev to Jason Ish
  • Priority changed from High to Normal
  • Target version changed from TBD to 8.0.0-beta1

Maybe needs a backport too?

Actions

Also available in: Atom PDF