-
Notifications
You must be signed in to change notification settings - Fork 937
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
Port the build system to cmake #94
Comments
I'd be all for this - will improve the sketchy MinGW and MacOSX support in the Makefiles. The added benefit would be that the library would be buildable across all Visual Studio versions 2005 - 2013 depending on support in the C/C++ code. One build description to rule them all. Could provide a simple 👍 |
I don't know CMake - I mean, I know the name and I know there is a web site, but I never used it, and I did not even read any documentation yet. So personally, I can not add a CMake build myself - would you do this? What does CMake actually do exactly? Is it a generator for tool / compiler specific project files / Makefile? One problem with Mac OS X support is, I do not have a Mac, so I must mainly rely on other contributors to take care about Mac OS X support. My main development platforms are Windows and Linux. The standalone executable for Windows on SourceForge is a Visual Studio build. Since Civetweb is mainly one .c file, the Makefile is often not too much of an issue: users that want to embed Civetweb into their C/C++ applications can simply add this .c file into their existing project files. |
There is a Mac I have access to so can verify the build on that. CMake is just a 'meta' build system - it generates whatever you tell it to. As civetweb has just a few files to compile will make the cmakelists.txt really simple and easy to maintain. As this is a open source project we can also submit Travis CI and appveyor support which is free online builds for Linux, MacOSX and Windows. They will build every commit to master and also each PR. Then you'll know if any pull requests will break the build on any platform. I can work with @cdbishop to get a branch together for this support if you would be happy with those changes to the project? |
Bit more on CMake. You define the build files and the targets you want to build (executable/libraries) and it then has all the information needed for generating the correct build files. Its really simple and easy to maintain. We will look into the lua and openssl dependencies as part of the branch. CMake has support for modules that find third party libraries in a nice manner. I'm almost certain popular projects such as lua and openssl will be supported. There are generators for pretty much any build system and OS combination you can imagine! This greatly reduces the burden on the project to support build systems that users will need. As part of the branch we will add build instructions in the |
Indeed, this could be quite useful. Does this system build binaries you can also download and test? Currently the build instructions can be found in this file: |
Travis CI and appveyor both have the concept of build artefacts that are stored. These are generally the result of the build; executables, libraries, log files, etc. So you could store the built binaries for download if you like. |
This sounds quite interesting. Could it be used to build the archives in a form they are stored at the SourceForge page (http://sourceforge.net/projects/civetweb/) for the different platforms (e.g. http://sourceforge.net/projects/civetweb/files/1.6/ for the last release version). |
Just adding my +1 for CMake support. |
I don't know if github releases are suitable as daily builds. I would download the daily built executable files for tests. |
Yep. Travis has a "script:" field and you provide it the command to run. |
There is actually a "travis" file I inherited with the repository, but it's not maintained (I don't know what it actually does): https://github.com/bel2125/civetweb/blob/master/.travis.yml |
Create an account at http://travis-ci.org then it tries to build all your GitHub projects that have that file in them. |
@bel2125, Both travis and appveyor support post build tests - I was planning to port the tests to CMakeTest so that they are correctly translated into each of the generated build files. I've started a branch at vcatechnology/civetweb@cmake, I'll keep working on it when I have time. |
Which system would you recommend: Travis or AppVeyor? |
@bel2125, both. Travis CI only supports Linux and MacOSX. Appveyor supports Windows. I recently did the appveyor support for google/benchmark#64 (It already had travis CI support) |
OK. So we will need both anyway. |
Yep! All free and continuous. Also, any pull requests are automatically built so you know before you merge if it'll break the build. |
@bel2125, I've pushed up the first tiny bootstrapping to the cmake branch.
It adds a load of warning flags if the compiler supports them. |
Things to do:
|
[X] being fascinated, that check boxes can be added as comments ;-) |
@bel2125, gotta put a |
@bel2125, how on earth do you keep track of not breaking anything in this project? There are so many different paths the compilation can go through with the different features that can get turned on. The only way I can see this being checked is to build all configurations in Travis CI and appveyor. What have you been doing up until now? |
;-)) I use different development environments. Sometimes I use Visual Studio 2010 Express on an XP PC, which I consider a "minimal Windows". Sometimes I use a rather plain Ubuntu, sometimes Qt on Win8, VS2012 on Win7, then I have a couple of VMs, ... ARM Devices ... Sometimes I work here, then I work there. And every time I switch from one machine to another I rebuilt all projects to get the different #ifdef combinations tested. This way, the server stays free from compile errors. Or better, if some code is introduced that compiles only on one machine, after a short while when I move to another one it will be corrected. |
One of the most important tests for me is that the selected examples are building. Probably I should sort the repository into maintained examples and old ones, and maybe even remove the old ones one I am sure they do not show anything that is not also shown in an actively maintained example. For windows, the active examples are the ones in the solution file. For Linux I have a script. |
@bel2125, OK. I'll try and set up the build servers to build all combinations so they are always tested. That'll reduce the issue noise for "You broke my build on [insert OS], [insert compiler]". The can't cover all combinations (especially ARM devices) but should help out a lot. I think we should remove anything from the repository that isn't maintained (examples, tests, etc) and add them back in if they are going to be maintained. I'm finding it a little confusing what is the 'correct' things to be porting to the new build system! I've got the build working for the plain build (no websockets, no ipv6, etc) and will port over the unit tests to CTest (CMake's testing environment). If I then set up the build server do you think you could work with me to sort out the compilation issues. I have quite a few unused function, shadowing variables and function pointer casting errors on GCC. I have a few fixes in my branch but need to run them past you as I don't know the history of the project. |
I can start to move the unsupported files in an "obsolete" directory. I would delete them when I'm sure that everything shown there is shown in a new, maintained example as well. Or I just rename "examples" to "examples_old", create a new "examples" directory and move them back one by one. Should I have a look at some fixes you needed? |
I am just now reading this, after implementing the Travis CI support to use the make file and run some tests. I am familiar with CMake and would be happy to help here. I don't do Windows, so that doesn't help on many of the issues. I can update the Travis stuff I've done as soon as the CMakeLists is committed, just ping me here. |
Should be fixed for latest HEAD. |
"Should be fixed" means I should add the patch mentioned in this comment (libcheck/check#26 (comment)) somewhere in a file in civetweb? |
You could add the patch, or update civetweb to load the library from git directly instead of the archive. |
Probably using a released version of the check library instead of the development version is the better choice in the long term. I don't want to have civetweb builds failing because I did use some unstable intermediate development version of the check library. |
I suggest reverting 2a90968, and then using libcheck 0.10.0 and applying libcheck/check@c82fe88 (taken from libcheck/check#29 ). libcheck/check@c82fe88 applies cleanly to 0.10.0 when cherry picked, so I'd imagine it would work just as well when extracted to a The URLs for 0.10.0 and the patch are: I can make a pull request following this suggestion later. |
I just wanted to know if it works with the current version of check on github - I did not want to use this as a default on the long term, but switch to a released version later. A pull request with released version + patch would be welcome. |
This reverts commit 2a90968.
This reverts commit 2a90968.
Revert "Test newest development version of libckeck (see civetweb#94)" This reverts commit 2a90968.
Revert "Test newest development version of libckeck (see civetweb#94)" This reverts commit 2a90968.
I'm not sure that it nails civetweb's osx issues, but #286 updates to the latest released libcheck and adds the patch that was needed to make libcheck's own tests work on OSX. |
Thank you for the patch. |
The current reason OSX does not build seems to be related to an "unreachable code" warning in the unit test:
Since we build with warnings as errors, the entire build fails.
GCC does not seem to respect this pragma It actualy does not state
/home/travis/build/civetweb/civetweb/test/public_server.c:108:9: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
|
Formating went wrong in the message above, and the edit button does not work now ... I want to disable The builds for Linux are stable, and the CI works well for them - the build for OSX is experimental, and since I do not have an OSX device available locally, I can not even do much to improve this. Otherwise I would have to deactivate the OSX builds again. |
Looks like in the top-level CMakeLists.txt CIVETWEB_ALLOW_WARNINGS is set OFF by default. Maybe you want ON there? |
Allowing warnings for OSX only worked well. Thank you for this hint. However, it seems the check framework has another issue with OSX:
|
In the current TravisCI build, all configurations work, except those for OSX. Unfortunetely the allow_failure configuration (see comment from 5 days ago) does not work, so the overall buils status is allways failed. I think I'll have to remove OSX again from the build script. |
Currently TravisCI only offers experimental support for OSX, the check unit test framework does not work for OSX now, and I can not do the tests locally. See #94
Since the OS X CMake build is functioning now, I think this can be closed? |
This thread was created for the entire transition to CMake, the Travis CI integration (Linux and OSX), AppVeyor (CI for Windows) and Coveralls (Test coverage check), including building third_party components like Lua with CMake. But after more than a year and 165 comments, this issue became somewhat overloaded and unclear.
|
I think, the CMake integration has reached a state where I can consider this issue as closed.
|
…gnore. This closes civetweb#94 Signed-off-by: Tony Kurc <tkurc@apache.org>
Would there be interest for a pull request which replaces the makefiles with a CMake build implementation?
This change will help maintain & improve the cross platform support.
It would be beneficial if I could build Civetweb for multiple versions of visual studio for instance.
Thoughts?
The text was updated successfully, but these errors were encountered: