Bazel BUILD file for the FreeRTOS kernel

I would like to contribute a Bazel BUILD file to the FreeRTOS kernel, allowing it to be built with Bazel. Would a PR doing this be welcome?

Bazel is a multi-lingual build system that supports external dependency management. The project I work on, Pigweed, builds with Bazel, and we currently have a BUILD.bazel file for the FreeRTOS kernel checked into our source. But it would be convenient for this file to live in the FreeRTOS kernel repo itself, so that it can be versioned together with the source it builds. This would also make life simpler for other Bazel users who want to use FreeRTOS.

I expect the BUILD.bazel file would be maintained by the community of Bazel users of FreeRTOS (including Pigweed, and myself personally). To avoid adding friction for other FreeRTOS contributors, I would not expect the Bazel build of FreeRTOS to be run in CI. Instead, we’d expect the FreeRTOS Bazel users to fix the BUILD.bazel file before registering a new version/release in the Bazel Central Registry

(Apologies for the lack of context links, the forum didn’t let me add any because I’m new here :frowning: .)

FreeRTOS builds with several build systems but we keep only CMake files in our repository to avoid proliferation of build system specific files. What do you think about this -

  1. Create a repo and add the BUILD.bazel file there.
  2. Crate a README in the same repo which provides instructions about how to use Bazel to build FreeRTOS.
  3. We can then link your repo in this file so that the interested community members can find it easily.

Hello,
Can you please explain this in more.

Thanks Gaurav! That makes sense as a place to start. I set this up the modern Bazel way, by adding FreeRTOS to the Bazel Central Registry and providing a patch file there that adds the BUILD.bazel files. I’ll work on providing a small, self-contained example of how to use this.

1 Like