Skip to content

dist/tools: deprecate git-cache script, embrace git-cache-rs#22045

Merged
crasbe merged 2 commits intoRIOT-OS:masterfrom
crasbe:pr/deprecate_git-cache
Feb 5, 2026
Merged

dist/tools: deprecate git-cache script, embrace git-cache-rs#22045
crasbe merged 2 commits intoRIOT-OS:masterfrom
crasbe:pr/deprecate_git-cache

Conversation

@crasbe
Copy link
Contributor

@crasbe crasbe commented Feb 4, 2026

Contribution description

The git-cache script was added by @kaspar030 in 2016 to speed up the build process. It has since been replaced by git-cache-rs by @kaspar030, which is still under active development and offers features such as sparse checkout that the original script does not.

Staying compatible with git-cache was quite a pain in #21800 and #22039.

I brought the topic up in the weekly a couple of weeks ago and AFAIR there were no voices against the deprecation of git-cache.

Testing procedure

To avoid using any caches, we have to temporarily disable git-cache-rs and git-cache:

cbuec@W11nMate:~$ mv .cargo/bin/git-cache .cargo/bin/git-cache-old
cbuec@W11nMate:~$ mv .gitcache/ .gitcache_disabled

cbuec@W11nMate:~/RIOTstuff/riot-vanilla/RIOT$ rm -rf build && time QUIETER= BOARD=nrf52dk make -C tests/sys/shell -j
make: Entering directory '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell'
Building application "tests_shell" for "nrf52dk" with CPU "nrf52".

[INFO] cloning without cache nrf5x_nrfx_mdk
[INFO] Consider using git-cache-rs to speed up your build and reduce network traffic! See: https://guides.riot-os.org/build-system/advanced_build_system_tricks/#speed-up-builds-with-git-cache-rs
[INFO] updating nrf5x_nrfx_mdk /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/nrf5x_nrfx_mdk/.pkg-state.git-downloaded
[INFO] patch nrf5x_nrfx_mdk
[INFO] cloning without cache cmsis
[INFO] Consider using git-cache-rs to speed up your build and reduce network traffic! See: https://guides.riot-os.org/build-system/advanced_build_system_tricks/#speed-up-builds-with-git-cache-rs
[INFO] updating cmsis /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/cmsis/.pkg-state.git-downloaded
[INFO] patch cmsis
[INFO] cloning without cache mpaland-printf
[INFO] Consider using git-cache-rs to speed up your build and reduce network traffic! See: https://guides.riot-os.org/build-system/advanced_build_system_tricks/#speed-up-builds-with-git-cache-rs
[INFO] updating mpaland-printf /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/mpaland-printf/.pkg-state.git-downloaded
[INFO] patch mpaland-printf
"make" -C /home/cbuec/RIOTstuff/riot-vanilla/RIOT/pkg/cmsis/
...
"make" -C /home/cbuec/RIOTstuff/riot-vanilla/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  15080     128    2564   17772    456c /home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell/bin/nrf52dk/tests_shell.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell'

real    0m40.870s
user    0m20.226s
sys     0m7.308s

To use the now deprecated git-cache script, we have to enable the cache directory again:

cbuec@W11nMate:~$ mv .gitcache_disabled/ .gitcache

cbuec@W11nMate:~/RIOTstuff/riot-vanilla/RIOT$ rm -rf build && time QUIETER= BOARD=nrf52dk make -C tests/sys/shell -j
make: Entering directory '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell'
Building application "tests_shell" for "nrf52dk" with CPU "nrf52".

[INFO] cloning nrf5x_nrfx_mdk with git-cache
Warning: git-cache is deprecated and will be removed after the 2026.04 release! See https://guides.riot-os.org/build-system/advanced_build_system_tricks/#speed-up-builds-with-git-cache-rs for more information.
git-cache: cloning from cache. tag=commit11f57e578c7feea13f21c79ea0efab2630ac68c7-106746
[INFO] updating nrf5x_nrfx_mdk /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/nrf5x_nrfx_mdk/.pkg-state.git-downloaded
[INFO] patch nrf5x_nrfx_mdk
[INFO] cloning cmsis with git-cache
Warning: git-cache is deprecated and will be removed after the 2026.04 release! See https://guides.riot-os.org/build-system/advanced_build_system_tricks/#speed-up-builds-with-git-cache-rs for more information.
git-cache: cloning from cache. tag=commit2b7495b8535bdcb306dac29b9ded4cfb679d7e5c-106822
[INFO] updating cmsis /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/cmsis/.pkg-state.git-downloaded
[INFO] patch cmsis
[INFO] cloning mpaland-printf with git-cache
Warning: git-cache is deprecated and will be removed after the 2026.04 release! See https://guides.riot-os.org/build-system/advanced_build_system_tricks/#speed-up-builds-with-git-cache-rs for more information.
git-cache: cloning from cache. tag=commit0dd4b64bc778bf55229428cefccba4c0a81f384b-106924
[INFO] updating mpaland-printf /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/mpaland-printf/.pkg-state.git-downloaded
[INFO] patch mpaland-printf
"make" -C /home/cbuec/RIOTstuff/riot-vanilla/RIOT/pkg/cmsis/
...
"make" -C /home/cbuec/RIOTstuff/riot-vanilla/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  15080     128    2564   17772    456c /home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell/bin/nrf52dk/tests_shell.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell'

