Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to build a standalone plugin #15

Closed
blshkv opened this issue Apr 26, 2018 · 12 comments
Closed

unable to build a standalone plugin #15

blshkv opened this issue Apr 26, 2018 · 12 comments
Assignees
Labels

Comments

@blshkv
Copy link

blshkv commented Apr 26, 2018

git clone && mkdir build && cd build && cmake .. :

-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Wireshark: found neither WiresharkConfig.cmake nor wireshark-config.cmake 
-- Wireshark libraries not found, performing a Wireshark plug-in build.
CMake Error at CMakeLists.txt:53 (include):
  include could not find load file:

    WiresharkPlugin


CMake Error at CMakeLists.txt:54 (set_module_info):
  Unknown CMake command "set_module_info".


-- Configuring incomplete, errors occurred!

I have checked, and there is no WiresharkPlugin file indeed.

@blshkv blshkv changed the title unable to build standalone version unable to build a standalone plugin Apr 26, 2018
@blshkv
Copy link
Author

blshkv commented Apr 26, 2018

I think FindWireshark.cmake is broken completely. You can't run find_package(Wireshark ... from it. It will be calling itself.

@blshkv
Copy link
Author

blshkv commented Apr 26, 2018

ok, that's the way how I fixed it:

  • copy an old FindWireshark.cmake file (0.4.2)
  • adjust CMakeLists.txt variables

@martingalloar
Copy link
Contributor

Hey thanks for this! This is strange, as my dev machine as well as Travis using Wireshark 2.4.4 from wireshark-dev Ubuntu PPA is building properly the standalone plugin. See for example https://travis-ci.org/CoreSecurity/SAP-Dissection-plug-in-for-Wireshark/jobs/368400942. Unit tests are failing due to some other issue, but see line 1167:

-- Found Wireshark: /usr/lib/x86_64-linux-gnu/wireshark/WiresharkConfig.cmake (found version "2.4.4")

What particular Wireshark version are you using?

@blshkv
Copy link
Author

blshkv commented Apr 26, 2018

hm.. interesting. I have 2.4.6 installed but there is no WiresharkConfig.cmake provided. Let me try to figure it out

@blshkv
Copy link
Author

blshkv commented Apr 26, 2018

https://bugs.gentoo.org/654158

So it looks like a Gentoo bug. I'm closing this ticket for now. Thank you for the hint!

@blshkv blshkv closed this as completed Apr 27, 2018
@blshkv
Copy link
Author

blshkv commented Apr 27, 2018

Hm.. ok, it is not a Gentoo bug. Apparently, wireshark supports both cmake and autotools build tools.
Some distros compile wireshark using cmake and WiresharkConfig.cmake with all variables will be generated and installed. However, other distros like Gentoo might use autotools and this file will be missed.

Would you consider reverting back to an independent approach?

@blshkv blshkv reopened this Apr 27, 2018
@blshkv
Copy link
Author

blshkv commented Apr 27, 2018

FYI, wireshark provides wireshark.pc file so the pkg-config command works as well (as an alternative to the previous version of FindWireshark.cmake):

bash$ pkg-config --variable=plugindir wireshark
/usr/lib64/wireshark/plugins/2.4.6
bash$ pkg-config --modversion wireshark
2.4.6

@martingalloar
Copy link
Contributor

Thanks again! I'll try to take a look on the best way to support this scenario, but as you said it might be that I'll need to reintroduce supporting autotools builds.

@martingalloar martingalloar self-assigned this May 2, 2018
@blshkv
Copy link
Author

blshkv commented May 2, 2018

that's not exactly what I suggested ;-) pkg-config does not depend on either of them. It is possible to call it from a cmake script as well (similar to FindGLIB2.cmake script?). There is also the following comment in the old cmake file:

wireshark does not install its library with pkg-config information

This is no longer true. wireshark.pc seems has enough information and it should be possible to detect required variables without WiresharkConfig.cmake

btw, Gentoo devs agreed to migrate to cmake (just 1 hour ago) and it is no longer an issue for this distro

@martingalloar
Copy link
Contributor

Oh OK, just re-read it and it makes more sense to me know that you clarified that piece.

@martingalloar
Copy link
Contributor

As this was already solved in Gentoo, and also Wireshark has just moved into fully removing support for autotools (https://code.wireshark.org/review/#/c/26969/), I'm closing this one.

@blshkv
Copy link
Author

blshkv commented Jul 12, 2018

That is correct, Gentoo has fixed my report, however they migrated the latest 2.6.1 wireshark only.
It is stable in Gentoo and we are unable to install sap plugin anymore. Please release a new version ASAP, I bugged you about it already here:
#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants