Bug 267700 - wazuh-agent 4.3.9 fails to compile RELENG_13
Summary: wazuh-agent 4.3.9 fails to compile RELENG_13
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-10 19:12 UTC by mike
Modified: 2022-11-16 19:11 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mike 2022-11-10 19:12:45 UTC
manually building the port from default options and from poudrier both fail with the following error

gmake[4]: Entering directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[5]: Entering directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[6]: Entering directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[6]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[6]: Entering directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
[ 12%] Building CXX object CMakeFiles/sysinfo.dir/src/network/networkInterfaceBSD.cpp.o
[ 25%] Building CXX object CMakeFiles/sysinfo.dir/src/osinfo/sysOsParsers.cpp.o
[ 37%] Building CXX object CMakeFiles/sysinfo.dir/src/sysInfoCommonBSD.cpp.o
[ 50%] Building CXX object CMakeFiles/sysinfo.dir/src/sysInfoFreeBSD.cpp.o
[ 62%] Building CXX object CMakeFiles/sysinfo.dir/src/sysInfo.cpp.o
[ 75%] Linking CXX shared library lib/libsysinfo.so
c++: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument]
c++: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
gmake[6]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
[ 75%] Built target sysinfo
gmake[6]: Entering directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[6]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[6]: Entering directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
[ 87%] Building CXX object testtool/CMakeFiles/sysinfo_test_tool.dir/main.cpp.o
[100%] Linking CXX executable ../bin/sysinfo_test_tool
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_version [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_http2_strerror [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_submit_rst_stream [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_set_stream_user_data [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_new [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_send_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_frame_recv_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_invalid_frame_recv_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_data_chunk_recv_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_before_frame_send_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_frame_send_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_frame_not_send_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_stream_close_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_begin_headers_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_on_header_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_set_error_callback [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_client_new [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_callbacks_del [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_session_get_stream_user_data [--no-allow-shlib-undefined]
ld: error: /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/libwazuhext.so: undefined reference to nghttp2_is_fatal [--no-allow-shlib-undefined]
ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[6]: *** [testtool/CMakeFiles/sysinfo_test_tool.dir/build.make:98: bin/sysinfo_test_tool] Error 1
gmake[6]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[5]: *** [CMakeFiles/Makefile2:126: testtool/CMakeFiles/sysinfo_test_tool.dir/all] Error 2
gmake[5]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[4]: *** [Makefile:101: all] Error 2
gmake[4]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src/data_provider/build'
gmake[3]: *** [Makefile:1493: build_sysinfo] Error 2
gmake[3]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src'
gmake[2]: *** [Makefile:726: agent] Error 2
gmake[2]: Leaving directory '/usr/ports/security/wazuh-agent/work/wazuh-4.3.9/src'
*** Error code 2

Stop.
make[1]: stopped in /usr/ports/security/wazuh-agent
*** Error code 1

Stop.
make: stopped in /usr/ports/security/wazuh-agent
Comment 1 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2022-11-16 00:04:33 UTC
(In reply to mike from comment #0)
It is strange because my poudriere and freebsd pkg cluster were generating wazuh packages without problems but now I see wazuh-agent-4.3.9 package is not available right now 

Anyway try the following patch file and tell me if it works for you

https://people.freebsd.org/~acm/ports/wazuh-agent.diff
Comment 2 mike 2022-11-16 13:44:25 UTC
Thanks very much, that looks good now!!

0{cage}# rm -R wazuh-agent
0{cage}# portsnap  extract security/wazuh-agent
/usr/ports/security/wazuh-agent/
0{cage}# cd /usr/ports/security/wazuh-agent/
0{cage}# fetch https://people.freebsd.org/~acm/ports/wazuh-agent.diff
wazuh-agent.diff                                      2704  B   32 MBps    00s
0{cage}# make extract
===>  License GPLv2 accepted by the user
===>   wazuh-agent-4.3.9 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by wazuh-agent-4.3.9 for building
===>  Extracting for wazuh-agent-4.3.9
=> SHA256 Checksum OK for wazuh-4.3.9/cJSON.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/curl.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/libdb.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/libffi.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/libyaml.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/openssl.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/procps.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/sqlite.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/zlib.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/audit-userspace.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/msgpack.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/bzip2.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/nlohmann.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/googletest.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/libpcre2.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/libplist.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/libarchive.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/popt.tar.gz.
=> SHA256 Checksum OK for wazuh-4.3.9/wazuh-wazuh-v4.3.9_GH0.tar.gz.
0{cage}# patch -p3 < wazuh-agent.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/security/wazuh-agent/Makefile b/security/wazuh-agent/Makefile
|index f1b29f55e56f..d4b45eaa6a64 100644
|--- a/security/wazuh-agent/Makefile
|+++ b/security/wazuh-agent/Makefile
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 16.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/security/wazuh-agent/files/patch-src-data_provider_CMakeLists.txt b/security/wazuh-agent/files/patch-src-data_provider_CMakeLists.txt
|new file mode 100644
|index 000000000000..f042a27f6a88
|--- /dev/null
|+++ b/security/wazuh-agent/files/patch-src-data_provider_CMakeLists.txt
--------------------------
(Creating file files/patch-src-data_provider_CMakeLists.txt...)
Patching file files/patch-src-data_provider_CMakeLists.txt using Plan A...
Empty context always matches.
Hunk #1 succeeded at 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/security/wazuh-agent/files/patch-src-shared_modules-dbsync_CMakeLists.txt b/security/wazuh-agent/files/patch-src-shared_modules-dbsync_CMakeLists.txt
|new file mode 100644
|index 000000000000..e26d226d0907
|--- /dev/null
|+++ b/security/wazuh-agent/files/patch-src-shared_modules-dbsync_CMakeLists.txt
--------------------------
(Creating file files/patch-src-shared_modules-dbsync_CMakeLists.txt...)
Patching file files/patch-src-shared_modules-dbsync_CMakeLists.txt using Plan A...
Empty context always matches.
Hunk #1 succeeded at 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/security/wazuh-agent/files/patch-src-shared_modules-rsync_CMakeLists.txt b/security/wazuh-agent/files/patch-src-shared_modules-rsync_CMakeLists.txt
|new file mode 100644
|index 000000000000..aac9d1e9aaf0
|--- /dev/null
|+++ b/security/wazuh-agent/files/patch-src-shared_modules-rsync_CMakeLists.txt
--------------------------
(Creating file files/patch-src-shared_modules-rsync_CMakeLists.txt...)
Patching file files/patch-src-shared_modules-rsync_CMakeLists.txt using Plan A...
Empty context always matches.
Hunk #1 succeeded at 1.
done
0{cage}# make
...
install  -m 555 /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/gen_ossec.sh /usr/ports/security/wazuh-agent/work/stage/var/ossec/packages_files/agent_installation_scripts/
install  -m 555 /usr/ports/security/wazuh-agent/work/wazuh-4.3.9/add_localfiles.sh /usr/ports/security/wazuh-agent/work/stage/var/ossec/packages_files/agent_installation_scripts/
====> Compressing man pages (compress-man)
===> Staging rc.d startup script(s)
0{cage}#
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-11-16 19:07:18 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=003cac755cca2a771b230fcfa777572d0a7354dc

commit 003cac755cca2a771b230fcfa777572d0a7354dc
Author:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
AuthorDate: 2022-11-16 19:04:54 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2022-11-16 19:06:55 +0000

    security/wazuh-agent: Fix compile issues

    - Add missing dependency
    PR:             267700
    Reported by:    mike _at_ sentex.net

 security/wazuh-agent/Makefile                                 |  2 ++
 .../files/patch-src-data_provider_CMakeLists.txt (new)        | 11 +++++++++++
 .../patch-src-shared_modules-dbsync_CMakeLists.txt (new)      | 11 +++++++++++
 .../files/patch-src-shared_modules-rsync_CMakeLists.txt (new) | 11 +++++++++++
 4 files changed, 35 insertions(+)
Comment 4 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2022-11-16 19:11:18 UTC
security/wazuh-agent should compile without problems right now. Thanks for your PR

Take a look at https://cgit.FreeBSD.org/ports/commit/?id=003cac755cca2a771b230fcfa777572d0a7354dc