mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2026-05-28 18:06:32 +03:00
Speed up ccache
This commit is contained in:
43
.github/workflows/build.yml
vendored
43
.github/workflows/build.yml
vendored
@@ -32,22 +32,29 @@ jobs:
|
||||
with:
|
||||
path: src/chrome/build/pgo_profiles/
|
||||
key: pgo-linux-openwrt-${{ hashFiles('CHROMIUM_VERSION') }}-v${{ env.CACHE_EPOCH }}
|
||||
- name: Cache AFDO (Android)
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: src/chrome/android/profiles/
|
||||
key: afdo-${{ hashFiles('CHROMIUM_VERSION') }}-v${{ env.CACHE_EPOCH }}
|
||||
- name: Cache Android NDK (Android)
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: src/third_party/android_toolchain/ndk/
|
||||
key: android-ndk-${{ hashFiles('CHROMIUM_VERSION') }}-v${{ env.CACHE_EPOCH }}
|
||||
- run: ./get-clang.sh
|
||||
- run: EXTRA_FLAGS='target_os="android"' ./get-clang.sh
|
||||
- id: ccache-timestamp
|
||||
run: echo "CCACHE_TIMESTAMP=$(date +%s)" >>$GITHUB_OUTPUT
|
||||
- name: Host tool ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: src/.host_tool_cache
|
||||
key: ccache-posix-${{ hashFiles('CHROMIUM_VERSION') }}-${{ steps.ccache-timestamp.outputs.CCACHE_TIMESTAMP }}
|
||||
restore-keys: ccache-posix-${{ hashFiles('CHROMIUM_VERSION') }}-
|
||||
- name: Install APT packages
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install ninja-build pkg-config ccache
|
||||
- run: EXTRA_FLAGS='target_os="android" target_cpu="x64"' ./get-clang.sh
|
||||
- run: |
|
||||
if [ ! -f qemu-user*.deb ]; then
|
||||
wget https://snapshot.debian.org/archive/debian/20250405T083429Z/pool/main/q/qemu/qemu-user_9.2.2%2Bds-1%2Bb2_amd64.deb
|
||||
fi
|
||||
- run: EXTRA_FLAGS='target_os="android" target_cpu="x64"' WARMUP_HOST_TOOLS=1 ./build.sh
|
||||
cache-toolchains-win:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
@@ -139,6 +146,12 @@ jobs:
|
||||
src/out/sysroot-build/trixie/trixie_*
|
||||
src/out/sysroot-build/sid/sid_*
|
||||
key: sysroot-linux-${{ matrix.arch }}-${{ hashFiles('CHROMIUM_VERSION') }}-v${{ env.CACHE_EPOCH }}
|
||||
- name: Host tool ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: src/.host_tool_cache
|
||||
key: ccache-posix-${{ hashFiles('CHROMIUM_VERSION') }}-${{ steps.ccache-timestamp.outputs.CCACHE_TIMESTAMP }}
|
||||
restore-keys: ccache-posix-${{ hashFiles('CHROMIUM_VERSION') }}-
|
||||
- id: ccache-timestamp
|
||||
run: echo "CCACHE_TIMESTAMP=$(date +%s)" >>$GITHUB_OUTPUT
|
||||
- name: Cache ccache files
|
||||
@@ -208,11 +221,6 @@ jobs:
|
||||
src/gn/
|
||||
src/qemu-user*.deb
|
||||
key: toolchains-posix-${{ hashFiles('CHROMIUM_VERSION') }}-v${{ env.CACHE_EPOCH }}
|
||||
- name: Cache AFDO (Android)
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: src/chrome/android/profiles/
|
||||
key: afdo-${{ hashFiles('CHROMIUM_VERSION') }}-v${{ env.CACHE_EPOCH }}
|
||||
- name: Cache Android NDK (Android)
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@@ -223,6 +231,12 @@ jobs:
|
||||
with:
|
||||
path: src/out/sysroot-build/android/
|
||||
key: sysroot-android-${{ matrix.arch }}-${{ hashFiles('CHROMIUM_VERSION') }}-v${{ env.CACHE_EPOCH }}
|
||||
- name: Host tool ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: src/.host_tool_cache
|
||||
key: ccache-posix-${{ hashFiles('CHROMIUM_VERSION') }}-${{ steps.ccache-timestamp.outputs.CCACHE_TIMESTAMP }}
|
||||
restore-keys: ccache-posix-${{ hashFiles('CHROMIUM_VERSION') }}-
|
||||
- id: ccache-timestamp
|
||||
run: echo "CCACHE_TIMESTAMP=$(date +%s)" >>$GITHUB_OUTPUT
|
||||
- name: Cache ccache files
|
||||
@@ -602,6 +616,11 @@ jobs:
|
||||
with:
|
||||
path: src/out/sysroot-build/openwrt
|
||||
key: sysroot-openwrt-23.05.0-${{ matrix.arch }}-v${{ env.CACHE_EPOCH }}
|
||||
- name: Host tool ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: src/.host_tool_cache
|
||||
key: ccache-posix-${{ hashFiles('CHROMIUM_VERSION') }}
|
||||
- id: ccache-timestamp
|
||||
run: echo "CCACHE_TIMESTAMP=$(date +%s)" >>$GITHUB_OUTPUT
|
||||
- name: Cache ccache files
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,5 +4,6 @@ src/gn/
|
||||
src/third_party/llvm-build/
|
||||
src/third_party/android_toolchain/
|
||||
src/out/
|
||||
src/.host_tool_cache/
|
||||
.vscode/
|
||||
*.pyc
|
||||
|
||||
14
src/build.sh
14
src/build.sh
@@ -79,6 +79,8 @@ flags="$flags"'
|
||||
|
||||
enable_backup_ref_ptr_support=false
|
||||
enable_dangling_raw_ptr_checks=false
|
||||
|
||||
use_clang_modules=false
|
||||
'
|
||||
|
||||
if [ "$WITH_SYSROOT" ]; then
|
||||
@@ -116,4 +118,16 @@ export DEPOT_TOOLS_WIN_TOOLCHAIN=0
|
||||
|
||||
./gn/out/gn gen "$out" --args="$flags $EXTRA_FLAGS"
|
||||
|
||||
if [ "$host_os" = linux ]; then
|
||||
clang_x64_targets=$(grep -o ' | .*' $out/toolchain.ninja | grep -o ' clang_x64/[^ ]*' | sort -u)
|
||||
if [ "$clang_x64_targets" ]; then
|
||||
CCACHE_DIR=$PWD/.host_tool_cache ccache -z
|
||||
CCACHE_DIR=$PWD/.host_tool_cache ninja -C "$out" $clang_x64_targets
|
||||
CCACHE_DIR=$PWD/.host_tool_cache ccache -s
|
||||
if [ "$WARMUP_HOST_TOOLS" ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
ninja -C "$out" naive
|
||||
|
||||
Reference in New Issue
Block a user