When comparing Rake vs Bazel, the Slant community recommends Bazel for most people. In the question“What are the best open-source build systems for C/C++?” Bazel is ranked 8th while Rake is ranked 19th. The most important reason people chose Bazel is:
Builds only use input files that are explicitly declared in the build specification. On Linux, Bazel runs tools in a sandboxed environment that contain only the minimum necessary files required.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Powerful language
You can write code for your build system in Ruby. While not my choice for general programming, Ruby is powerful and expressive. Given some knowledge of Ruby, you can create powerful Rake extensions that result in your average target only needing a few lines in the rakefile in spite of having complex behaviors (Is the library for public consumption, or only for use within the current repo/tier? Compile certain files on certain platforms? Link to libraries published from other repos? etc.).
Pro Correct and repeatable builds
Builds only use input files that are explicitly declared in the build specification. On Linux, Bazel runs tools in a sandboxed environment that contain only the minimum necessary files required.
Pro Fast even at scale
Even at large scale it's pretty fast (it's based on what Google uses internally for their huge code base).
Pro Can rule shell commands
Pro Handles mixed language builds
Pro High level build descriptions
Pro Build rule errors are informative
When builds fail because of an issue in the build rules, the errors provided are usually very informative and helpful to resolve the issue.
Pro Good IDE support
Pro Standard protocol for remote execution and caching
Pro Remote execution of commands
Cons
Con Slooooow
For large codebases or with complex extensions, Rake can become quite slow. I'm aware of one codebase on which it can take 15 minutes to determine that no changes have been made and no recompilation is necessary.
Con Draconian sandboxing, explicit inputs requirement
Requirement to explicitly name all inputs disqualifies Bazel for many workflows, e.g. those relying on tools that scan a directory tree themselves looking for files to process. Sandboxing as implemented in Bazel imposes further restrictions. If a command is successful when you type it in the shell, it should also be successful when pasted verbatim into a rule, but with Bazel it very often isn't.
Con Confusing for beginners
With so many capabilities, trying to implement with a simple project is overkill and unpleasant.