git clone git@gitlab.com:wireshark/wireshark.gitcd wireshark/doc/plugins.example/mkdir build && cd buildcmake ..
What is the current bug behavior?
-- The C compiler identification is AppleClang 12.0.0.12000032-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped-- Detecting C compile features-- Detecting C compile features - doneCMake Error at CMakeLists.txt:15 (find_package): Could not find a package configuration file provided by "Wireshark" with any of the following names: WiresharkConfig.cmake wireshark-config.cmake Add the installation prefix of "Wireshark" to CMAKE_PREFIX_PATH or set "Wireshark_DIR" to a directory containing one of the above files. If "Wireshark" provides a separate development package or SDK, be sure it has been installed.-- Configuring incomplete, errors occurred!See also "/Users/<user>/git/wireshark/doc/plugins.example/build/CMakeFiles/CMakeOutput.log".
What is the expected correct behavior?
all build
i already try build wireshark for example
mkdir buildcd buildcmake -GNinja ..//successcd ../doc/plugins.example/build/cmake .. -DCMAKE_PREFIX_PATH="/Users/<user>/git/wireshark/build/"CMake Error at /Users/<user>/git/wireshark/build/WiresharkConfig.cmake:18 (message): File or directory /Users/<user>/lib referenced by variable Wireshark_LIB_DIR does not exist !Call Stack (most recent call first): /Users/<user>/git/wireshark/build/WiresharkConfig.cmake:34 (set_and_check) CMakeLists.txt:15 (find_package)-- Configuring incomplete, errors occurred!See also "/Users/<user>/git/wireshark/doc/plugins.example/build/CMakeFiles/CMakeOutput.log".
but it also not work(
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related or that one is blocking others.
Learn more.
The issue here is, I believe, that WiresharkConfig.cmake is not properly packaged in the macOS App Bundle.
And it seems you would like to build your plugin in the build tree. For that you will have to place your code in /plugins/{epan,codecs,wiretap} and manually add the newly created plugin path to CMakelists.txt.
And it seems you would like to build your plugin in the build tree. - no, i need a separate shared library(.dll/.so/.dylib)
building without installing Wireshark can be handy for ci, in other projects.
ideally, I would like to have a separate repository with everything you need (include folder & cmake files) for building plugins.
or at least so you can add wireshark folder as git sublodule
Ideally, I would like to have a separate repository with everything I need (include folder and cmake files) to create plugins.
or at least be able to add the Wireshark folder as a git submodule, and include in CMakeLists.txt
Ideally, I would like to have a separate repository with everything I need (include folder and cmake files) to create plugins. or at least be able to add the Wireshark folder as a git submodule, and include in CMakeLists.txt
You would have to write your own makefile/build for that. I don't think it requires much more than an extra include flag for the compiler and maybe one or two macro definitions (with symbol resolution at run time).
The plugins.example build requires a Wireshark system installation. Or you can add your plugin to the Wireshark source tree. Currently those are the two options available.
pwd - Wireshark/buildcmake -GNinja .. " -DCMAKE_INSTALL_PREFIX="/Users/<user>/git/wireshark/build_install"ninja installcd ../doc/plugins.example/build/cmake .. -DCMAKE_PREFIX_PATH="/Users/<user>/git/wireshark/build_install"-- The C compiler identification is AppleClang 12.0.0.12000032-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped-- Detecting C compile features-- Detecting C compile features - done-- Configuring done-- Generating done-- Build files have been written to: /Users/<user>/git/wireshark/doc/plugins.example/buildcmake --build .In file included from /Users/<user>/git/wireshark/doc/plugins.example/hello.c:16:In file included from /Users/<user>/git/wireshark/build_install/include/wireshark/epan/packet.h:16:/Users/<user>/git/wireshark/build_install/include/wireshark/epan/epan.h:22:10: fatal error: 'wsutil/plugins.h' file not found#include <wsutil/plugins.h> ^~~~~~~~~~~~~~~~~~1 error generated.make[2]: *** [CMakeFiles/hello.dir/hello.c.o] Error 1make[1]: *** [CMakeFiles/hello.dir/all] Error 2make: *** [all] Error 2
I mean that I'm trying to run the assembled wireshark.app but it does not work
Is that your intended use case, CI for Wireshark plugins? - if I understood you correctly, then no, but if the "build_install" folder is in a separate repository, then yes
I mean "is it your intended use case that you are developing your own plugin, want to run CI on it, and that is why, for some yet unknown reason to me, the pre-existing plugin build solutions don't suit you"...?
I don't think the Wireshark.app abort you pasted has anything to do with plugins.
To be clear, the issue with a missing macOS WiresharkConfig.cmake in the App Bundle seems like a legit bug. That should work, as far as I understand Apple's packaging guidelines.
I'm on macos now, homebrew doesn't have wireshark-dev
so to build the plugin I need to get WiresharkConfig.cmake from somewhere and everything else - the only way I see now is to build Wireshark to get the "installed" folder in which everything is
after I built Wireshark and got the installed folder
2.1) problem 1 - I cannot build the plugin because <wsutil/plugins.h/c> is missing in build_install/include/wireshark
2.2.1) I have never done install for CMakeLists.txt - so I don’t even know how to edit it / in what part of CMakeLists.txt - can you tell me?
2.2) Problem 2 - I can't run build_install / bin / Wireshark.app - it won't start
to build the plugin, I would not want to build wireshark entirely every time - so the question is - where should we publish "build_install"? by analogy with wireshark-dev package on "Linux"
3.1) I immediately thought about a separate repository ..
3.2) maybe it is worth making a formula for homebrew - but most likely I need to download somewhere
Thanks for the clear explanation. I think I understand the confusion. For the purpose of using plugins.example an installation on macOS means "running the installation target for the build", so make install or ninja install. That's the way to obtain WiresharkConfig.cmake. It's a standard UN*X build.
The Wireshark.app stuff hasn't been tested at all and most likely won't work. And I don't think you will have success running that from the build directory either (I don't use macOS so my understanding of its conventions is limited).
2.2.1) I have never done install for CMakeLists.txt - so I don’t even know how to edit it / in what part of CMakeLists.txt - can you tell me?
Check here. Let me know if you have other questions.
For the purpose of using plugins.example an installation on macOS means "running the installation target for the build", so make install or ninja install. That's the way to obtain WiresharkConfig.cmake.
not completely understood what you mean, if that for, building plugins.example requires "make install" then yes, I understand this, but since I do not want to clutter up my system, I specified a folder and then add this folder to -DCMAKE_INSTALL_PREFIX =
The Wireshark.app stuff hasn't been tested at all and most likely won't work. And I don't think you will have success running that from the build directory either
I don't mean binary Mac releases in general are unsupported. Sorry if that wasn't clear. I meant the development environment for building plugins is not supported by the *.dmg installation, as you've found out.
regarding question 2.1 - should I create a bug? (on v3.4.3 this problem is not present)
Not yet, I don't think it has been established that there's a bug. What is "build_install"?
3. - Let's think about how to do it? (where to store it?) or create a separate bug?
You don't need to build Wireshark every time. That's why /doc/plugin.example was created. That and easy distribution for out-of-tree source and binary plugins.