fix: drop pip cache and leftover hosttools installer from images - #180
Open
IlyaasK wants to merge 1 commit into
Open
fix: drop pip cache and leftover hosttools installer from images#180IlyaasK wants to merge 1 commit into
IlyaasK wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Measured in the published
zmk-build-arm:stableimage (arm64):pip3 installruns without--no-cache-dir, so wheels accumulate under/root/.cache/pip. In thecommonstagepython3-pipis purged in the same layer, so the cache can never be reused; it is pure layer weight. This PR adds command-scopedPIP_NO_CACHE_DIR=1to all three installs (not anENV, so interactive use of the dev images still gets pip caching).setup.sh -hdownloadszephyr-sdk-*-hosttools-standalone-*.shinto the SDK dir, extracts it, and leaves the archive behind. Nothing consumes it afterwards. This PR deletes it right aftersetup.sh.Measured result
zmk-build-armimage store size: 660,954,283 → 581,807,033 bytes (−79 MB, −12%) of compressed pull. Uncompressed layer content verified gone viadu:/root/.cache/pip(45 MB) andzephyr-sdk-aarch64-hosttools-standalone-0.9.sh(43 MB).Verification
Built
--target buildwith 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,gccall present; SDKarm-zephyr-eabi-gcccompiles+links a bare-metal binary; all version probes identical to:stable(gcc 12.2.0, west v1.5.0, cmake 3.31.6)west build -s app -b nice_nano/nrf52840/zmk -- -DSHIELD=corne_leftagainst current ZMK main →zmk.uf2produced (FLASH 28.43%, RAM 19.88%)No functional change.
Made with Cursor