Bazel Build Permission denied

Hi everyone I’m very new to Isaac & bazel.
While I was following the document here:
https://docs.nvidia.com/isaac/isaac/doc/getting_started.html#running-an-application
I encountered an error kept saying the cpp files bazel need to build is “Permission denied”.
The error message looks like below

Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: engine/alice/components/Subprocess.cpp: Permission denied
gcc: fatal error: no input files
compilation terminated.
ERROR: /home/acas/HDD/CatDog/Isaak/engine/alice/BUILD:23:1: Couldn't build file engine/alice/_objs/impl/ReplayBridge.o: C++ compilation of rule '//engine/alice:impl' faed (Exit 1) crosstool_wrapper_driver_is_not_gcc_host.py failed: error executing command external/toolchain/crosstool/scripts/crosstool_wrapper_driver_is_not_gcc_host.pyD_DEFAULT_SOURCE -U_FORTIFY_SOURCE -fstack-protector -Wall -Werror -B/usr/bin -Wunused-but-set-parameter ... (remaining 183 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: engine/alice/components/ReplayBridge.cpp: Permission denied
gcc: fatal error: no input files
compilation terminated.
ERROR: /home/acas/HDD/CatDog/Isaak/engine/gems/image/BUILD:42:1: Couldn't build file engine/gems/image/_objs/cuda_conversions/yuv2rgb.cu.o: error while parsing .d file:root/.cache/bazel/_bazel_root/6ab44b9a455585caa8f9f5f55ddd002b/execroot/com_nvidia_isaac/bazel-out/k8-opt/bin/engine/gems/image/_objs/cuda_conversions/yuv2rgb.cu.d (No ch file or directory)
gcc: error: engine/gems/image/cuda/yuv2rgb.cu.cpp: Permission denied
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
Target //apps/samples/stereo_dummy:stereo_dummy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 6.627s, Critical Path: 0.62s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 0 processes.
FAILED: Build did NOT complete successfully

And so much the same “Permission denied” error.
I’ve tried root, sudo, but none of that works.
Is anyone has the same bazel problem?
Thanks a lot!!

In my case sometimes using the “sudo” command work for me

Usage of root / sudo should not be required and may create further side effects.
Some checks and recommendations:

  • Make sure you run on the appropriate OS, at the moment Ubuntu 18.04 LTS / Jetson Jetpack.
  • Install the environment dependencies per the documentation: ``` ./engine/build/scripts/install_dependencies.sh ```
  • To recover in case of previous issues: ``` bazel clean ```
  • And in the worst case, wipe-out the cache: ``` rm -rf ~/.cache/bazel ```