[FATAL] Unexpected error reading .blazerc file '../.bazelrc'

While running ping sample application: https://docs.nvidia.com/isaac/isaac/doc/tutorials/ping.html#developing-codelets-in-c I am seeing the following error when running bazel build ping:

[FATAL] Unexpected error reading .blazerc file '../.bazelrc'

However, while running this sample application I have no issues: https://docs.nvidia.com/isaac/isaac/doc/getting_started.html#running-an-app

I have made sure that .bazelrc exists in Isaac folder

Here is the full output:

[INFO 15:46:42.363 src/main/cpp/option_processor.cc:395] Looking for the following rc files: /etc/bazel.bazelrc,/home/khansaadbinhasan/Desktop/Work/IIT_Delhi/Isaac/sdk/.bazelrc,/home/khansaadbinhasan/.bazelrc
[INFO 15:46:42.363 src/main/cpp/rc_file.cc:56] Parsing the RcFile /home/khansaadbinhasan/Desktop/Work/IIT_Delhi/Isaac/sdk/.bazelrc
[INFO 15:46:42.363 src/main/cpp/rc_file.cc:56] Parsing the RcFile …/.bazelrc
[FATAL 15:46:42.363 src/main/cpp/blaze.cc:1290] Unexpected error reading .blazerc file ‘…/.bazelrc’

This happens if you try building from any child directory of SDK/engine. If you invoke bazel only from SDK/engine itself, you should be okay.

If it poses too much trouble for you, you can fix the line in SDK/engine/.bazelrc from import ../.bazelrc to import %workspace%/../.bazelrc. We’re tracking a bug for the next release.

Same issue here using Docker.

Following the tutorial (https://docs.nvidia.com/isaac/isaac/doc/getting_started.html#using-docker) and trying to build the Isaac SDK inside a running container gives a similar output:

jesser@9700-FJLTC63-Ubuntu:~/isaac-sdk/sdk$ docker run --mount source=isaac-sdk-build-cache,target=/root -v `pwd`:/src/workspace -w /src/workspace --runtime=nvidia -it isaacbuild:latest /bin/bash
root@fdadde16ee86:/src/workspace# bazel build ...
[INFO 16:31:40.854 src/main/cpp/option_processor.cc:395] Looking for the following rc files: /etc/bazel.bazelrc,/src/workspace/.bazelrc,/root/.bazelrc
[INFO 16:31:40.854 src/main/cpp/rc_file.cc:56] Parsing the RcFile /src/workspace/.bazelrc
[INFO 16:31:40.854 src/main/cpp/rc_file.cc:56] Parsing the RcFile ../.bazelrc
[FATAL 16:31:40.854 src/main/cpp/blaze.cc:1290] Unexpected error reading .blazerc file '../.bazelrc'

Building from src/workspace/engine instead yields another error:

root@a16ba98862ec:/src/workspace/engine# bazel build ...
[INFO 16:55:15.415 src/main/cpp/option_processor.cc:395] Looking for the following rc files: /etc/bazel.bazelrc,/src/workspace/.bazelrc,/root/.bazelrc
[INFO 16:55:15.415 src/main/cpp/rc_file.cc:56] Parsing the RcFile /src/workspace/.bazelrc
[INFO 16:55:15.415 src/main/cpp/rc_file.cc:56] Parsing the RcFile ../.bazelrc
[FATAL 16:55:15.415 src/main/cpp/blaze.cc:1290] Import loop detected:
  /src/workspace/.bazelrc
  ../.bazelrc
  ../.bazelrc

Solved the bazel build error by performing the docker run command on the highest level of the isaac installation (in my case: ~/isaac-sdk instead of ~/isaac-sdk/sdk ). Hopefully this helps someone and the documentation can be updated in this terms.

3 Likes