-
Notifications
You must be signed in to change notification settings - Fork 89
added Avro support for KafkaAdapter #645
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
e3ea18f
8ce67ec
7396b22
aa8a87b
7eaf32a
1f4ab48
26b6b99
cbdb742
63bfb8b
e0d5cd9
e9d65cb
acd75a1
fda0344
ec0d6b7
d2e8cf7
f064828
eb68a6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| find_path(Avro_INCLUDE_DIR NAMES avro/Encoder.hh) | ||
| find_library(Avro_LIBRARY NAMES avrocpp libavrocpp) | ||
|
|
||
| if (NOT TARGET Avro::avrocpp) | ||
| add_library(Avro::avrocpp SHARED IMPORTED) | ||
| set_property(TARGET Avro::avrocpp PROPERTY | ||
| IMPORTED_LOCATION "${Avro_LIBRARY}") | ||
| target_include_directories(Avro::avrocpp INTERFACE ${Avro_INCLUDE_DIR}) | ||
| endif() | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(Avro DEFAULT_MSG Avro_LIBRARY Avro_INCLUDE_DIR) | ||
| mark_as_advanced(Avro_INCLUDE_DIR Avro_LIBRARY Avro::avrocpp) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,13 @@ find_package(DepsKafkaAdapter REQUIRED) | |
|
|
||
| target_link_libraries(csp_kafka_adapter PUBLIC csp_adapter_utils RdKafka::rdkafka RdKafka::rdkafka++) | ||
|
|
||
| # Link Avro library | ||
| if(CSP_USE_VCPKG) | ||
| target_link_libraries(csp_kafka_adapter PUBLIC unofficial::avro-cpp::avrocpp) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The overall state of avro packaging (both in conda and vcpkg) really gives me hesitation on adding it as a build-time dependency of csp. I'd much prefer if we could split this out into it's own project, but not sure how feasible that is given our adapter ABI is still a WIP.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Kafka adapter with Avro support is already fully optional (CSP_BUILD_KAFKA_ADAPTER=ON/OFF). With this PR, on Windows conda-forge builds where avro-cpp is incompatible, it automatically disables itself with a clear warning - no build failures, no patches, just graceful degradation. I agree the avro packaging situation is frustrating. Once the adapter ABI stabilizes, splitting this into a separate project would make sense. For now, keeping it optional within CSP seems like the pragmatic path - users who need Kafka/Avro can enable it, others aren't affected.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but I assume we are going to build CSP (for distribution) with Avro enabled, just like we build with Kafka enabled currently. So it's not optional from the perspective of the userm who installs pre-built csp from conda/pypi
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we wait then for ABI to stabilize before merging it?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can merge it as an experimental feature and if avro becomes a nuisance in our build pipeline we can always re-evaluate/remove it. @timkpaine what do you think?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we will eventually support separate adapters but for now i think its better to support everything we support on every platform, and not do platform-specific stuff. There should be no incompatible platform as this has caused problems in the past and makes life annoying for users. |
||
| else() | ||
| target_link_libraries(csp_kafka_adapter PUBLIC Avro::avrocpp) | ||
| endif() | ||
|
|
||
| install(TARGETS csp_kafka_adapter | ||
| PUBLIC_HEADER DESTINATION include/csp/adapters/kafka | ||
| RUNTIME DESTINATION ${CSP_RUNTIME_INSTALL_SUBDIR} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.