setup-ccache: remove CC_WRAPPER/CXX_WRAPPER, not supported in Android 13+ builds

This commit is contained in:
oxmc
2026-06-04 03:15:58 -07:00
parent b6eef9ce09
commit 7750b8d799
+8 -12
View File
@@ -1,5 +1,7 @@
#!/bin/bash
# Configure ccache for AOSP builds and persist settings to ~/.bashrc.
# Configure ccache directory and size.
# NOTE: Android 13+ build system blocks CC_WRAPPER/CXX_WRAPPER — ccache cannot
# wrap the compiler. CCACHE_DIR is set for reference only; Soong handles caching.
# $1 = cache size limit (default: 30G)
CCACHE_PATH=/mnt/ssd/ccache
@@ -13,24 +15,18 @@ CCACHE_DIR="$CCACHE_PATH" ccache --set-config=compression=true
CCACHE_DIR="$CCACHE_PATH" ccache --set-config=compression_level=1
export CCACHE_DIR="$CCACHE_PATH"
export CCACHE_EXEC=/usr/bin/ccache
export USE_CCACHE=1
export CC_WRAPPER=ccache
export CXX_WRAPPER=ccache
if ! grep -q 'CCACHE_DIR' "$BASHRC"; then
cat >> "$BASHRC" << 'EOF'
# ccache (PawletOS build)
# ccache dir (Android 16 — compiler wrapping not supported, Soong handles caching)
export CCACHE_DIR=/mnt/ssd/ccache
export CCACHE_EXEC=/usr/bin/ccache
export USE_CCACHE=1
export CC_WRAPPER=ccache
export CXX_WRAPPER=ccache
EOF
echo "ccache vars written to $BASHRC"
echo "CCACHE_DIR written to $BASHRC"
else
echo "~/.bashrc already has CCACHE_DIR — not duplicating"
# Remove any CC_WRAPPER/CXX_WRAPPER/USE_CCACHE/CCACHE_EXEC lines if present
sed -i '/CC_WRAPPER\|CXX_WRAPPER\|USE_CCACHE\|CCACHE_EXEC/d' "$BASHRC"
echo "Cleaned up unsupported ccache wrapper vars from $BASHRC"
fi
echo ""