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

cmake: Depend on libbsd if DPDK depends on it #2412

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

p12tic
Copy link
Contributor

@p12tic p12tic commented Aug 28, 2024

Fixes #2411.

If libbsd-dev is installed during build time, DPDK will depend on it without a way to turn this off.

config/meson.build has the following:

libbsd = dependency('libbsd', required: false, method: 'pkg-config') if libbsd.found()
    dpdk_conf.set('RTE_USE_LIBBSD', 1)
endif

And lib/eal/include/rte_string_fns.h contains:

#ifdef RTE_USE_LIBBSD
#include <bsd/string.h>

#else /* no BSD header files, create own */
#define strlcpy(dst, src, size) rte_strlcpy(dst, src, size)
#define strlcat(dst, src, size) rte_strlcat(dst, src, size)

#endif /* RTE_USE_LIBBSD */
#endif /* FREEBSD */

Accordingly the only way to address this inflexibility is to ensure that dpdk dependencies are appropriately transferred to INTERFACE_LINK_LIBRARIES of the dpdk library.

cmake/Finddpdk.cmake Outdated Show resolved Hide resolved
cmake/Finddpdk.cmake Outdated Show resolved Hide resolved
cmake/Finddpdk.cmake Outdated Show resolved Hide resolved
cmake/Finddpdk.cmake Outdated Show resolved Hide resolved
@tchaikov
Copy link
Contributor

@p12tic hi Povilas, do you plan to continue working on this pull request?

If libbsd-dev is installed during build time, DPDK will depend on it
without a way to turn this off.

config/meson.build has the following:

libbsd = dependency('libbsd', required: false, method: 'pkg-config')
if libbsd.found()
    dpdk_conf.set('RTE_USE_LIBBSD', 1)
endif

And lib/eal/include/rte_string_fns.h contains:

#ifdef RTE_USE_LIBBSD
#include <bsd/string.h>

#else /* no BSD header files, create own */
#define strlcpy(dst, src, size) rte_strlcpy(dst, src, size)
#define strlcat(dst, src, size) rte_strlcat(dst, src, size)

#endif /* RTE_USE_LIBBSD */
#endif /* FREEBSD */

Accordingly the only way to address this inflexibility is to ensure that
dpdk dependencies are appropriately transferred to
INTERFACE_LINK_LIBRARIES of the dpdk library.

Signed-off-by: Povilas Kanapickas <[email protected]>
@p12tic
Copy link
Contributor Author

p12tic commented Sep 22, 2024

@tchaikov Sorry for the delay in responding, I was away for a bit.

I have applied all your comments, the PR should be ready to go.

Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

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

lgtm

@tchaikov
Copy link
Contributor

@scylladb/seastar-maint hello maintainers, could you help approve for the workflow and probably review this change as well? so we can test this change?

@avikivity avikivity merged commit e9915cc into scylladb:master Sep 23, 2024
15 checks passed
@p12tic p12tic deleted the fix-build-dpdk branch September 25, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Current master fails to build with DPDK on Debian stable (bookworm) if libbsd-dev is installed
3 participants