Repobuild – Declarative-style build system, like Google Build
github.com
github.com
Google's build system is awesome because it can force everyone in the company to use it, going so far as to put every single project in one huge repository.
And, then, crucially, the model assumes that any dev workstation can compile (or pull down via cache) every single upstream project.
In the non-catherdal/bazaar world, take any non-trivial Java project, and all of it's upstream dependencies, and some are built with Ant, some with Maven, some with Buildr, some with Gradle, some require thrift installed, some require who knows what installed.
And you can't just go back and add some meta-data of "oh sure, every Java project compiles src/main/java -> target"...their build files are going to have all sorts of crazy one-off steps (Maven plugins, whatever).
There is no enforcement of "you must make your build use this BUILD file, and, btw, only program in Java, Python, or C."
With all of Maven's warts, the jar-based repository with transitive dependencies is, IMO, it's major innovation. I just don't see a transitive upstream build-from-source model (like Google's) ever working in the bazaar that is Maven central.
I don't at all mean to say Maven/Maven repository are perfect--for one, it's ridiculous how many broken dependencies are in Maven central. Naively, I had thought that was automatically enforced/not allowed, but, sigh, no, we all have to deal with, say, the ASM developers completely breaking their API from v3 and v4 and forever cursing the rest of us with jar hell.
Transitively-resolved, platform-independent binaries are the big win coming from maven. Only once have I worked with a project where I required new system-level dependencies to compile & run a maven project; and I have never had a cross-platform issue when carrying projects across Mac & Linux.
To be fair, the import-compiled-transitive-dependencies-as-binaries pattern that Maven likes to employ is probably less easily adapted to natively compiled languages like C/C++ than it is to managed runtime languages (Java/Erlang) or scripting languages (Ruby/Python).
As much as it's a pain to work with "maven plugin spaghetti", it's at least deterministic and keeps things easy to figure out.
There are those dependencies that you learn to remain wary of (asm/cglib/antlr/jline/etc), but at the end of the day I'm happy to work in an ecosystem where I don't have to compile every single line of third-party code myself.
The "scripting languages" don't even have this as easy as it might seem. Half the dependencies in my Python projects these days have important bits written in C (e.g. psycopg2, gevent).
It seems to work quite well; ROS C++ software can happily depend on boost, bullet physics, PCL, KDL, OpenCV, collada, qt, etc. There are over 800 packages available as debs in the current ROS distribution: http://www.ros.org/debbuild/hydro.html
Missing, I think, is the requirement that open source projects are written with something like Repobuild in mind - consciously choosing to be part of an Open Package Build Network.
It does seem to run counter to open source to standardize around a build system. However, the power unlocked by such a build system (as alluded to in the OP) might be reason to make the move. Who wants to tinker around with the 20 different build systems each of your dependencies uses?
In other words, if the open source world starts moving in the direction of a standard build system, gaining momentum, it seems to follow the open source world can reach further in its endeavors, tackling more and more complex problems.
Yes, you are completely correct, the current reality is a total mess. Repobuild (as it works now) assumes a lot of things which may not be workable. Mostly I just wanted to see what would happen :).
One of the main goals here is to allow folks other than the primary author to write a BUILD file, e.g. to back-port old systems. As a consequence, it has to work with other build systems and wrap them.
And yes, Maven does this pretty well with the centralized repository. I would like Repobuild to wrap Maven, though I haven't yet written that piece.
The flip side though, the monkey in the wrench as they say, is that the projects that participate have to conform to the rules of participation. In CPAN's case its a standardized dependency, build, and install models with required unit tests. So perhaps the first step here is to provide an incentive for clean build processes on a project.
Possible incentives:
- automated testing (TravisCI does this in isolation already)
- automated distribution (build .deb, .msi, and .pkg files)
- usage statistics?
I'll have to think about this.I found using Leiningen for the first time to be a similar experience. I like it so much that I use it on non-Clojure projects too.
Then you can build a lot of things on top of that, not only source sharing and automatic dependency resolver, but also remote build servers, sharing already built libraries to save time, and easier integration of various editors, IDEs and other tools.
I hope that a project like this can motivate the C++ community to provide some more centralized support for creating shared libraries, managing third-party dependencies, and other areas where the language falls short today.
Note, however, it touches on an orthogonal aspect of build systems. I think Repobuild's main thrust is in standardizing and assisting modularization whereas the post linked in this comment has a different focus, it argues for a non-declarative, fixed-point based style.
Well, no surprises there!
For example you know you want an Interface of MailSender that has the method .SendEmail() and it gets filled with SMTPMailer which has SMTPMailer.SendEmail()
Is this thing similar to that concept but in build-time? How do you know the interface/usage beforehand?
The actual mechanics of the .net runtime would stay the same.
Explanation here: http://williamcotton.com/another-way-to-publish-code
I wish someone made a similar way to share libraries like we can do in PHP (https://packagist.org) or Ruby (http://bundler.io/), but for C++.
If targeting multiple platforms is of an essence, NetBSD pkgsrc provides a great model also built on top of Make.
https://github.com/chrisvana/repobuild/wiki/Similar-Build-Sy...
A few differences:
* Buck requires installation (meaning clients need to have it installed), whereas Repobuild generates a Makefile.
* Buck has a spiffy build daemon to make things faster.
* Repobuild auto-install files from git.
* Buck covers java better, but not other languages.
* Buck went with a turning complete language, Repobuild intentionally went with only a config langauge (hotly debated religious difference)
I'm happy to answer questions if anyone has any.
EDIT: Just a question, not a request.
Cmake:
Repobuild basically generates a Makefile. You could change it to generate a CMakefile instead. That would not be a lot of work, probably a few (full) days to change and test it.
Visual Studio:
Generating a visual studio project file may be trickier. A lot of the work overlaps that of the Cmake stuff above (changing the output format). Realistically, a 2 week project (I would do xcode projects at the same time).
What I know for sure, CMake is not very adequate for separating work into different small, independant parts (somewhat "declarative" attept in CMake here: https://github.com/key-tools/key-machine-logs/blob/master/ke...), and then including build targets from other CMake parts into one.
Also, generating CMakeLists, then generating a project seems like an overkill :)