🤔We’ll largely follow along with https://bazel.build/start/cpp in this lesson.
src/hello.c:
gcc or clang to get a executable binary by invoking it with something like gcc main.c -o main and run the ./main. Under other build tools, you’d write something that performs these steps directly.
For example in a Makefile, it would look like this and in order to build it, one would have to invoke make main :
cc_binary is the rule for turning .c code into executable binaries. Put this content in src/BUILD:
bazel run src:main will compile and run hello.c.
This build will depend on a hermetic LLVM toolchain, which you’ll observe downloaded and extracted the first time you run a build.
Bazel builds should ideally be completely reproducible across machines, regardless of OS distro, installed system libraries, and so on.
Every file or tool needed for the build is managed by Bazel. This property is called “hermeticity”.
Read more: hermetic c toolchain

