Trying to disable sandbox in bazel environment

Hi Team,

My project is running on bazel environment with sandbox . I want to setup C scanner for my project using build-wrapper. When i read in documentation i need to disable sandbox. Is there a way to disable sandbox.

Documentation: C/C++/Objective-C

Hello,

I think passing the flag --spawn_strategy=local should do the trick, and override whatever Bazel uses by default.

Please, let me know if this helps.

build-wrapper-linux-x86-64 --out-dir output bazel --batch build --spawn_strategy=local …
.
When i run the above bazel build command I don’t have anything in build-wrapper-dump.json.

In captures block it shows [
]

Did something get build with that command? If bazel doesn’t trigger anything because there is nothing new to do, it is expected to have an empty dump. You would need to do

bazel --batch clean

before.

If this still doesn’t help, please, send me the build-wrapper.log. If it contains sensitive information, let me know and I will send you a private message.

when i run bazel --batch clean I am getting some output . When i open build-wrapper-dump.json file its having bazel cache. This is not the expected output

Sorry, I did not understand.

  1. You run bazel --batch clean
  2. Then you run build-wrapper-linux-x86-64 --out-dir output bazel --batch build --spawn_strategy=local

Then where I am lost is at you getting “some output” (where, which output?) and build-wrapper-dump.json having “bazel cache” which is not the expected output.

Can you please run 1 and 2, and then send me both build-wrapper.log and build-wrapper-dump.json? That will be easier to debug.

We can connect in private

Issue is resolved. Sorry to update you back

1 Like