Skip to content

fix: drop pip cache and leftover hosttools installer from images - #180

Open
IlyaasK wants to merge 1 commit into
zmkfirmware:4.1-branchfrom
IlyaasK:diet-pip-cache-hosttools
Open

fix: drop pip cache and leftover hosttools installer from images#180
IlyaasK wants to merge 1 commit into
zmkfirmware:4.1-branchfrom
IlyaasK:diet-pip-cache-hosttools

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jul 31, 2026

Copy link
Copy Markdown

Measured in the published zmk-build-arm:stable image (arm64):

  1. pip wheel cache (45 MB) — every pip3 install runs without --no-cache-dir, so wheels accumulate under /root/.cache/pip. In the common stage python3-pip is purged in the same layer, so the cache can never be reused; it is pure layer weight. This PR adds command-scoped PIP_NO_CACHE_DIR=1 to all three installs (not an ENV, so interactive use of the dev images still gets pip caching).
  2. Hosttools installer archive (43 MB)setup.sh -h downloads zephyr-sdk-*-hosttools-standalone-*.sh into the SDK dir, extracts it, and leaves the archive behind. Nothing consumes it afterwards. This PR deletes it right after setup.sh.

Measured result

zmk-build-arm image store size: 660,954,283 → 581,807,033 bytes (−79 MB, −12%) of compressed pull. Uncompressed layer content verified gone via du: /root/.cache/pip (45 MB) and zephyr-sdk-aarch64-hosttools-standalone-0.9.sh (43 MB).

Verification

Built --target build with CI's args (ZEPHYR_VERSION=4.1.0, ARCHITECTURE=arm, ZEPHYR_SDK_VERSION=0.16.9) on arm64, then inside the dieted image:

  • west, cmake, ccache, gcc all present; SDK arm-zephyr-eabi-gcc compiles+links a bare-metal binary; all version probes identical to :stable (gcc 12.2.0, west v1.5.0, cmake 3.31.6)
  • Real firmware build succeeds end-to-end: west build -s app -b nice_nano/nrf52840/zmk -- -DSHIELD=corne_left against current ZMK main → zmk.uf2 produced (FLASH 28.43%, RAM 19.88%)

No functional change.

Made with Cursor

Measured in the published zmk-build-arm:stable image:

- pip3 install ran without --no-cache-dir, leaving 45 MB of wheel
  cache under /root/.cache/pip. python3-pip is purged in the same
  layer of the common stage, so the cache can never be reused.
  Add command-scoped PIP_NO_CACHE_DIR=1 to all three installs (not an
  ENV, so interactive use of the dev images still gets pip caching).
- setup.sh -h downloads zephyr-sdk-*-hosttools-standalone-*.sh into
  the SDK dir, extracts it, and leaves the 43 MB archive behind.
  Delete it right after setup.sh.

zmk-build-arm image store size: 660954283 -> 581807033 bytes
(-79 MB compressed pull, -12%). No functional change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant