# Question about build system

**URL:** <https://community.keyboard.io/t/question-about-build-system/696>\
**Category:** Kaleidoscope Internals\
**Created:** [November 5, 2017, 9:32pm UTC](https://community.keyboard.io/t/question-about-build-system/696 "2017-11-05T21:32:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigdissel](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@craigdissel](https://community.keyboard.io/u/craigdissel)\
**Post date:** [November 5, 2017, 9:32pm UTC](https://community.keyboard.io/t/question-about-build-system/696/1 "2017-11-05T21:32:09Z")

</div>

Since we now have a ‘Kaleidoscope Internals’ category, I figured I’d ask this here.

On every build (through IDE or on command line), everything is completely rebuilt, regardless of whether anything has changed since it’s last been compiled. Sketch is rebuilt, all plugins are rebuilt, even the Arduino core (which very, very rarely changes, especially for real-hardware builds) is rebuilt. Even typing `make`, waiting for it to complete, and then immediately typing `make` again triggers a full rebuild, even though nothing has changed.

1. Is this a behavior that just comes with using `arduino-builder`? (I don’t think so - for most projects, I think Arduino normally tries to not recompile libraries and core unless necessary - but I could be wrong)
2. If this behavior is a feature of `kaleidoscope-builder`, or more broadly our build system in general, can anyone point me to where in the code or config files is causing this?
3. Is this a desired feature? If so, why? Or if it’s not a desired feature, I’m interested in fixing this. It would help build times a _ton_ - for instance if you only changed your sketch file, not having to rebuild all the plugins and the Arduino core would save so much time. It also would speed up future regression testing (see [Regression testing & build system](https://community.keyboard.io/t/regression-testing-build-system/609)) by probably at least 10x.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [November 6, 2017, 6:29am UTC](https://community.keyboard.io/t/question-about-build-system/696/2 "2017-11-06T06:29:04Z")

</div>

> [@craigdissel](#):
>
> If this behavior is a feature of kaleidoscope-builder, or more broadly our build system in general, can anyone point me to where in the code or config files is causing this?

It is part of [kaleidoscope-builder](https://github.com/keyboardio/Kaleidoscope/blob/67aa56022d5f429000448ca2b4fbaf8cf5d1aef7/etc/kaleidoscope-builder.conf#L116).

> [@craigdissel](#):
>
> Is this a desired feature? If so, why?

As far as I remember, we start from a clean state every build because we don’t really trust the arduino build tools to notice changes. I seem to recall cases where it didn’t pick up modifications in libraries…

What we could do, is to make the `BUILD_PATH` override-able, and then we could satisfy both camps: those who want a clean rebuild every time, and those who want quick builds.

---

<div class="post-metadata">

**Author:** ![noseglasses](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/noseglasses/32/429_2.png) [@noseglasses](https://community.keyboard.io/u/noseglasses)\
**Post date:** [November 16, 2017, 10:59pm UTC](https://community.keyboard.io/t/question-about-build-system/696/3 "2017-11-16T22:59:35Z")

</div>

The problem discussed above is addressed by Kaleidoscope-CMake

> [@Kaleidoscope-CMake](https://community.keyboard.io/t/kaleidoscope-cmake/770):
>
> Disclaimer In a recent [post](https://community.keyboard.io/t/regression-testing-build-system/609/3) @jesse made it clear that he is not fond of CMake. What you read below is therefore likely not to be supported by keyboardio. Direct any future questions about the matter @noseglasses. Leave issue reports and pull requests [here](https://github.com/noseglasses/Kaleidoscope-CMake). Description [Kaleidoscope-CMake](https://github.com/noseglasses/Kaleidoscope-CMake) is an alternative configuration and build system that is based on [Arduino-CMake](https://github.com/arduino-cmake/arduino-cmake). It provides the following features in comparison to the stock GNU make build system. support for parallel builds, [integration…](https://www.johnlamp.net/cmake-tutorial-2-ide-integration.html)
