mirror of
https://github.com/verilator/verilator.git
synced 2026-08-29 01:13:53 +02:00
Cache key isolation: Include the build flavour (ccwarn/asan/gcov) in the build ccache key, so the coverage (gcov), asan, and RTLMeter (ccwarn-off) configurations no longer share and thrash the single '<runs-on>-<cc>' bucket, nor warm-start from each other's (near-useless) caches. Prune stale entries instead of a fixed size cap: After building/testing, evict ccache entries this run did not touch (--evict-older-than, based on the run's own duration). This bounds the saved cache to the current working set, so CCACHE_MAXSIZE and CCACHE_LIMIT_MULTIPLE are no longer needed and are removed (ccache falls back to its 5G default ceiling, but is realistically much smaller). ccache configuration: - Drop CCACHE_COMPRESS (already the default in ccache 4.x). - Add CCACHE_COMPILERCHECK=content, so a changed compiler mtime on a rebuilt ephemeral runner image does not invalidate the whole restored cache. - Hoist all ccache-related variables (CACHE_BASE_KEY, CCACHE_*, CXX) to the workflow-level env. Remove dead ccache scaffolding: - reusable-lint-py: the job never compiles or caches; drop its ccache env. - reusable-rtlmeter-run: remove the disabled persistent-cache step and its storage variables; keep CCACHE_DISABLE=1, since caching must stay off to keep RTLMeter timings representative. Store test job ccache as artifacts for reuse
36 lines
960 B
Bash
36 lines
960 B
Bash
# DESCRIPTION: Verilator: CI common definitions, sourced by the stage scripts
|
|
#
|
|
# SPDX-FileCopyrightText: 2026 Wilson Snyder
|
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
|
|
################################################################################
|
|
# Common definitions sourced by the CI stage scripts; not executed directly.
|
|
################################################################################
|
|
|
|
fatal() {
|
|
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
|
}
|
|
|
|
case "$(uname -s)" in
|
|
Linux)
|
|
HOST_OS=linux
|
|
MAKE=make
|
|
NPROC=$(nproc)
|
|
# Distro id/version; subshell keeps os-release out of our namespace
|
|
if [ -r /etc/os-release ]; then
|
|
DISTRO_ID=$(. /etc/os-release; echo "$ID")
|
|
DISTRO_VERSION=$(. /etc/os-release; echo "$VERSION_ID")
|
|
fi
|
|
;;
|
|
Darwin)
|
|
HOST_OS=macOS
|
|
MAKE=make
|
|
NPROC=$(sysctl -n hw.logicalcpu)
|
|
;;
|
|
*)
|
|
fatal "Unknown host OS: '$(uname -s)'"
|
|
;;
|
|
esac
|
|
|
|
export MAKE
|