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

Ntopng fails to build on gentoo with gcc 13.2 invalid conversion from 'char**' to 'const char**' #8229

Closed
adippl opened this issue Feb 19, 2024 · 4 comments

Comments

@adippl
Copy link

adippl commented Feb 19, 2024

Environment:

  • OS name: Gentoo
  • OS version: current
  • Architecture: amd64
  • ntopng version/revision: 5.6

What happened:
Ntopng fails to build on gentoo with gcc 13.2.1_p20240113-r1::gentoo

src/LuaEngineNtop.cpp: In function 'int ntop_rrd_tune(lua_State*)':
src/LuaEngineNtop.cpp:5709:27: error: invalid conversion from 'char**' to 'const char**' [-fpermissive]
 5709 |   status = rrd_tune(argc, (char**)argv);
      |                           ^~~~~~~~~~~~
      |                           |
      |                           char**
In file included from src/LuaEngineNtop.cpp:25:

How did you reproduce it?
Package doesn't compile for me and other users.

Link to gentoo buzilla bug with patch solving this issue.
https://bugs.gentoo.org/861230

@lucaderi
Copy link
Member

I'm sorry, we won't be able to accept your fix because you are not using the same RRD library we are using. If you look at https://github.com/ntop/ntopng/blob/dev/third-party/rrdtool-1.4.8/src/rrd.h#L204 if we accept your patch we'll break our code.

@adippl
Copy link
Author

adippl commented Feb 20, 2024

Does ntopng officially supports only old rrdtool version 1.4.8 or is this a library fork?
Are there technical reasons for it?
A lot of other distributions like ubuntu, arch or debian ship significantly newer version of this library.

@eli-schwartz
Copy link

I'm sorry, we won't be able to accept your fix because you are not using the same RRD library we are using. If you look at https://github.com/ntop/ntopng/blob/dev/third-party/rrdtool-1.4.8/src/rrd.h#L204 if we accept your patch we'll break our code.

Please apply a patch that does work, then.

This should not be too complicated: Makefile.in checks for HAS_LIBRRDTOOL via pkg-config and in the absence of a pkg-config detected system copy it uses the included copy.

That check can set a -DHAS_LIBRRDTOOL which can then be used to conditionalize the patch logic to only apply on versions of rrdtool where it is relevant.

@adippl can you update the patch to do so and submit a PR?

@adippl
Copy link
Author

adippl commented Mar 17, 2024

@eli-schwartz I'm not super familiar with these build systems and cannot get this to work.
Could you create patch with this solution?

If I'm reading makefile.in correctly build system should auto build rrdtool-1.4.8 if system one isn't available.
I've tried to build this way but ntopng's rrdtool-1.4.8 failed to build on my system.

HAS_LIBRRDTOOL=$(shell $(PKG_CONFIG) --atleast-version=1.4.8 librrd && echo 0)

Also, It would be good idea to change pkg-config rrdtool version detection to --exact-version=1.4.8 since if officially supports only this version.

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

No branches or pull requests

3 participants