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
multiplatform build automation tool? #81
Comments
I am not familiar with those tools. Tell me what we get if we accept those tools, especially for embedding purpose. |
Two primary reasons: better target support maintainability, and increased project velocity/robustness.
The great thing about either of the build tools is they enable contributors to spend their precious time in a more efficient way by having the tool do much of the grunt work. Of course, it takes effort to create and maintain the meta-build info, but the leverage and target coverage is greater and easier. While applicable, I do not consider the |
I have some experience with Cmake, and it's better than autotools, and works on more platforms, including Windows. Another additional advantage (over,, say, waf) is that cmake makes cross-compiling relatively easy. So it becomes easier to make, say, mingw binaries for windows without having to actually run windows. The only downside I can think of to cmake is that it's syntax is a bit different than most other tools. It's not too hard, but it takes a while getting used to. I' think I'll quickly try to make a cmake build system now to see how hard it really could be. |
@beoran I'd cloned mruby and started a I paused to see if there was other interest. Let me know if you want commit access to that clone, and there may be others who will want to join in. |
Thanks for that but I had already started before I saw your message. I now have a cmake system that works on linux here: NOTE: The original Makefile build system had a few quirks in them, which I didn't duplicate. In stead the build logic is like this:
TODO: make this work on windows too, support build options to generate mrbconf.h, etc... I hope this will be useful. Edit: Another thing I forgot to mention is that in some embedded environments you need to cross-compile a lot from a developer's pc to the architecture of the device that mruby will run on. With cmake, cross compiling will be easier than with a hand-made build system. You need a single toolchain file and then you're good to go, as described here: |
Fantastic! I just deleted my branch and will look at what you've done. Best to keep all the focus directed at sending you pull requests so that Matz can quickly see how a CMake solution might add value. Are you planning to create reusable macros/functions in a top-level |
Yes, I leave the possibility of a cmake directory open, but only if that is really needed for such a relatively easy to build project as this one. The goal should be to keep the CMakeLists.txt are easier to read and work with that the old Makefiles were. |
After testing more I fond a bit of a problem with my cbuild approach. The main problem is that the way it's built now, libritevm_static and libmrblib_static have a cyclical dependency. When you link an application that wants to embed them, you have to do |
I pushed an update to my cmake branch that solves this, using object libraries, but you need cmake 2.8.8. |
Just a small feedback from a Mac to your branch:
I made a cmake:
And then my build exit with following error:
My cmake version is:
|
Thanks for the info, but other than thinking "that is weird", I don't quite know what I could do about this problem... Could you investigate a bit more on your side please? Oh, and you do have bison installed somewhere, right? Otherwise the parser may not get built correctly... |
It appears the cmake prototype needs more refinement before submitting a pull request for Matz to review. @beoran @bovi as a way to speed up collaboration by enabling a place to refine the cmake mods, I've added you both to the https://github.com/thecodeshop/mruby repo and pulled in @beoran branch under While I'm going to focus on Win32 tweaks and out-of-tree builds so as to not clobber existing Makefiles, I strongly feel that the cmake prototype should be able to build *nix, OSX, and Windows before submitting a pull request. Background on that repo...I specifically setup The Code Shop to enable quick ad-hoc collaboration like this with the goal of getting the mods accepted upstream. I've also set up a moderated mailing list we can use if it makes things easier than trying to collaborate by only replying to this issue. A few of us are working other Ruby mods at TCS, so if you use the ML simply add "[mruby]" to the subject. I'm not trying to force TCS as the way to collaborate, but rather, I'm offering to open it up if it adds value to anyone wanting tweak on a CMake/mruby build system. I'm most interested in seeing us quickly show a CMake prototype in it's best light for Matz to review. |
johnforums, I think all in all that's a good idea, since I'm working on linux, and you seem to work on windows, and bovi on osx. However, I don't like to join mailing lists since they generate a lot of traffic that I find hard to keep up with. I prefer forums or issues like this one. Anyway, let's work on this together. I already cloned that repo, and I pushed asmall change: a build directory. I think it may be valuable to do out-of-tree builds so the orginal Makefiles can be kept as they are, and the CMake build system then doesn't interfere with the Makefile-based one. |
@beoran agreed re: noisy MLs. Although the ML is relatively low traffic, I've turned on Issues at the repo so we can use either. Just synced with your mod...like the |
@bovi I've solved the undefined symbols error on both Win7 32bit and Arch 32bit with this commit Please try my branch and reply to this issue to confirm that the commit fixes the symbols error you saw on Mac. |
It's running! |
@bovi great, thanks for testing so quickly! The focus now switches to:
Once these have stabilized, I'll squash down the current gaggle-o-dev-commits and submit a pull request for Matz' review. If accepted, further development should happen as part of this repo. That said, if you're at all interested in this issue, please don't hesitate to test and post issues over at the issues list ps...currently, it also builds using clang 3.1 (svn) + mingw 4.6.2 on Win7 32bit :) |
It's in good enough shape to ask for review and more testing. A post to help you quickly get up and going: http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html |
Thanks to @nkshigeru and 1de8100 the Windows SDK/nmake build using Build success stories summarized on the CMake-compatible wiki page; please update as you discover more. |
IMO, Makefile is OK, just keep the source code and build process clean and simple. |
By the way, I love cmake. :) |
Since mruby has libraries written in Ruby, build process is more complex than Lua. |
Currently, The cmake proto does this with no problems when building natively on OS X/Linux/Windows, but I've not yet coaxed cmake to do the right things for cross compiles. The key issue is to create an I think the key is to get cmake to switch build toolchains/environments during the cross build process so it builds both native and cross versions of I'd like to hear from someone with deeper cmake experience if/how this is possible and whether there's a cleaner way. |
I'm now able to cross compile for windows from arch or ubuntu 12.04. It needs more testing especially on OS X with a recent mingw-w64 cross-compiler http://jonforums.github.com/ruby/2012/05/13/cross-compiling-mruby.html |
I've added It has the following behavior:
Since the proto currently supports all the major use cases (native builds on Linux/OS X/Windows and cross compiles from Linux/OS X for Windows) I plan to clean up and submit a pull request by next Friday. There are plenty of needed refinements, but nothing currently is a showstopper. Enhancements should now be done as part of the official mruby repo if Matz accepts the pull request. As such, I ask that you run it through the test gauntlet in the next few days. Specifically:
As always, submit problems here and list working configs here. |
I was actually going to look at trying a cmake conversion, happy to see someone else already did one. I've got a lot of cmake experience, so I'll try to look at it as well. The skinny on cmake: it's a love/hate relationship. Their own language is just barely suitable; doing anything complicated can be really frustrating but it's always possible (I say this as someone who has written cmake macros that are >500 lines long :-) However, once you get it all set up it works great. In my experience it's the best way to maintain code that needs to work cross-platform, since you can get Visual Studio .sln/.vcproj files from the same cmake files that produce your UNIX Makefiles. tl;dr -- one vote for cmake |
I don't mind moving to cmake. I am waiting pull-request. |
I'm sculpting commits in preparation for submitting a pull request later today. Thanks to all who tested and provided feedback. In particular, thanks to @beoran for the initial version, @bovi for watching out for OS X Lion, @luislavena for OS X Snow Leopard testing, and @nkshigeru for ensuring builds work on Visual Studio 10. |
closed via 618697c |
Is either of the following build tools viewed as a welcome inclusion to mruby?
waf - Python-based build framework
cmake - Makefile/project generator
The text was updated successfully, but these errors were encountered: