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

Switch to CMake for build process #226

Merged
merged 7 commits into from
Mar 23, 2016
Merged

Switch to CMake for build process #226

merged 7 commits into from
Mar 23, 2016

Conversation

GUI
Copy link
Member

@GUI GUI commented Mar 23, 2016

I recently stumbled upon CMake's ExternalProject functionality. I hadn't really used CMake before, but the ExternalProject feature solves our need to build other project dependencies within our project, and then bundle them all together (for example, OpenResty, Ruby, TrafficServer, etc). We had devised our own solution to this in our custom Makefile, but it had gotten a little unwieldy, and CMake solves this much more cleanly and robustly (and eliminates issues like build caching issues, we've tried to hack around).

So while I like the simplicity of standard Makefiles, and I'm not super-fond of switching our build process on a whim, there are several drivers for this that seem to make it worthwhile:

  • The aforementioned ExternalProject eliminates a lot of our custom code that's not nearly as robust.
  • After working to switch things over, it cuts the size of our build code in half (and the CMake version could still probably be cleaned up and made more modular).
  • CMake also provides CPack, which can generate binary packages (RPMs, DEBs) from the build. This more integrated approach helps cleanup and standardize our packaging process, and eliminates the need be using FPM to do this.
  • The primary driver for this switch happening now is that with CPack we can more easily generate multiple packages from the same build. I want this so that we can ship an optional api-umbrella-hadoop-analytics binary package as a way to package up the new hadoop-based analytics work, but in an optional fashion (so people not using hadoop for analytic won't have to have all those extra dependencies). It would be possible to build a separate package with our current Makefile & FPM approach, but CPack seems to over a much cleaner and standardized way to do this, rather than us inventing our own solution.
  • While CMake isn't quite as standard as standalone Makefiles, CMake's still a pretty common build tool that's widely available (and ends up generating makefiles), so it doesn't seem that different.

There's still some loose ends to tie up with the CMake functionality in this branch, but since one of the primary things I want from this switch is the ability to generate the separate "hadoop-analytics" package, I'm going to go ahead and merge this into the analytics-revamp branch to finalize some of those packaging details there. So this change won't really be going live until we fully wrap-up and ship the analytics branch, but I wanted to open a separate pull request to delineate this functionality and see if anyone has any opinions on CMake (we can always back out of this change on the branch later if anyone is opposed).

GUI added 7 commits March 6, 2016 23:09
CMake's externals handling might be a much cleaner and more reliable way
to handle building the various sub-projects. It also looks like we might
be able to use cpack to create our binary packages (rather than needing
fpm).
Without this, things like removing directories (during the make
process), could fail due to permissions being incorrect within the guest
OS.
@GUI GUI merged commit e0da677 into analytics-revamp Mar 23, 2016
@GUI GUI mentioned this pull request Mar 25, 2016
8 tasks
@GUI GUI deleted the cmake branch May 22, 2016 14:26
@GUI GUI added this to the v0.12 milestone Jun 30, 2016
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.

1 participant