81 questions
0
votes
1
answer
43
views
Building libtiff with bazel foreign_cc rule
On an M3 Mac using MacOS 26.1 and bazel 8.4.2 homebrew, I'm building libtiff where I have libjpeg_turbo as a dependency. When building this I'm getting a linking error regarding jsimd:
[ 73%] Linking ...
0
votes
0
answers
44
views
Bazel with GHS arm compiler failing with archiver command
I am using GHS compiler in embedded project to generate .elf and .hex files.
I have configured CcToolchainConfigInfo as below:
cc_toolchain_config.bzl
def _impl(ctx):
# declare toolpaths (...
0
votes
0
answers
50
views
Bazel Doesn't Pass --action_env to BootStrapGNUMake
This question extends my previous post: https://stackoverflow.com/staging-ground/79463228
I am using rules_foreign_cc in Bazel to build a project, but I noticed that BootStrapGNUMake does not inherit ...
2
votes
1
answer
68
views
How to ask Bazel BUILD to execute bash command?
I'm very new to Bazel and in my Bazel BUILD project,
I'll try to explain use case which I'm trying to achieve,
I have dependency on third party libraries from artifacts.
I want to include the ...
0
votes
1
answer
68
views
Access custom tool_path from my toolchain in a Starlark rule
I added a tool_path for tclsh.exe in my toolchain (image below), which provided CcToolchainConfigInfo. I was hoping I could access the path to the tool in a rule using find_cc_toolchain() and simply ...
0
votes
1
answer
88
views
ncurses.h not found when building code using ncurses with Bazel
I have a project built with Bazel that uses ncurses, which I am trying to migrate to bzlmod for Bazel 8.0.0 LTS. I am trying to use the ncurses module from the Bazel Central Repository.
I have this ...
0
votes
0
answers
160
views
Consistency problem with debug symbol paths when debugging bazel build C++ with lldb
I'm using bazel 7.4.1-homebrew on MacOS 15.1.1 within VS Code.
The issue I'm having, is that I want to debug a target with lldb. I have setup my launch.json like this:
{
"name": &...
0
votes
1
answer
132
views
Bazel Build with VxWorks Environment (wrenv.exe)
What is the cleanest way to configure a build environment using wrenv.exe when running a bazel build command.
bazel build --platforms=@my_bazel//platforms::vxworks_69_arm7 //crypto:crypto
I would ...
2
votes
0
answers
157
views
How to overwrite the default toolchain values
I am working on running a wrapper around the gcc compiler,
Is there a way to use the wrapper for the https://github.com/f0rmiga/gcc-toolchain/tree/main where a default is present.
_PRIVATE_ATTRS = {
...
0
votes
1
answer
48
views
Buildfile not found in gnumake_src for rules_foreign_cc
I am using Bazel to build MakeFiles with the rules_foreignCC Library. When loading, it required me to download "https://mirror.bazel.build/ftpmirror.gnu.org/gnu/make/make-4.4.tar.gz" and &...
1
vote
0
answers
146
views
How to use --fission in Bazel
I'm trying to use the --fission Bazel command line option to generate a binary with separate debug information in a Linux C++ project using the default GCC toolchain.
I don't see any difference when I ...
0
votes
1
answer
52
views
How to use a whole directory in a test/binary built with bazel
We have a bazel_binary which iterates through all the subdirectories of a fixed directory, and parses the .json files in them, as follows. We want to use a directory iterator because this directory ...
1
vote
0
answers
216
views
How to get Bazel to build an external third party library with a python build script
So, I'm attempting to build OpenUSD in my Bazel project. Its a giant repo, but they provide a nice build.py Python program which handles all of their dependencies and making their CMake project.
I've ...
1
vote
0
answers
238
views
Wrong Bazel Execution Platform Selection After Upgrading to Bazel 7
I am trying to upgrade from bazel 6.5.0 to 7.1.1 and i am encountering problems relating to execution platforms selection.
I have 3 different execution platforms which each one of them has a different ...
4
votes
3
answers
3k
views
Why am I getting an error compiling the Bazel tutorial?
I know next to nothing about Bazel so I thought I'd try the tutorial on Mint 21 Linux. I installed bazel which is version 7.0.2.
I am following the instructions on the tutorial here - https://bazel....
0
votes
1
answer
268
views
How to get cc_test's full cmd(with args and env) to debug locally?
I have a complex cc_test which has tons of args and envs specified in the rules:
cc_test(
name="my_test",
args=[...tons of args...],
env= {...tons of envs...},
)
Now I want to run it ...
0
votes
2
answers
761
views
Trigger multiple targets at once
I have multiple cc_binary targets which will be build independently to create elf files.
I want to have single target command to build all at once to avoid multiple triggers and add the post build ...
0
votes
1
answer
659
views
How to add a dependency to all linked targets using Bazel's cc_toolchain?
I've followed the tutorial here to create a custom Bazel toolchain that builds and links a binary for a baremetal ARM platform. My binary target currently looks like this:
cc_binary(
name = "...
1
vote
1
answer
2k
views
Bazel conditional compile a C++ library if a flag is set (when building the library or one of targets that use it)
I'm trying to conditionally compile a C++ library with bazel depending on if a particular flag is set when building/running one of the target that use the library or the library itself.
My library has ...
0
votes
0
answers
232
views
List all external dependencies of a bazel target: name, version, license(s)
I have to list all the external dependencies of a bazel built project (envoy), with their name, version and license(s).
I am looking for an output in any format that would list this information for ...
1
vote
1
answer
686
views
How to patch additional build commands to third party CMake-only library built within BAZEL project?
I want to use one third party library in my bazel project. As of today, library is buildable only with CMake system. I am fetching the source code of the library via http_archive rule, and building it ...
0
votes
1
answer
563
views
Bazel re-export headers in a cc_library from it's dependencies to pass `layering_check`
I'm trying to Bazel-wrap a vendor-provided SDK for an embedded project. Part of that SDK includes a hardware abstraction layer (HAL), which has a set of identically named C headers and sources, ...
-1
votes
1
answer
686
views
Setting different preprocessor defines per source file in bazel cc_library
I'm trying to write bazel rules for a 3rd party library that specify different pre-processor define values per file i.e.
c++ ... -DVALUE=file1.cpp -c file1.cpp
c++ ... -DVALUE=file2.cpp -c file2.cpp
c+...
1
vote
2
answers
443
views
bazel build: how to know the time build cost?
I want to profile the time during the Bazel build, when i set --experimental_generate_json_trace_profile in command line, it output ERROR: Unrecognized option: --...
0
votes
1
answer
331
views
How to get the previous bazel build logs in a decent Way?
Is there a better way of Command line option to get the last bazel build output log in a decent way?
I am trying this first time. I found nothing here as well https://bazel.build/external/extension
...