BitBoxSwiss / bitbox02-firmware

Firmware code of the BitBox02 hardware wallet
https://bitbox.swiss/bitbox02
Apache License 2.0
216 stars 80 forks source link

Add support for optional sccache in build system #1177

Closed NickeZ closed 4 months ago

NickeZ commented 4 months ago

sccache is a binary cache that wraps all calls to gcc/rustc and caches build output in ~/.cache. This speeds up a build after make clean by about 3x. I choose not to put it in the dev dockerfile by default since caching might have unexpected side effects? But I put documentation in the build docs of how to install it.

NickeZ commented 4 months ago

I think it's a good call to not put it into the container so there are for sure no unexpected side effects.

Can you explain what the point is of this vs simply not calling make clean? cmake/rust already have incremental builds.

Sometimes when I jump back and forth between branches it rebuilts almost everything. And before pushing I would like to be able to call .ci/ci to speed up the feedback cycle. Some outputs are probably also the same in build and build-semihosting and then sccache can reuse those compiled units. Right now I have to wait 6-7 minutes on my machine for a clean build, but with scache that takes 1.5 minute. And those minutes add up when I'm trying to get the PR to pass CI.

Especially when I'm dealing with cmake dependencies. I don't trust cmake so I do make clean between biulds.