Repository navigation
start using CMake to fetch + build more dependencies - #15796
Conversation
|
Perhaps, I am new naive, but why "fetch source and build" rather than "fetch already built?" Certainly, fetching and building is one step better than putting third party source in a repo, but not building third party source at all is even better than that. https://github.com/ChristopherPisz/HelloWorldCpp https://conan.io/center/recipes/hunspell?version=1.7.2 For anything not up on a public repo, not available in a particular OS+arch+version combination, or that we have to patch, or do ourselves, we can always create our own pkgmgr repository that can be pulled from. https://docs.conan.io/2/tutorial/conan_repositories.html |
Definitely a good question. I haven't actually evaluated whether we could use Conan, but my instincts here were:
FWIW, I think we could obviate the cost of rebuilding 3rd-party dependencies by getting those baked into the Docker images we use for builds as well. If we did use a C++ package manager, we might want to evaluate vcpkg as well. |
The Conan recipes allow you to specify OS, arch, version, ABI, all that jazz. Installing conan is also quite easy The simplicity of the cmake in the "hello world" I linked demonstrates how all you really need to do is list what you want and the version in the conanfile.txt file. It only uses gtest in that example but should give the idea. I am also a fan of the cmake presets way of doing things.
Same scenario, host our own, or even put it up on the central repo depending on licensing and whatnot.
Baking into docker images would be good, but is there potential pain when changes need to be made after no one put eyes on how it got in there and was hooked up after years? With conan, it's all handled for you and all you have to worry about is your user profile settings (OS, version, compiler, ABI stuff) , and the simple textile list of dep names and versions.
I have already done some months of work with conan and vcpkg. I'm no expert, but I was able to get a project or two going. vcpkg was built from the ground up to still vendor source, and it had a heck of a lot of bad packages that exploded in their central repo when I tried it in a past company. Do not recommend. Conan is far superior. ...... I try to sell people on Conan whenever I can. I don't think we have a dedicated devops team to pitch it to, so I like to mention it any time third party deps come up :P |
|
How should conan profiles be handled? Are these something we would generate and use from CMake (seems like https://github.com/conan-io/cmake-conan/blob/develop2/conan_provider.cmake is a tool that tries to automate some of this)? Or do they need to be pre-populated and pre-generated by hand? FWIW, the default profile created by and this came down to the computed compiler version being "too new" compared to the binaries currently available. I'm sort of inclined to keep this PR as-is for now, and re-evaluate Conan separately in the future. |
I don't have the ins and outs of the current pipeline down pat yet, but I'd think you'd set up profiles when the container is setup in the docker files. That's what I did. For example, when I make an ubuntu x64 jammy container, I include in the docker file the conan profile that tells it deb, x64, gcc, gcc version 11, etc. Oh, I was def not implying to throw away or replace the work in this PR. I def think Conan should be evaluated in at least few demo run-throughs before locking in on doing the bigger effort. I'd be happy to help make some demos, as time allows, if we have a list of some of the dependencies, their versions, target OS, compiler version. As you are seeing, a binary might not always be avail for the combination of settings and when that is the case, we have to build it once ourselves, make the recipe, and either upload it to central or put it in out own artifact repo. However, it is well worth the work, because everyone else need not ever build it again. Compiling from source is A LOT of hours and cpu cycles on dev boxes and build machine over time. When I had set it up in the past, I had devops set up an instance of https://jfrog.com/artifactory/ |
| # assume sources are utf-8 | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8") |
There was a problem hiding this comment.
This seemed to be required for the {fmt} update.
Intent
Addresses #15792.
Approach
Start using CMake tools for checking out + building dependencies, and use that to pull in and build Hunspell.
Automated Tests
N/A
QA Notes
N/A
Documentation
N/A
Checklist
NEWS.md