tree: 1b86469c34f436cb4330d4a2500f8e4eea2b9bca
  1. boards/
  2. public/
  3. BUILD.bazel
  4. format_autoconf.awk
  5. hello_bazel.cc
  6. native_sim_test.cc
  7. prj.conf
  8. README.md
  9. requirements.in
  10. requirements_lock.txt
  11. test_native_sim.sh
examples/hello_bazel/README.md

Getting started

How to build?

# Build the application for robokit1
examples/hello_bazel $ bazelisk build :app --platforms=//:robokit1

# Test the native_sim build, which can run on the host
examples/hello_bazel $ bazelisk test :test_native_sim --platforms=:native_sim

# Run the default workflow (builds robokit1 and tests native_sim)
examples/hello_bazel $ ./pw default

Comparing generated files

Some files like autoconf.h and kobj-types-enum.h are generated by the Zephyr build process. While that has been replicated by the Bazel build, if needed those files can be generated as part of the Zephyr build toolchain using, and listed with:

$ west build -p -b robokit1 samples/cpp/hello_world
$ ls ./build/zephyr/include/generated/zephyr

(Just be sure to use the same SHA for Zephyr as in MODULE.bazel)

Comparing Zephyr builds

Using a build log we can scan to see which files were generated using:

grep -oP '\-o [\w_\-+/\.]+\.o(bj)?' ${log_file} | sort -u