bazel's cons and pros compared with make

1,288 views
Skip to first unread message

杜秀涛

unread,
Nov 24, 2017, 5:04:20 AM11/24/17
to bazel-discuss
hey guys, I want to suggest my colleages to use bazel to build existing c/c++ projects, which are build by make, as far as I know, bazel can be more reliable than make, and , what else?

speed is perheps not a reason to convert a project into bazel-build one. because make can be as fast as bazel, AFAIK.

thanks.

Marcel Hlopko

unread,
Nov 24, 2017, 5:32:56 AM11/24/17
to 杜秀涛, bazel-discuss
I'd start with what we have on the bazel website: https://www.bazel.build/
* fast and correct (never run make clean again!)
* one tool for all needs, language independent, consistent
* scalable (sandboxing, local cache, shared remote cache, remote execution)
* extensible (write your own rules in Skylark)

I'll add that normal devs don't have to fight with the build system, they just use the rules, their logic is nicely encapsulated. It's only the rules maintainer that needs to understand the rules implementation.



--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/e298b123-120b-4de7-a7a8-099ae2ad8c77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
-- 
Marcel Hlopko | Software Engineer | hlo...@google.com | 

Google Germany GmbH | Erika-Mann-Str. 33  | 80636 München | Germany | Geschäftsführer: Geschäftsführer: Paul Manicle, Halimah DeLaine Prado | Registergericht und -nummer: Hamburg, HRB 86891

杜秀涛

unread,
Nov 25, 2017, 3:52:59 AM11/25/17
to bazel-discuss
Thanks, if I want to convert a cmake/make project into bazel-build one, there guidelines for these?

在 2017年11月24日星期五 UTC+8下午6:32:56,Marcel Hlopko写道:

ash...@gmail.com

unread,
Nov 25, 2017, 6:28:59 AM11/25/17
to bazel-discuss
AFAIK, only go has a automatic BUILD files generator (called gazelle), for other languages you might need to write them manually. It's probably easier to start from scratch instead of converting makefile to bazel rules.

Marcel Hlopko

unread,
Nov 29, 2017, 3:52:56 AM11/29/17
to ash...@gmail.com, Manuel Klimek, spom...@google.com, bazel-discuss
+Manuel Klimek 
+Sergiusz Pomorski 

There's no automated cmake -> bazel converter (yet?). We plan to write docs on how to manually convert from cmake to bazel sometime next year, but right now there're no guidelines.


For more options, visit https://groups.google.com/d/optout.

杜秀涛

unread,
Dec 6, 2017, 8:33:55 PM12/6/17
to bazel-discuss
beside cmake, there are autotools. now I have a project can be built by issue `./configure && make && make install`, is there a crude thought on where to begin? should I issue configure and then convert the makefile/gnumakefile to bazel's BUILD files? Or should I begin with configure command?

在 2017年11月25日星期六 UTC+8下午7:28:59,Xiaoyi Shi写道:

杜秀涛

unread,
Dec 6, 2017, 8:35:38 PM12/6/17
to bazel-discuss
Or even begin with autotools?

在 2017年12月7日星期四 UTC+8上午9:33:55,杜秀涛写道:

Xiaoyi Shi

unread,
Dec 7, 2017, 3:15:39 AM12/7/17
to 杜秀涛, bazel-discuss
IMHO you should start with the build file after configure.  Configure phase is about setting up toolchains on the host system (where you compile), and the build phase is about compile binary to the target system (where you run the binary). 

As bazel provides a hermetic build promise, the configure phase should have been done by bazel instead of your build rules, and the compiling environment (from your perspective) should always be the same.  Therefore all you need is focusing on building phase alone. 


You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/BQACGYB7dLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/372b0239-a4e6-4b53-83cd-1a3871468a7d%40googlegroups.com.

杜秀涛

unread,
Dec 27, 2017, 3:25:04 AM12/27/17
to bazel-discuss
If I have customized gcc/g++/other_gcc_tools,what will be better? export CC=/my/gcc or configure toolchain/CROSSTOOL?

在 2017年12月7日星期四 UTC+8下午4:15:39,Xiaoyi Shi写道:
Reply all
Reply to author
Forward
0 new messages