Relative Content

Tag Archive for bazel

single_version_override with patch = […] has no effect

I’m trying to use the single_version_override feature of MODULES.bazel in order to apply a local patch to an existing public repository in the Bazel Common Registry. (Specifically google_benchmark doesn’t build on an arm64 windows system and I want to both locally unblock playing with it and eventually work on upstreaming a fix if they’re interested in taking it).

How can I pass a path/directory to a rule in Bazel

Working with directories in Bazel is discouraged since Bazel will not accurately track the directory contents, however, I often find myself
running into the same problem where the input to rule just has to be a directory. Most commonly, I am setting something like PATH, PYTHONPATH, RESOURCES, or TOOL_PATH in a rule’s env dictionary and these environment variables have to be either a single directory or column separated paths/directories.

bazel query ignore all **/.cache/**/BUILD files

I want to execute bazel query //... but I have many .cache folders in my repo and they may contain BUILD files in their subfolders that may cause bazel errors. I want bazel to exclude all BUILD files that matches the glob pattern **/.cache/**/BUILD. What should I do?

How to build a c++ binary with bazel and toolchains, where the compilers are in docker images

I have docker images containing different versions of gcc compiler. How would I build a simple c++ hello-world application multiple times, using each docker image as the execution-platform. There doesn’t appear to be any clear examples of how to construct this using toolchains, and its unclear if you are expected to inherit aspects of existing cc rules or if you need to build rules and toolchains from scratch.