Bazel build artifacts stored in /tmp by default?

Hi! I'm working on a custom Kibana plugin for a client, and am currently using Elastic Stack 7.13.

One trouble that I've been running into is that I often hit the error Error: Cannot find module '@kbn/config-schema' every once in a while. I can fix this by running yarn kbn clean followed by yarn kbn bootstrap, but I was needing to do this every week or so.

After digging into the issue a bit, I found that it's because the bazel-bin directory in the base of the Kibana project is linked to /private/var/tmp/_bazel_{user}/{random_hash}/execroot/kibana/bazel-out/darwin-fastbuild/bin on macOS, and this seems to get cleaned up periodically.

Is there some way to put these build artifacts in a more permanent place?

Thanks!

@GavinAnderegg we shouldn't need yarn kbn clean to make this work. A simple yarn kbn bootstrap should be enough.

In case you wanted to move the bazel-bin linked outputs into another location you can specifiy build --output_user_root=/YOUR_NEW_PATH below kibana/.bazelrc.common at master · elastic/kibana · GitHub

Just take into account the content of that folder will increase over time :smiley:

Cheers

Awesome! Thanks for the heads up that I don't need to clean first, as well as the argument for the build output path!