Created attachment 247837 [details] upgrade patch Please don't hesitate to commit this. The daemon is working fine in production on 13.3-PRERELEASE with the most recent version of net/gobgp (3.22). I am not attaching build logs, but bumping CXXSTD to c++20 is required.
Created attachment 247907 [details] upgrade patch v2 Today devel/grpc142 was marked broken by the maintainer. It's not possible to build net-mgmt/fastnetmon with the suggested devel/grpc so I created devel/grpc151 following the Debian approach. Perhaps it will get committed (see bug 276574). The port upgrade patch was refreshed accordingly. Adding -DENABLE_CAPNP_SUPPORT=OFF was suggested by the author - it simplifies the build process and apparently has no impact on any feature (suggested on IRC by the developer). Thus the port can be built now with clang 17 from the base.
Why authors can't update it with support of grpc 1.60?
Created attachment 247913 [details] build log (In reply to Vladimir Druzenko from comment #2) Apparently, the port builds with the most recent gRPC on MacOS, but I wasn't able to build it (see attached build log excerpt).
Probably something like this can help (used in devel/grpc): USES= compiler:c++17-lang USE_CSTD= c11 USE_CXXSTD= c++17 CMAKE_ARGS= -DCMAKE_CXX_STANDARD=17
(In reply to Vladimir Druzenko from comment #4) Fastnetmon 1.2.6 will not build with c++17 standard, at least using llvm, regardless it was Clang 15 or 17 from the base. The only acceptable standard seems to be c++20 I have not tried to build it with gcc compiler though - perhaps it's right solution.
Created attachment 247931 [details] upgrade patch Patch updated to reflect changes in bug 276574
Created attachment 247932 [details] upgrade patch Removed extra patch added accidentally
Created attachment 247938 [details] upgrade patch Troubleshoot again, as suggested by diizzy@. Now it builds with the recent devel/grpc.
Can you maybe rebase your patch on the current version that is present in ports? It seems to apply, but it shows a lot of whitespace problems: g apply 247938.patch 247938.patch:81: trailing whitespace. 247938.patch:82: trailing whitespace. - # By default use module supplied by cmake to search for Protobuf 247938.patch:89: trailing whitespace. # protobuf_21_12/lib/cmake/protobuf or protobuf_21_12/lib64/cmake/protobuf on CentOS 247938.patch:90: trailing whitespace. list(APPEND CMAKE_PREFIX_PATH ${PROTOCOL_BUFFERS_CUSTOM_INSTALL_PATH}) 247938.patch:92: trailing whitespace. warning: squelched 5 whitespace errors warning: 10 lines add whitespace errors. If the maintainer approve it, I can commit the update.
The patch builds fine: https://pkg.fechner.net/data/132amd64-gitlab/2024-01-25_09h05m41s/logs/fastnetmon-1.2.6.log
(In reply to Matthias Fechner from comment #9) Thank you for looking at this PR. The patch you mentioned was taken from this commit[1]. If it's required I will eventually try to fix it and rebase later. Of course, I have tested not only the build, but I am running this vicious daemon. I thought about polishing it a bit, so perhaps it should be reworked to use samples and avoid overwriting customized files in 3 cases: bin/notify_about_attack.sh etc/networks_list etc/networks_whitelist There is also a flaw with the pid file creation, which I tried to fix, but it requires debugging. Anyway, it's worth updating this port, considering that devel/grpc142 is marked broken. 1. https://github.com/pavel-odintsov/fastnetmon/commit/fad8757b8986226024d549a6dfb40abbab01643e.patch?full_index=1
(In reply to Marek Zarychta from comment #11) There is no need to add upstream patches as local files. You can include them, see e.g. in `devel/gitlab-runner/Makefile` for an example. Search the ports directory to find an example for github. If you include it as a MR (merge request) or an upstream commit, it is also easier in the future if that commit is included into a newer version to better understand build errors.
(In reply to Matthias Fechner from comment #12) OK, thanks for the clue. I have a great mentor inside the FreeBSD community who suggested the same, but since it's farokhi@'s port I don't want to mess too much with it. I will change and submit an updated patch later today.
Created attachment 247945 [details] upgrade patch net-mgmt/fastnetmon: Update to 1.2.6 - Updated dependency on gRPC - Fixed build with updated Protobuf - Fixed pid file logic - Customized configuration files and script are now preserved during upgrades
(In reply to Marek Zarychta from comment #14) Just test building it: https://gitlab.fechner.net/mfechner/Gitlab/-/commits/276516
(In reply to Matthias Fechner from comment #15) Of course, it builds and runs fine, otherwise, I wouldn't submit it. http://pkg.pansjar.eu/data/builder13stable-default/2024-01-25_11h18m22s/logs/fastnetmon-1.2.6.log http://pkg.pansjar.eu/data/builder14stable-default/2024-01-25_13h47m36s/logs/fastnetmon-1.2.6.log
LGTM. I will test and commit.
Created attachment 247958 [details] Patch for fastnetmon Improvements on Marek's patch * PORTVERSION --> DISTVERSION (and order of variables) https://docs.freebsd.org/en/books/porters-handbook/book/#makefile-master_sites-github * Drop USE_CXXSTD (not needed) https://github.com/pavel-odintsov/fastnetmon/blob/v1.2.6/src/CMakeLists.txt#L66 * Drop devel/json-c in LIB_DEPENDS (bogus dependency) * Use WRKSRC_SUBDIR * Drop -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED * Remove LLVM version requirements, not needed * Use CMAKE helpers * Rearrange Makefile for better readability * Disable unsupported -W switches making the build a lot less noisy * Don't add bogus include paths Poudriere testport ok on 13.2 and 14.0 (amd64) NOT runtime tested This port should probably also use USES= ncurses ?
I forgot to add, fixes location of manpages
(In reply to Daniel Engberg from comment #18) Thank you for polishing this port and updating canproto in bug 276617 which made the building process a lot easier!
(In reply to Daniel Engberg from comment #18) Works fine in production for a few days.
Hello! Thank you very much for doing such great progress and thank you for your effort in upgrading FastNetMon port. Looking forward to see it merged to make announcement to community.
I was able to test FastNetMon running in netmap mode on FreeBSD 14.0-STABLE stable/14-n266656-da9cc2e97be3 and I have to confirm that it works great. We can get rid of the spurious patch files/patch-src_netmap__plugin_netmap__collector.cpp though this patch is rather harmless.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=77c0579bf6608c0691170fcf1e86e620b38a150f commit 77c0579bf6608c0691170fcf1e86e620b38a150f Author: Daniel Engberg <diizzy@FreeBSD.org> AuthorDate: 2024-02-18 09:22:53 +0000 Commit: Daniel Engberg <diizzy@FreeBSD.org> CommitDate: 2024-02-18 16:16:12 +0000 net-mgmt/fastnetmon: Update to 1.2.6 * Switch from PORTVERSION to DISTVERSION * Remove USE_CXXSTD (no longer needed) * Drop devel/json-c in LIB_DEPENDS (not used) * Use WRKSRC_SUBDIR * Drop -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED switch * Remove LLVM version requirements (no longer needed) * Use CMAKE helpers * Rearrange Makefile for better readability * Disable unsupported -W switches making the build a lot less noisy * Remove bogus include paths Based on patch submitted by Marek Zarychta Changelog: https://github.com/pavel-odintsov/fastnetmon/releases/tag/v1.2.6 PR: 276516 Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> Reviewed by: farrokhi (maintainer, previous version) Tested by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> Approved by: portmgr (maintainer timeout, 2+ weeks) net-mgmt/fastnetmon/Makefile | 66 +++++++++------------- net-mgmt/fastnetmon/distinfo | 8 ++- net-mgmt/fastnetmon/files/fastnetmon.in | 2 +- .../fastnetmon/files/patch-CMakeLists.txt (new) | 30 ++++++++++ net-mgmt/fastnetmon/files/patch-src_fastnetmon.cpp | 4 +- .../fastnetmon/files/patch-src_man_fastnetmon.8 | 4 +- .../patch-src_netmap__plugin_netmap__collector.cpp | 4 +- net-mgmt/fastnetmon/pkg-plist | 10 ++-- 8 files changed, 75 insertions(+), 53 deletions(-)