real    0m6.216s
user    0m15.888s
sys     0m5.134s

To use git-cache-rs, we have to enable it again:

cbuec@W11nMate:~$ mv .cargo/bin/git-cache-old .cargo/bin/git-cache

cbuec@W11nMate:~/RIOTstuff/riot-vanilla/RIOT$ rm -rf build && time QUIETER= BOARD=nrf52dk make -C tests/sys/shell -j
make: Entering directory '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell'
Building application "tests_shell" for "nrf52dk" with CPU "nrf52".

[INFO] cloning nrf5x_nrfx_mdk
Cloning into '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/nrf5x_nrfx_mdk'...
done.
HEAD is now at 11f57e5 nrfx 3.14.0 release
[INFO] updating nrf5x_nrfx_mdk /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/nrf5x_nrfx_mdk/.pkg-state.git-downloaded
[INFO] patch nrf5x_nrfx_mdk
[INFO] cloning cmsis
Cloning into '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/cmsis'...
done.
HEAD is now at 2b7495b85 Merge branch 'develop'
[INFO] updating cmsis /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/cmsis/.pkg-state.git-downloaded
[INFO] patch cmsis
[INFO] cloning mpaland-printf
Cloning into '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/mpaland-printf'...
done.
HEAD is now at 0dd4b64 test(test_suite): added support for PRINTF_DISABLE_SUPPORT_EXPONENTIAL
[INFO] updating mpaland-printf /home/cbuec/RIOTstuff/riot-vanilla/RIOT/build/pkg/mpaland-printf/.pkg-state.git-downloaded
[INFO] patch mpaland-printf
"make" -C /home/cbuec/RIOTstuff/riot-vanilla/RIOT/pkg/cmsis/
...
"make" -C /home/cbuec/RIOTstuff/riot-vanilla/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  15080     128    2564   17772    456c /home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell/bin/nrf52dk/tests_shell.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-vanilla/RIOT/tests/sys/shell'

real    0m3.546s
user    0m13.220s
sys     0m3.132s

Due to the sparse checkout supported by git-cache-rs, we have a 50% performance increase compared to git-cache.
Since I only have DSL 16.000, the speedup for any caching is significant anyways :D

Issues/PRs references

None.

@crasbe crasbe requested review from AnnsAnns and kaspar030 February 4, 2026 16:38
@crasbe crasbe added the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Feb 4, 2026
@crasbe crasbe added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: deprecation Integration Process: The PR is deprecating a feature or API labels Feb 4, 2026
@github-actions github-actions bot added Area: doc Area: Documentation Area: build system Area: Build system Area: pkg Area: External package ports labels Feb 4, 2026
@riot-ci
Copy link

riot-ci commented Feb 4, 2026

Murdock results

✔️ PASSED

d9e1a83 pkg/pkg.mk: deprecate git-cache, embrace git-cache-rs

Success Failures Total Runtime
11000 0 11003 09m:13s

Artifacts

@crasbe crasbe force-pushed the pr/deprecate_git-cache branch from e1cc2ae to c924807 Compare February 4, 2026 21:29
Copy link
Member

@AnnsAnns AnnsAnns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With your test example provided I get sub-1s on the non-cached 30s pull 🥳

@AnnsAnns
Copy link
Member

AnnsAnns commented Feb 5, 2026

Feel free to squash

@crasbe
Copy link
Contributor Author

crasbe commented Feb 5, 2026

With your test example provided I get sub-1s on the non-cached 30s pull 🥳

That speedup is caused by the changes of #22039, not this PR 😅

@AnnsAnns
Copy link
Member

AnnsAnns commented Feb 5, 2026

With your test example provided I get sub-1s on the non-cached 30s pull 🥳

That speedup is caused by the changes of #22039, not this PR 😅

I know but that was part of the examples you gave in the PR description :P git-cache-rs only gives me a warm feeling of memory safety.

The old git-cache script is not under active development anymore
and lacks features such as sparse checkout that is offered by
git-cache-rs.

This commit adds a deprecation message for git-cache as well as
information how to migrate to git-cache-rs.

Furthermore, it tries to use GIT_CACHE_RS by default if it is
installed in the default location in the Cargo home directory.
@crasbe crasbe force-pushed the pr/deprecate_git-cache branch from c924807 to d9e1a83 Compare February 5, 2026 14:15
@crasbe crasbe added this pull request to the merge queue Feb 5, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2026
@crasbe crasbe added this pull request to the merge queue Feb 5, 2026
Merged via the queue into RIOT-OS:master with commit 3542a9c Feb 5, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: doc Area: Documentation Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: deprecation Integration Process: The PR is deprecating a feature or API Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants