Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/scripts/build-sizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,20 @@ if [[ -f "${openroad_deps_prefixes}" ]]; then
done
fi

cmake_compiler_launcher_args=()
if command -v sccache >/dev/null 2>&1; then
echo "sccache detected at $(command -v sccache); enabling CMake compiler launcher"
cmake_compiler_launcher_args=(
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
)
else
echo "sccache not found on PATH; building without a compiler cache"
fi

cmake -S . -B build \
"${cmake_dependency_args[@]}" \
"${cmake_compiler_launcher_args[@]}" \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTS=OFF \
-DUSE_SYSTEM_BOOST=ON \
Expand All @@ -40,4 +52,12 @@ cmake -S . -B build \
-DZLIB_HOME=/usr/lib/x86_64-linux-gnu \
-DCMAKE_RULE_MESSAGES=OFF

if [[ ${#cmake_compiler_launcher_args[@]} -gt 0 ]]; then
if grep -q "sccache" build/src/CMakeFiles/Sizer.dir/build.make; then
echo "Verified: generated compile rules invoke sccache"
else
echo "WARNING: sccache is missing from the generated compile rules" >&2
fi
fi

cmake --build build --target Sizer -j "${NPROC:-$(nproc)}"
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
build-linux-x64:
name: Build Linux x64
runs-on: ubuntu-22.04
env:
# sccache-action does not enable the GHA cache backend by itself;
# without this, sccache falls back to an ephemeral local-disk cache.
SCCACHE_GHA_ENABLED: "true"
outputs:
archive-name: ${{ steps.package.outputs.archive-name }}
steps:
Expand All @@ -37,6 +41,10 @@ jobs:
env:
SIZER_VERSION: ${{ inputs.version }}

- name: Show sccache stats
if: always()
run: "${SCCACHE_PATH:-sccache} --show-stats"

- name: Package Sizer with runtime wrapper
id: package
env:
Expand Down
Loading