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

Make CMake options for platform-dependent plugins depend on being build for a supported platform. #17517

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ferroin
Copy link
Member

@Ferroin Ferroin commented Apr 25, 2024

Summary

A large number of our external data collection plugins are Linux-specific, and a handful are dependent on specific UNIX-like platforms. This PR ensures that configuration options for these plugins do not show up if we are not building for a platform they support instead of failing configuration later on or silently disabling them.

No functional changes other than not being able to enable these options on unsupported platforms.

Test Plan

CI passes on this PR.

@github-actions github-actions bot added the area/build Build system (autotools and cmake). label Apr 25, 2024
@Ferroin Ferroin marked this pull request as ready for review April 26, 2024 08:34
@Ferroin Ferroin requested review from vkalintiris and a team as code owners April 26, 2024 08:34
@thiagoftsm
Copy link
Contributor

@Ferroin ,

Please, rebase the PR.
It is working as expected on Linux, in few hours I will take a look on FreeBSD.

Best regards!

@Ferroin Ferroin force-pushed the cmake-conditional-options branch from a1c338e to e2112e4 Compare May 1, 2024 11:09
@Ferroin
Copy link
Member Author

Ferroin commented May 1, 2024

Rebased to resolve merge conflicts.

@thiagoftsm
Copy link
Contributor

@Ferroin ,

I understand we also want to avoid installing these files on FreeBSD:

configure_file(src/collectors/cgroups.plugin/cgroup-network-helper.sh.in
               src/collectors/cgroups.plugin/cgroup-network-helper.sh @ONLY)
install(PROGRAMS
        ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-network-helper.sh
        COMPONENT netdata
        DESTINATION usr/libexec/netdata/plugins.d)

configure_file(src/collectors/cgroups.plugin/cgroup-name.sh.in
               src/collectors/cgroups.plugin/cgroup-name.sh @ONLY)

Best regards!

This will allow us to use the target platform to decide what options to
actually show to users.
This way users will only be able to enable plugins that will actually
work on their system.
@Ferroin Ferroin force-pushed the cmake-conditional-options branch from e2112e4 to 6cb1661 Compare May 16, 2024 12:53
@Ferroin
Copy link
Member Author

Ferroin commented May 16, 2024

Rebased to resolve merge conflicts.

Copy link
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is working as expected, on:

  • Slackware Current
  • FreeBSD 14
  • Windows 11

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Build system (autotools and cmake).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants