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

[New Port Request] <morganstanley/modern-cpp-kafka> #32897

Closed
zlojvavan opened this issue Aug 2, 2023 · 14 comments · Fixed by #32903
Closed

[New Port Request] <morganstanley/modern-cpp-kafka> #32897

zlojvavan opened this issue Aug 2, 2023 · 14 comments · Fixed by #32903
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving.

Comments

@zlojvavan
Copy link

Library name

morganstanley/modern-cpp-kafka

Library description

The modern-cpp-kafka API is a layer of C++ wrapper based on librdkafka (the C part only), with high quality, but more friendly to users

Source repository URL

https://github.com/morganstanley/modern-cpp-kafka

Project homepage (if different from the source repository)

No response

Anything else that is useful to know when adding (such as optional features the library may have that should be included)

No response

@zlojvavan zlojvavan added category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving. labels Aug 2, 2023
@xiaozhuai
Copy link
Contributor

xiaozhuai commented Aug 2, 2023

@zlojvavan

Please try #32903 to see if it works or not.


You can use following commands to get and apply patches and then install it.

curl -Ls https://github.com/microsoft/vcpkg/pull/32903.patch | git apply
vcpkg install modern-cpp-kafka

After this pr got merged, you may want to drop your local changes via

git checkout .
git clean -fd

@zlojvavan
Copy link
Author

@xiaozhuai
not quite there yet
I successfully installed it and had to replace kafka includes in my own code by prepending 'modern-cpp-kafka/" there as in #include <modern-cpp-kafka/kafka/Error.h> (was: #include <kafka/Error.h>) but still got numerous compilation errors such as

C:\Project\Libs\vcpkg\installed\x64-windows-static\include\modern-cpp-kafka\kafka\Error.h(3,10): fatal error C1083: Cannot open include file: 'kafka/Project.h': No such file or directory

on line 3 (#include <kafka/Project.h>) in Error.h file etc.

@xiaozhuai
Copy link
Contributor

xiaozhuai commented Aug 2, 2023

@zlojvavan

Do you use cmake?
Note the usage

find_package(unofficial-modern-cpp-kafka CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::modern-cpp-kafka::modern-cpp-kafka)

@zlojvavan
Copy link
Author

zlojvavan commented Aug 2, 2023

@xiaozhuai
not in this project, no
visual studio based project here

am I SOL? :)

@xiaozhuai
Copy link
Contributor

xiaozhuai commented Aug 2, 2023

@zlojvavan

not in this project

Cmake is recommened.

Nevermind, I've update this pr.

Please exec these commands:

cd /path/to/vcpkg
vcpkg remove modern-cpp-kafka
git checkout .
git clean -fd
curl -Ls https://github.com/microsoft/vcpkg/pull/32903.patch | git apply
vcpkg install modern-cpp-kafka

am I SOL? :)

Even if I modified this port, you may have the same issue on other ports. (This is to avoid path confflicts)
So... Use cmake will make your life easier.

@zlojvavan
Copy link
Author

@xiaozhuai

Cmake is recommened

I have some projects based on cmake but most of the time I find VS based projects more convenient

Please exec these commands:

that did the trick, and after reverting includes it compiled, thank you!

Even if I modified this port, you may have the same issue on other ports

never had such problems in several years of using vcpkg though

@xiaozhuai
Copy link
Contributor

never had such problems in several years of using vcpkg though

It did happen.
For example: libusb.
The official way (use cmake) is #include <libusb.h>
The VS based you need #include <libusb-1.0/libusb.h>

@zlojvavan
Copy link
Author

It did happen

so I was lucky then with the libs I used. you live and learn

if only there was decent converter from vs project to cmake one I guess I could have tried it :)

there are 10 projects in my project group (5 for windows and 5 for linux) and I'm not that fond of idea of manually creating all those projects for cmake

@xiaozhuai
Copy link
Contributor

I'm not that fond of idea of manually creating all those projects for cmake

Yes, it would certainly be better to have a unified include path for cmake based and VS based project, but sometimes it requires extra effort, or may not be possible.

@zlojvavan
Copy link
Author

btw, you were blazingly fast with solving static avro issue for me so I decided to throw a ball and this time it seemed even faster (though this one wasn't showstopper as I was able to build my projects with kafka wrapper without vcpkg assistance), much appreciated!

@xiaozhuai
Copy link
Contributor

much appreciated

You are welcome!
I'm a vcpkg user like you, and vcpkg solved the package management problems I had in the project very well, so I felt like doing something to give back to the community.
I go through the issue list in my free time and then help people solve problems.

@xiaozhuai
Copy link
Contributor

BTW, the CI is much slow. Sometimes it annoys me a little.

@zlojvavan
Copy link
Author

wonder whether there is any detailed documentation for dummies on creating new vcpkg ports...

btw do you think it's time to close both solved issues now?

@xiaozhuai
Copy link
Contributor

xiaozhuai commented Aug 2, 2023

wonder whether there is any detailed documentation for dummies on creating new vcpkg ports...

See https://github.com/microsoft/vcpkg#contributing

For creating a new port, you can exec vcpkg help create
For editing a exists port, you can exec vcpkg edit <port>

btw do you think it's time to close both solved issues now?

They will be automatic closed once the linked pr got merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants