# Bazel build artifacts stored in /tmp by default?

**URL:** <https://discuss.elastic.co/t/bazel-build-artifacts-stored-in-tmp-by-default/281814>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [August 18, 2021, 11:53am UTC](https://discuss.elastic.co/t/bazel-build-artifacts-stored-in-tmp-by-default/281814 "2021-08-18T11:53:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GavinAnderegg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gavinanderegg/32/91793_2.png) [@GavinAnderegg](https://discuss.elastic.co/u/GavinAnderegg)\
**Post date:** [August 18, 2021, 11:53am UTC](https://discuss.elastic.co/t/bazel-build-artifacts-stored-in-tmp-by-default/281814/1 "2021-08-18T11:53:31Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [August 20, 2021, 2:18pm UTC](https://discuss.elastic.co/t/bazel-build-artifacts-stored-in-tmp-by-default/281814/2 "2021-08-20T14:18:58Z")

</div>

@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](https://github.com/elastic/kibana/blob/master/.bazelrc.common#L19)

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

Cheers

---

<div class="post-metadata">

**Author:** ![GavinAnderegg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gavinanderegg/32/91793_2.png) [@GavinAnderegg](https://discuss.elastic.co/u/GavinAnderegg)\
**Post date:** [August 20, 2021, 8:46pm UTC](https://discuss.elastic.co/t/bazel-build-artifacts-stored-in-tmp-by-default/281814/3 "2021-08-20T20:46:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 17, 2021, 8:47pm UTC](https://discuss.elastic.co/t/bazel-build-artifacts-stored-in-tmp-by-default/281814/4 "2021-09-17T20:47:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
